1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleInvHistoryOld = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
38 title : "View inventory history - Hong Kong",
42 xtype: 'ContentPanel',
50 actioncomplete : function(_self,action)
52 if (action.type == 'setdata') {
53 //_this.dialog.el.mask("Loading");
54 //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
55 _this.grid.footer.onClick('first');
58 if (action.type == 'load') {
59 _this.dialog.el.unmask();
62 if (action.type =='submit') {
64 _this.dialog.el.unmask();
68 _this.callback.call(_this, _this.form.getValues());
74 rendered : function (form)
80 style : 'margin:10px;',
81 url : baseURL + '/Roo/invhist.php',
92 select : function (combo, record, index)
98 _this.grid.footer.onClick('first');
104 displayField : 'itemsite_item_id_item_number',
106 emptyText : "Select itemsite",
108 forceSelection : true,
110 loadingText : "Searching...",
112 name : 'itemsite_item_id_item_number',
114 qtip : "Select itemsite",
115 queryParam : 'query[number]',
116 selectOnFocus : true,
117 tpl : '<div class="x-grid-cell-text x-btn button"><b>{itemsite_item_id_item_number}</b> {itemsite_item_id_item_descrip1}</div>',
118 triggerAction : 'all',
120 valueField : 'itemsite_item_id_item_number',
126 beforeload : function (_self, o){
127 o.params = o.params || {};
132 sortInfo : { direction : 'ASC', field: 'id' },
137 url : baseURL + '/Xtuple/Roo/itemsite.php'
144 totalProperty : 'total',
145 fields : [{"name":"id","type":"int"},{"name":"itemsite_abcclass","type":"string"}]
153 select : function (combo, record, index)
159 _this.grid.footer.onClick('first');
165 displayField : 'location_descrip',
167 emptyText : "Select location",
168 fieldLabel : 'location',
169 forceSelection : true,
170 hiddenName : 'location_name',
172 loadingText : "Searching...",
174 name : 'location_descrip',
176 qtip : "Select location",
177 queryParam : 'query[location_name]',
178 selectOnFocus : true,
179 tpl : '<div class="x-grid-cell-text x-btn button"><b>{location_descrip}</b> </div>',
180 triggerAction : 'all',
182 valueField : 'location_name',
188 beforeload : function (_self, o){
189 o.params = o.params || {};
194 sortInfo : { direction : 'ASC', field: 'location_name' },
199 url : baseURL + '/Xtuple/Roo/location.php'
206 totalProperty : 'total',
207 fields : [{"name":"id","type":"int"},{"name":"location_name","type":"string"}]
221 activate : function() {
224 _this.grid.footer.onClick('first');
232 tableName : 'invhist',
241 //_this.dialog = Pman.Dialog.FILL_IN
242 if (_this.panel.active) {
243 this.footer.onClick('first');
246 rowdblclick : function (_self, rowIndex, e)
248 if (!_this.dialog) return;
249 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
250 _this.grid.footer.onClick('first');
254 autoExpandColumn : 'invhist_comments',
260 beforeload : function (_self, o)
262 if (!_this.form.findField('itemsite_item_id_item_number').getValue().length
263 && !_this.form.findField('location_name').getValue().length) {
264 _this.grid.ds.removeAll();
267 o.params['query[item_number]'] = _this.form.findField('itemsite_item_id_item_number').getValue();
268 o.params['query[location_name]'] = _this.form.findField('location_name').getValue();
269 o.params._with_item =1;
270 o.params._hide_void =1;
274 sortInfo : { field : 'invhist_transdate,invdetail_id', direction: 'DESC' },
279 url : baseURL + '/Xtuple/Roo/invdetail.php'
284 totalProperty : 'total',
289 'name': 'invhist_id',
293 'name': 'invhist_itemsite_id',
297 'name': 'invhist_transdate',
299 'dateFormat': 'Y-m-d'
302 'name': 'invhist_transtype',
306 'name': 'invhist_invqty',
310 'name': 'invhist_invuom',
314 'name': 'invhist_ordnumber',
318 'name': 'invhist_docnumber',
322 'name': 'invhist_qoh_before',
326 'name': 'invhist_qoh_after',
330 'name': 'invhist_unitcost',
334 'name': 'invhist_acct_id',
338 'name': 'invhist_xfer_warehous_id',
342 'name': 'invhist_comments',
346 'name': 'invhist_posted',
350 'name': 'invhist_imported',
354 'name': 'invhist_hasdetail',
358 'name': 'invhist_ordtype',
362 'name': 'invhist_analyze',
366 'name': 'invhist_user',
370 'name': 'invhist_created',
372 'dateFormat': 'Y-m-d'
375 'name': 'invhist_costmethod',
379 'name': 'invhist_value_before',
383 'name': 'invhist_value_after',
387 'name': 'invhist_series',
394 xtype: 'PagingToolbar',
398 displayMsg : "Displaying invhist{0} - {1} of {2}",
399 emptyMsg : "No invhist found"
403 xtype: 'ColumnModel',
405 dataIndex : 'invhist_transdate',
406 header : 'Invhist transdate',
408 renderer : function(v) {
409 var vv = Date.parseDate(v.split(' ')[0],'Y-m-d' );
410 return String.format('{0}', vv ? vv.format('d/M/Y') : '');
414 xtype: 'ColumnModel',
416 dataIndex : 'invhist_ordnumber',
419 renderer : function(v) { return String.format('{0}', v); }
422 xtype: 'ColumnModel',
424 dataIndex : 'invhist_docnumber',
427 renderer : function(v) { return String.format('{0}', v); }
430 xtype: 'ColumnModel',
432 dataIndex : 'invhist_transtype',
435 renderer : function(v,x,r) { return String.format('{0}/{1}', v,r.data.invhist_ordtype); }
438 xtype: 'ColumnModel',
441 dataIndex : 'invhist_unitcost',
444 renderer : function(v) { return String.format('{0}', v); }
447 xtype: 'ColumnModel',
450 dataIndex : 'invfifo_unitcost',
453 renderer : function(v) { return String.format('{0}', v); }
456 xtype: 'ColumnModel',
458 dataIndex : 'location_name',
461 renderer : function(v) { return String.format('<B>{0}</B>', v); }
464 xtype: 'ColumnModel',
467 dataIndex : 'invdetail_qty',
470 renderer : function(v) { return String.format('{0}', parseInt( v)); }
473 xtype: 'ColumnModel',
476 dataIndex : 'invdetail_bydate_qty',
477 header : 'Qty Before',
479 renderer : function(v,x,r) { return String.format('<B>{0}</B>', parseInt(v)- parseInt(r.data.invdetail_qty)); }
482 xtype: 'ColumnModel',
485 dataIndex : 'invdetail_bydate_qty',
486 header : 'Qty after',
488 renderer : function(v) { return String.format('<B>{0}</B>', parseInt( v)); }
491 xtype: 'ColumnModel',
493 header : 'Invhist comments',
495 dataIndex : 'invhist_comments',
496 renderer : function(v) { return String.format('{0}', v); }
503 xtype: 'LayoutRegion',
508 xtype: 'LayoutRegion',
516 click : function (_self, e)
529 click : function (_self, e)