1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.XtupleAdjustmentGroup = new Roo.XComponent({
6 part : ["Xtuple","AdjustmentGroup"],
7 order : '001-Pman.Tab.XtupleAdjustmentGroup',
9 parent : 'Pman.Tab.XtupleAdjustmentTab',
10 name : "unnamed module",
21 activate : function() {
24 _this.grid.footer.onClick('first');
32 tableName : 'invadjgrp',
33 title : "Inventroy Adjustment Groups",
41 if (_this.panel.active) {
42 this.footer.onClick('first');
45 rowdblclick : function (_self, rowIndex, e)
47 var s = _this.grid.ds.getAt(rowIndex);
49 Pman.Dialog.XtupleAdjustmentGroup.show( { invadjgrp_id : s.data.invadjgrp_id } , function() {
50 _this.grid.footer.onClick('first');
53 cellclick : function (_self, rowIndex, columnIndex, e)
55 var c = _this.grid.colModel.config[columnIndex];
58 if (di != 'invadjgrp_posted') {
62 var r = _this.grid.ds.getAt(rowIndex);
63 if (r.data.invadjgrp_posted ) { // nos ur
64 Roo.MessageBox.alert("Error", "Group is already posted");
67 if (r.data.invadjgrp_void * 1 ) {
68 Roo.MessageBox.alert("Error", "Group is already void");
71 Roo.MessageBox.confirm(
73 "Are you sure it's ready to post?",
80 url : baseURL + '/Roo/Invadjgrp',
85 invadjgrp_id : r.data.invadjgrp_id,
89 success : function(res) {
90 _this.grid.footer.onClick('first');
92 failure : function (res) {
94 Roo.MessageBox.alert("Error",res.errorMsg || "Error sending");
102 autoExpandColumn : 'invadjgrp_comments',
105 xtype: 'RowSelectionModel',
113 beforeload : function (_self, o)
115 o.params = o.params || {};
117 o.params._with_qty_detail = 1;
121 sortInfo : { field : 'invadjgrp_id', direction: 'DESC' },
126 url : baseURL + '/Roo/Invadjgrp.php'
133 totalProperty : 'total',
136 'name': 'invadjgrp_id',
140 'name': 'invadjgrp_location_id',
147 xtype: 'PagingToolbar',
150 displayMsg : "Displaying Inventory Adjustment Groups{0} - {1} of {2}",
151 emptyMsg : "No Inventory Adjustment Groups found",
164 Pman.Dialog.XtupleAdjustmentGroup.show( { invadjgrp_id : 0 } , function() {
165 _this.grid.footer.onClick('first');
169 cls : 'x-btn-text-icon',
171 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
183 var s = _this.grid.getSelectionModel().getSelected();
184 if (!s || s.data.invadjgrp_id * 1 < 1 ) {
185 Roo.MessageBox.alert("Error", "Select a inventory adjustment group");
188 if (!s || s.data.invadjgrp_void * 1 ) {
189 Roo.MessageBox.alert("Error", "Group is already void");
193 if (!s.data.invadjgrp_posted) {
194 Roo.MessageBox.alert('Error', 'This group has not been posted yet!');
198 var voidit = function(force){
200 url : baseURL + '/Roo/Invadjgrp',
204 invadjgrp_id : s.data.invadjgrp_id,
208 success : function(res) {
209 _this.grid.footer.onClick('first');
211 failure : function (res) {
214 if (res.errors.confirm) {
216 Roo.MessageBox.confirm(
218 "There are some adjustments have been voided of this group! Do you want to void this group anyway?",
229 Roo.MessageBox.alert("Error", res.errorMsg);
238 cls : 'x-btn-text-icon',
240 icon : rootURL + '/Pman/templates/images/trash.gif'
248 var s = _this.grid.getSelectionModel().getSelected();
250 if (!s || s.data.invadjgrp_id * 1 < 1 ) {
251 Roo.MessageBox.alert("Error", "Select a inventory adjustment group");
255 if (s.data.invadjgrp_posted) {
256 Roo.MessageBox.alert('Error', 'You can not delete the posted adjustment, try void it');
261 url : baseURL + '/Roo/Invadjgrp',
263 params : { _delete : s.data.invadjgrp_id },
265 success : function(res) {
266 _this.grid.footer.onClick('first');
272 cls : 'x-btn-text-icon',
274 icon : rootURL + '/Pman/templates/images/trash.gif'
280 xtype: 'ColumnModel',
282 dataIndex : 'invadjgrp_id',
285 renderer : function(v,x,r) { return String.format(r.data.invadjgrp_void *1 ? '<s>{0}</s>' : '{0}', v); }
288 xtype: 'ColumnModel',
290 dataIndex : 'invadjgrp_name',
293 renderer : function(v,x,r) { return String.format(r.data.invadjgrp_void *1 ? '<s>{0}</s>' : '{0}', v); }
296 xtype: 'ColumnModel',
298 dataIndex : 'invadjgrp_transdate',
301 renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d') : ''); }
304 xtype: 'ColumnModel',
306 dataIndex : 'invadjgrp_neg_qty',
309 renderer : function(v) { return String.format('{0}', parseInt(v).toFixed(0)); }
312 xtype: 'ColumnModel',
314 dataIndex : 'invadjgrp_pos_qty',
317 renderer : function(v) { return String.format('{0}', parseInt(v).toFixed(0)); }
320 xtype: 'ColumnModel',
322 dataIndex : 'invadjgrp_location_id_location_name',
325 renderer : function(v) { return String.format('{0}', v); }
328 xtype: 'ColumnModel',
330 dataIndex : 'invadjgrp_comments',
333 renderer : function(v,x,r) { return String.format(r.data.invadjgrp_void *1 ? '<s>{0}</s>' : '{0}', v); }
336 xtype: 'ColumnModel',
338 dataIndex : 'invadjgrp_posted',
341 renderer : function(v,x,r) {
343 if (r.data.invadjgrp_void *1) {
346 var state = v * 1 > 0 ? '-checked' : '';
348 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';