1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleInvHistory = {
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",
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 specialkey : function (_self, e)
95 _this.grid.footer.onClick('first');
98 fieldLabel : 'Search Product',
105 select : function (combo, record, index)
111 _this.grid.footer.onClick('first');
117 displayField : 'itemsite_item_id_item_number',
119 emptyText : "Select itemsite",
121 forceSelection : true,
123 loadingText : "Searching...",
125 name : 'itemsite_item_id_item_number',
127 qtip : "Select itemsite",
128 queryParam : 'query[number]',
129 selectOnFocus : true,
130 tpl : '<div class="x-grid-cell-text x-btn button"><b>{itemsite_item_id_item_number}</b> {itemsite_item_id_item_descrip1}</div>',
131 triggerAction : 'all',
133 valueField : 'itemsite_item_id_item_number',
139 beforeload : function (_self, o){
140 o.params = o.params || {};
145 sortInfo : { direction : 'ASC', field: 'id' },
150 url : baseURL + '/Roo/itemsite.php'
157 totalProperty : 'total',
158 fields : [{"name":"id","type":"int"},{"name":"itemsite_abcclass","type":"string"}]
166 select : function (combo, record, index)
172 _this.grid.footer.onClick('first');
178 displayField : 'location_descrip',
180 emptyText : "Select location",
181 fieldLabel : 'location',
182 forceSelection : true,
183 hiddenName : 'location_name',
185 loadingText : "Searching...",
187 name : 'location_descrip',
189 qtip : "Select location",
190 queryParam : 'query[location_name]',
191 selectOnFocus : true,
192 tpl : '<div class="x-grid-cell-text x-btn button"><b>{location_descrip}</b> </div>',
193 triggerAction : 'all',
195 valueField : 'location_name',
201 beforeload : function (_self, o){
202 o.params = o.params || {};
207 sortInfo : { direction : 'ASC', field: 'location_name' },
212 url : baseURL + '/Roo/location.php'
219 totalProperty : 'total',
220 fields : [{"name":"id","type":"int"},{"name":"location_name","type":"string"}]
234 activate : function() {
237 _this.grid.footer.onClick('first');
245 tableName : 'invhist',
254 //_this.dialog = Pman.Dialog.FILL_IN
255 if (_this.panel.active) {
256 this.footer.onClick('first');
259 rowdblclick : function (_self, rowIndex, e)
261 if (!_this.dialog) return;
262 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
263 _this.grid.footer.onClick('first');
267 autoExpandColumn : 'invhist_comments',
273 beforeload : function (_self, o)
275 if (!_this.form.findField('itemsite_item_id_item_number').getValue().length &&
276 !_this.form.findField('location_name').getValue().length
277 && !_this.form.findField('search_name').getValue().length ) {
278 _this.grid.ds.removeAll();
281 o.params['query[item_number]'] = _this.form.findField('itemsite_item_id_item_number').getValue();
282 o.params['query[location_name]'] = _this.form.findField('location_name').getValue();
283 o.params['search[item]'] = _this.form.findField('search_name').getValue();
286 o.params._with_item =1;
287 o.params._hide_void =1;
288 o.params._with_balance = 1;
293 sortInfo : { field : 'invhist_transdate,invdetail_id', direction: 'DESC' },
298 url : baseURL + '/Roo/invdetail.php'
303 totalProperty : 'total',
308 'name': 'invhist_id',
312 'name': 'invhist_itemsite_id',
316 'name': 'invhist_transdate',
318 'dateFormat': 'Y-m-d'
321 'name': 'invhist_transtype',
325 'name': 'invhist_invqty',
329 'name': 'invhist_invuom',
333 'name': 'invhist_ordnumber',
337 'name': 'invhist_docnumber',
341 'name': 'invhist_qoh_before',
345 'name': 'invhist_qoh_after',
349 'name': 'invhist_unitcost',
353 'name': 'invhist_acct_id',
357 'name': 'invhist_xfer_warehous_id',
361 'name': 'invhist_comments',
365 'name': 'invhist_posted',
369 'name': 'invhist_imported',
373 'name': 'invhist_hasdetail',
377 'name': 'invhist_ordtype',
381 'name': 'invhist_analyze',
385 'name': 'invhist_user',
389 'name': 'invhist_created',
391 'dateFormat': 'Y-m-d'
394 'name': 'invhist_costmethod',
398 'name': 'invhist_value_before',
402 'name': 'invhist_value_after',
406 'name': 'invhist_series',
413 xtype: 'PagingToolbar',
417 displayMsg : "Displaying invhist{0} - {1} of {2}",
418 emptyMsg : "No invhist found"
422 xtype: 'ColumnModel',
424 dataIndex : 'invhist_transdate',
425 header : 'Invhist transdate',
427 renderer : function(v) {
428 var vv = Date.parseDate(v.split(' ')[0],'Y-m-d' );
429 return String.format('{0}', vv ? vv.format('d/M/Y') : '');
433 xtype: 'ColumnModel',
435 dataIndex : 'invhist_ordnumber',
438 renderer : function(v) { return String.format('{0}', v); }
441 xtype: 'ColumnModel',
443 dataIndex : 'item_number',
446 renderer : function(v) { return String.format('{0}', v); }
449 xtype: 'ColumnModel',
451 dataIndex : 'item_descrip1',
454 renderer : function(v) { return String.format('{0}', v); }
457 xtype: 'ColumnModel',
459 dataIndex : 'invhist_docnumber',
462 renderer : function(v) { return String.format('{0}', v); }
465 xtype: 'ColumnModel',
467 dataIndex : 'invhist_transtype',
470 renderer : function(v,x,r) { return String.format('{0}/{1}', v,r.data.invhist_ordtype); }
473 xtype: 'ColumnModel',
476 dataIndex : 'invhist_unitcost',
477 header : ' unitcost',
479 renderer : function(v) { return String.format('{0}', v); }
482 xtype: 'ColumnModel',
484 dataIndex : 'location_name',
487 renderer : function(v) { return String.format('<B>{0}</B>', v); }
490 xtype: 'ColumnModel',
493 dataIndex : 'invdetail_qty',
496 renderer : function(v) { return String.format('{0}', parseInt( v)); }
499 xtype: 'ColumnModel',
502 dataIndex : 'invdetail_before_qty',
503 header : 'Opening Balance',
505 renderer : function(v) { return String.format('{0}', parseInt( v)); }
508 xtype: 'ColumnModel',
511 dataIndex : 'invdetail_balance_qty',
512 header : 'Closing Balance',
514 renderer : function(v) { return String.format('{0}', parseInt( v)); }
517 xtype: 'ColumnModel',
519 dataIndex : 'invhist_comments',
520 header : 'Invhist comments',
522 renderer : function(v) { return String.format('{0}', v); }
529 xtype: 'LayoutRegion',
534 xtype: 'LayoutRegion',
542 click : function (_self, e)
544 Pman.Dialog.XtupleInvHistoryOld.show({
545 itemsite_item_id_item_number : _this.data.itemsite_item_id_item_number,
547 location_name : _this.data.location_name,
548 location_descrip : _this.data.location_descrip,
549 invhist_transdate : _this.data.invhist_transdate
553 text : "View (HK data)",
554 hidden : (function() {
555 return !!baseURL.match(/hk\.php/);
562 click : function (_self, e)
575 click : function (_self, e)