1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.XtupleItem = new Roo.XComponent({
10 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
11 '41e902bb1b2db625736ede3bacc41fe0' :"is Sold?",
12 'ce4ee01637f4279d02d0f232459dc9a4' :"Purchased",
13 '1be6f9eb563f3bf85c78b4219bf09de9' :"Brand",
14 'aa554e9e2270df2127bfe9096f1bd9ce' :"Displaying item{0} - {1} of {2}",
15 'ce5bf551379459c1c61d2a204061c455' :"Location",
16 '44ca8ce0e02dee5d520525ac21bcbee9' :"Sync Product from HK (Based on Search)",
17 '068f80c7519d0528fb08e82137a72131' :"Products",
18 '68f43fdcf074903d65da764642a4b968' :"is Active?",
19 '759d259249621c817551c5fe726d5c57' :"itemloc",
20 '89217b1527e14cced20e78111a8f5027' :"Item prodcat",
21 'e924991fc4c883bc237e69efe884d674' :"Download Sales Report",
22 'ee3585dbcb1e8f8826f3403c1e9d898c' :"Rename SKU",
23 '20b4f77bd00b4f63a49ec8e08f3bf6a6' :"Cost",
24 'fe78f3efbfa84d8485d589031596c5b8' :"Pallet",
25 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
26 '19029645d5286771ac708d1bcd118bf4' :"Displaying itemloc{0} - {1} of {2}",
27 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
28 '99a808d8d16122d70e44bd7f709d30fb' :"Balance",
29 '9a8faafb674c03474827bcb6fcde43a3' :"Search Product",
30 'f1c3ca6cadc4a9f57a08d5f7482a3f83' :"No item found",
31 'd6ea9efa48916e9563d76ddc233ebe2a' :"Sync Product from HK (New Products Only)",
32 '2cfd827c6e37453fe1ddde82a5bd9474' :"No itemloc found",
33 'd8ab3576a67fe0cc175ee77d57d0fd85' :"Pickface",
34 '5bc3fd20294c17c9803942958fd7f26d' :"Show Inactive",
35 '70cd7e06502a63356290711ec3b11223' :"Upload new products and costs",
36 'c6ca371871d835c79c8654b5cd788cc7' :"Product Group",
37 '695dbdb13fad32669a68d8fec8541c7f' :"Download Standard costs",
38 '156567f65fc207d39cadbf045687c521' :"Itemloc qty",
39 'c2f1d503b95bf9f3aa4d775a216c5c73' :"Sync Product Data from HK",
40 '36c454c4130e4444e8410f11d6d998f0' :"Tools - Upload/Download",
41 'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
42 '7fee866379427143414dd7a72e56414b' :"Report start :",
43 'a9e35d03ee7f31f5bb199379a6d3547a' :"Select Brand",
44 '35be52be39d3efcd0cd2b3721fc3c298' :"Cost (base)",
45 '750587d31c68779e7f615c190a9dc23f' :"Last purchase price",
46 'b2ee912b91d69b435159c7c3f6df7f5f' :"Number",
47 '173cf046739c17fd7c97ec3540d58807' :"(function() { return (new Date()).format('Y') + '-01-01'; })()",
48 'c20ad4d76fe97759aa27a0c99bff6710' :"12"
51 part : ["Xtuple", "Item" ],
52 order : '001-Pman.Tab.XtupleItem',
54 parent : 'Pman.Tab.XtupleManage',
55 name : "Pman.Tab.XtupleItem",
67 xtype : 'LayoutRegion'
74 xtype : 'LayoutRegion'
78 xtype : 'BorderLayout',
86 url : baseURL + '/Roo/item.php',
98 'name': 'item_number',
102 'name': 'item_descrip1',
106 'name': 'item_descrip2',
110 'name': 'item_classcode_id',
114 'name': 'item_picklist',
118 'name': 'item_comments',
126 'name': 'item_fractional',
130 'name': 'item_active',
138 'name': 'item_prodweight',
142 'name': 'item_packweight',
146 'name': 'item_prodcat_id',
150 'name': 'item_exclusive',
154 'name': 'item_listprice',
158 'name': 'item_config',
162 'name': 'item_extdescrip',
166 'name': 'item_upccode',
170 'name': 'item_maxcost',
174 'name': 'item_inv_uom_id',
178 'name': 'item_price_uom_id',
182 'name': 'item_warrdays',
186 'name': 'item_freightclass_id',
190 'name': 'item_tax_recoverable',
194 'name': 'item_price_uom_id_uom_id',
198 'name': 'item_price_uom_id_uom_name',
202 'name': 'item_price_uom_id_uom_descrip',
206 'name': 'item_price_uom_id_uom_item_weight',
210 'name': 'item_inv_uom_id_uom_id',
214 'name': 'item_inv_uom_id_uom_name',
218 'name': 'item_inv_uom_id_uom_descrip',
222 'name': 'item_inv_uom_id_uom_item_weight',
226 'name': 'item_freightclass_id_freightclass_id',
230 'name': 'item_freightclass_id_freightclass_code',
234 'name': 'item_freightclass_id_freightclass_descrip',
238 'name': 'item_classcode_id_classcode_id',
242 'name': 'item_classcode_id_classcode_code',
246 'name': 'item_classcode_id_classcode_descrip',
250 'name': 'item_classcode_id_classcode_mfg',
254 'name': 'item_classcode_id_classcode_creator',
258 'name': 'item_classcode_id_classcode_created',
262 'name': 'item_classcode_id_classcode_modifier',
266 'name': 'item_classcode_id_classcode_modified',
270 'name': 'item_classcode_id_classcode_type',
276 totalProperty : 'total',
282 sortInfo : { field : 'item_number', direction: 'ASC' },
286 beforeload : function (_self, o)
288 o.params._with_prodcat = 1;
289 o.params._with_char = 1;
290 o.params._with_itemsrc_active = 1;
291 o.params._with_last_purchase_price = 1;
292 o.params._with_image = 1;
293 var s = _this.search.getValue();
295 o.params['query[number_or_name]'] = s;
297 if (!_this.active.pressed) {
298 o.params.item_active = 1;
300 if (_this.brandSel.getValue().length) {
301 o.params._with_brand = _this.brandSel.getValue()
304 o.params._with_stock_balance = 1;
306 load : function (_self, records, options)
309 var cm = _this.grid.getColumnModel();
311 cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);
314 update : function (_self, record, operation)
316 if(operation != 'commit'){
320 var nv = record.data.itemsrc_active ? 0 : 1;
323 url : baseURL + '/Roo/Itemsrc',
326 item_id : record.data.item_id,
329 success : function(res) {
330 record.set('itemsrc_active', nv);
350 url : baseURL + '/Roo/Charass.php',
362 'name': 'person_name',
366 'name': 'event_when',
368 'dateFormat': 'Y-m-d'
395 'name': 'person_id_id',
399 'name': 'person_id_office_id',
403 'name': 'person_id_name',
407 'name': 'person_id_phone',
411 'name': 'person_id_fax',
415 'name': 'person_id_email',
419 'name': 'person_id_company_id',
423 'name': 'person_id_role',
427 'name': 'person_id_active',
431 'name': 'person_id_remarks',
435 'name': 'person_id_passwd',
439 'name': 'person_id_owner_id',
443 'name': 'person_id_lang',
447 'name': 'person_id_no_reset_sent',
451 'name': 'person_id_action_type',
455 'name': 'person_id_project_id',
459 'name': 'person_id_deleted_by',
463 'name': 'person_id_deleted_dt',
469 totalProperty : 'total',
475 sortInfo : { field : 'charass_value' , direction : 'ASC' },
479 beforeload : function (_self, o)
481 o.params = o.params || {};
482 // staff can see all logs, other companies can only see their own.
483 // look for all of the charass 's with the same type= eg. brand.
485 o.params.charass_char_id_char_name = 'BRAND';
486 o.params.charass_target_type ='I';
487 o.params._distinct = 'charass_value';
488 o.params._columns = 'charass_value';
500 displayField : 'charass_value',
502 emptyText : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
503 forceSelection : true,
505 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
508 qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
509 queryParam : 'query[charass_value]',
510 selectOnFocus : true,
511 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
512 triggerAction : 'all',
517 render : function (_self)
519 _this.brandSel = _self;
521 select : function (combo, record, index)
523 _this.grid.footer.onClick('first');
533 emptyText : _this._strings['9a8faafb674c03474827bcb6fcde43a3'],
537 render : function (_self)
539 _this.search = _self;
541 specialkey : function (_self, e)
543 _this.grid.footer.onClick('first');
548 '|xns' : 'Roo.Toolbar',
550 icon : rootURL + '/Pman/templates/images/search.gif',
554 click : function (_self, e)
556 _this.grid.footer.onClick('first');
561 '|xns' : 'Roo.Toolbar',
563 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
567 click : function (_self, e)
569 _this.search.setValue('');
573 _this.grid.footer.onClick('first');
578 '|xns' : 'Roo.Toolbar',
583 '|xns' : 'Roo.Toolbar',
585 text : _this._strings['5bc3fd20294c17c9803942958fd7f26d'],
589 render : function (_self)
591 _this.active = _self;
593 toggle : function (_self, pressed)
596 this.setText(pressed ? "Hide Inactive" : "Show Inactive");
597 (function() { _this.grid.footer.onClick('first'); }).defer(100);
602 '|xns' : 'Roo.Toolbar',
607 '|xns' : 'Roo.Toolbar',
608 cls : 'x-btn-text-icon',
609 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
610 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
617 Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {
618 _this.grid.footer.onClick('first');
624 '|xns' : 'Roo.Toolbar',
625 text : _this._strings['ee3585dbcb1e8f8826f3403c1e9d898c'],
631 var s = _this.grid.selModel.getSelectedCell();
633 Roo.MessageBox.alert("Error", "Select a product");
636 var rec = _this.grid.ds.getAt(s[0]);
640 Roo.MessageBox.prompt(
642 "Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok",
650 item_id : rec.data.item_id,
663 var change = function(params){
665 url : baseURL + '/Roo/Item',
669 success : function(res) {
671 _this.grid.footer.onClick('refresh');
672 if(typeof(res.data) == 'string'){
673 Roo.MessageBox.alert("Notice", 'SKU has been renamed');
677 Roo.each(res.data, function(o){
678 offices.push(Pman.Xtuple.offices[o]);
680 Roo.MessageBox.alert("Notice", 'SKU has been renamed in ' + offices.join(", "));
683 failure : function(res) {
686 if (res.errors.confirm.length) {
688 Roo.each(res.errors.confirm, function(o){
689 offices.push(Pman.Xtuple.offices[o]);
691 Roo.MessageBox.confirm(
693 " Do you want to change the name in " + offices.join(", ") + "?",
696 Roo.MessageBox.alert("Notice", 'SKU was not changed');
699 delete params['_check'];
700 params._can_change_sku = 1;
707 Roo.MessageBox.alert("Error", res.errorMsg);
717 '|xns' : 'Roo.Toolbar',
722 '|xns' : 'Roo.Toolbar',
723 text : _this._strings['7fee866379427143414dd7a72e56414b'],
731 value : (function() { return (new Date()).format('Y') + '-01-01'; })(),
735 render : function (_self)
737 _this.dateFrom = _self;
745 [ '1', "Single Month Sales"],
746 [ '3', "Quarter Sales"],
747 [ '6', "Half year Sales"] ,
748 [ '12', "Full Year Sales"]
750 fields : [ 'ftype', 'fname'],
752 xtype : 'SimpleStore'
756 displayField : 'fname',
758 fieldLabel : 'Status',
759 hiddenName : 'cm_status',
762 name : 'cm_status_name',
763 triggerAction : 'all',
765 valueField : 'ftype',
770 render : function (_self)
772 _this.datespan = _self;
781 '|xns' : 'Roo.Toolbar',
782 text : _this._strings['e924991fc4c883bc237e69efe884d674'],
786 click : function (_self, e)
788 if (!_this.brandSel.getValue().length) {
789 Roo.MessageBox.alert("Error", "Select a brand to download");
794 url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',
796 date_from : _this.dateFrom.getValue(),
797 brand : _this.brandSel.getValue(),
798 span : _this.datespan.getValue()
812 displayMsg : _this._strings['aa554e9e2270df2127bfe9096f1bd9ce'],
813 emptyMsg : _this._strings['f1c3ca6cadc4a9f57a08d5f7482a3f83'],
816 xtype : 'PagingToolbar',
826 text : _this._strings['695dbdb13fad32669a68d8fec8541c7f'],
830 click : function (_self, e)
834 url : baseURL + '/Roo/item',
844 text : _this._strings['70cd7e06502a63356290711ec3b11223'],
848 click : function (_self, e)
850 // Roo.MessageBox.alert("Disabled", "Can you please send Alan the test file for this - there is a problem and we need to fix it before you use this again");
853 Pman.Dialog.Image.show(
855 _url : baseURL+'/Xtuple/Import/Products',
863 msg.push("Updated " + data.updated + " Products(s)");
866 msg.push("Added " + data.inserted + " Products(s)");
869 msg.push("Skipped " + data.skipped);
873 msg.push("No data changed");
875 Roo.MessageBox.alert("Notice", msg.join("\n"));
889 hidden : (function() {
891 return baseURL.match(/hk\.php$/) ? true : false;
893 text : _this._strings['c2f1d503b95bf9f3aa4d775a216c5c73'],
897 click : function (_self, e)
899 Roo.MessageBox.progress ("Syncing Stock", "Sending");
906 url : baseURL+'/Roo/Item',
913 success : function(res) {
915 if (!res.data.total) {
916 Roo.MessageBox.hide();
919 offset += res.data.limit;
920 Roo.MessageBox.updateProgress ( offset / res.data.total, "Done " + offset + '/' + res.data.total);
933 hidden : (function() {
935 return baseURL.match(/hk\.php$/) ? true : false;
937 text : _this._strings['d6ea9efa48916e9563d76ddc233ebe2a'],
941 click : function (_self, e)
943 Roo.MessageBox.progress ("Syncing Stock", "Sending");
950 url : baseURL+'/Roo/Item',
956 success : function(res) {
959 Roo.MessageBox.hide();
960 _this.grid.footer.onClick('refresh');
973 hidden : (function() {
975 return baseURL.match(/hk\.php$/) ? true : false;
977 text : _this._strings['44ca8ce0e02dee5d520525ac21bcbee9'],
981 click : function (_self, e)
983 Roo.MessageBox.progress ("Syncing Stock", "Sending");
990 url : baseURL+'/Roo/Item',
994 item_number : _this.search.getValue()
996 success : function(res) {
999 Roo.MessageBox.hide();
1000 _this.grid.footer.onClick('refresh');
1014 '|xns' : 'Roo.Toolbar',
1015 text : _this._strings['36c454c4130e4444e8410f11d6d998f0'],
1026 '|xns' : 'Roo.grid',
1027 autoExpandColumn : 'item_descrip1',
1031 xtype : 'EditorGrid',
1034 '|xns' : 'Roo.grid',
1035 dataIndex : 'item_image_id',
1036 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
1037 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/50/{1}/{2}" height="50">', baseURL, v, r.data.item_image_filename); },
1041 xtype : 'ColumnModel'
1048 '|xns' : 'Roo.data',
1050 url : baseURL + '/Roo/Charass.php',
1055 '|xns' : 'Roo.data',
1062 'name': 'person_name',
1066 'name': 'event_when',
1068 'dateFormat': 'Y-m-d'
1087 'name': 'person_id',
1095 'name': 'person_id_id',
1099 'name': 'person_id_office_id',
1103 'name': 'person_id_name',
1107 'name': 'person_id_phone',
1111 'name': 'person_id_fax',
1115 'name': 'person_id_email',
1119 'name': 'person_id_company_id',
1123 'name': 'person_id_role',
1127 'name': 'person_id_active',
1131 'name': 'person_id_remarks',
1135 'name': 'person_id_passwd',
1139 'name': 'person_id_owner_id',
1143 'name': 'person_id_lang',
1147 'name': 'person_id_no_reset_sent',
1151 'name': 'person_id_action_type',
1155 'name': 'person_id_project_id',
1159 'name': 'person_id_deleted_by',
1163 'name': 'person_id_deleted_dt',
1169 totalProperty : 'total',
1171 xtype : 'JsonReader'
1173 '|xns' : 'Roo.data',
1175 sortInfo : { field : 'charass_value' , direction : 'ASC' },
1179 beforeload : function (_self, o)
1181 o.params = o.params || {};
1182 // staff can see all logs, other companies can only see their own.
1183 // look for all of the charass 's with the same type= eg. brand.
1185 o.params.charass_char_id_char_name = 'BRAND';
1186 o.params.charass_target_type ='I';
1187 o.params._distinct = 'charass_value';
1188 o.params._columns = 'charass_value';
1197 '|xns' : 'Roo.form',
1200 displayField : 'charass_value',
1202 forceSelection : false,
1204 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
1207 qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
1208 queryParam : 'query[charass_value]',
1209 selectOnFocus : true,
1210 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
1211 triggerAction : 'all',
1220 '|xns' : 'Roo.grid',
1222 xtype : 'GridEditor',
1228 '|xns' : 'Roo.grid',
1229 dataIndex : 'item_char_brand',
1230 header : _this._strings['1be6f9eb563f3bf85c78b4219bf09de9'],
1231 renderer : function(v) { return String.format('{0}', v); },
1235 xtype : 'ColumnModel',
1246 '|xns' : 'Roo.data',
1248 url : baseURL + '/Roo/Charass.php',
1253 '|xns' : 'Roo.data',
1260 'name': 'person_name',
1264 'name': 'event_when',
1266 'dateFormat': 'Y-m-d'
1285 'name': 'person_id',
1293 'name': 'person_id_id',
1297 'name': 'person_id_office_id',
1301 'name': 'person_id_name',
1305 'name': 'person_id_phone',
1309 'name': 'person_id_fax',
1313 'name': 'person_id_email',
1317 'name': 'person_id_company_id',
1321 'name': 'person_id_role',
1325 'name': 'person_id_active',
1329 'name': 'person_id_remarks',
1333 'name': 'person_id_passwd',
1337 'name': 'person_id_owner_id',
1341 'name': 'person_id_lang',
1345 'name': 'person_id_no_reset_sent',
1349 'name': 'person_id_action_type',
1353 'name': 'person_id_project_id',
1357 'name': 'person_id_deleted_by',
1361 'name': 'person_id_deleted_dt',
1367 totalProperty : 'total',
1369 xtype : 'JsonReader'
1371 '|xns' : 'Roo.data',
1373 sortInfo : { field : 'charass_value' , direction : 'ASC' },
1377 beforeload : function (_self, o)
1379 o.params = o.params || {};
1380 // staff can see all logs, other companies can only see their own.
1381 // look for all of the charass 's with the same type= eg. brand.
1383 o.params.charass_char_id_char_name = 'PRODUCTGROUP';
1384 o.params.charass_target_type ='I';
1385 o.params._distinct = 'charass_value';
1386 o.params._columns = 'charass_value';
1394 '|xns' : 'Roo.form',
1397 displayField : 'charass_value',
1399 forceSelection : false,
1401 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
1404 qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'],
1405 queryParam : 'query[charass_value]',
1406 selectOnFocus : true,
1407 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
1408 triggerAction : 'all',
1417 '|xns' : 'Roo.grid',
1419 xtype : 'GridEditor',
1425 '|xns' : 'Roo.grid',
1426 dataIndex : 'item_char_productgroup',
1427 header : _this._strings['c6ca371871d835c79c8654b5cd788cc7'],
1428 renderer : function(v) { return String.format('{0}', v); },
1432 xtype : 'ColumnModel',
1439 '|xns' : 'Roo.grid',
1440 dataIndex : 'item_number',
1441 header : _this._strings['b2ee912b91d69b435159c7c3f6df7f5f'],
1442 renderer : function(v) { return String.format('<B>{0}</B>', v); },
1446 xtype : 'ColumnModel'
1451 '|xns' : 'Roo.form',
1455 '|xns' : 'Roo.grid',
1457 xtype : 'GridEditor',
1463 '|xns' : 'Roo.grid',
1464 dataIndex : 'item_char_pickface_location',
1465 header : _this._strings['d8ab3576a67fe0cc175ee77d57d0fd85'],
1466 renderer : function(v) { return String.format('{0}', v); },
1470 xtype : 'ColumnModel',
1479 '|xns' : 'Roo.form',
1483 '|xns' : 'Roo.grid',
1485 xtype : 'GridEditor',
1491 '|xns' : 'Roo.grid',
1492 dataIndex : 'item_char_pallet_location',
1493 header : _this._strings['fe78f3efbfa84d8485d589031596c5b8'],
1494 renderer : function(v) { return String.format('{0}', v); },
1498 xtype : 'ColumnModel',
1505 '|xns' : 'Roo.grid',
1506 dataIndex : 'item_descrip1',
1507 header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'],
1508 renderer : function(v) { return String.format('{0}', v); },
1512 xtype : 'ColumnModel'
1515 '|xns' : 'Roo.grid',
1516 dataIndex : 'itemsrc_active',
1517 header : _this._strings['ce4ee01637f4279d02d0f232459dc9a4'],
1518 renderer : function(v) {
1519 var state = v * 1 > 0 ? '-checked' : '';
1521 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1527 xtype : 'ColumnModel'
1530 '|xns' : 'Roo.grid',
1531 dataIndex : 'item_sold',
1532 header : _this._strings['41e902bb1b2db625736ede3bacc41fe0'],
1533 renderer : function(v) {
1534 var state = v * 1 > 0 ? '-checked' : '';
1536 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1542 xtype : 'ColumnModel'
1545 '|xns' : 'Roo.grid',
1546 dataIndex : 'item_active',
1547 header : _this._strings['68f43fdcf074903d65da764642a4b968'],
1548 renderer : function(v) {
1549 var state = v * 1 > 0 ? '-checked' : '';
1551 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1557 xtype : 'ColumnModel'
1560 '|xns' : 'Roo.grid',
1562 dataIndex : 'last_purchase_price',
1563 header : _this._strings['750587d31c68779e7f615c190a9dc23f'],
1564 renderer : function(v,x,r) {
1566 return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ;
1571 xtype : 'ColumnModel'
1574 '|xns' : 'Roo.grid',
1575 dataIndex : 'item_prodcat_id_prodcat_code',
1576 header : _this._strings['89217b1527e14cced20e78111a8f5027'],
1577 renderer : function(v,x,r) {
1578 return String.format('{0}/{1}', r.data.item_type, v);
1582 xtype : 'ColumnModel'
1585 '|xns' : 'Roo.grid',
1587 dataIndex : 'item_actcost',
1588 header : _this._strings['20b4f77bd00b4f63a49ec8e08f3bf6a6'],
1589 renderer : function(v,x,r) {
1591 return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ;
1596 xtype : 'ColumnModel'
1599 '|xns' : 'Roo.grid',
1601 dataIndex : 'item_base_cost',
1602 header : _this._strings['35be52be39d3efcd0cd2b3721fc3c298'],
1603 renderer : function(v,x,r) {
1605 return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ;
1610 xtype : 'ColumnModel'
1613 '|xns' : 'Roo.grid',
1615 dataIndex : 'item_stock_balance',
1616 header : _this._strings['99a808d8d16122d70e44bd7f709d30fb'],
1617 renderer : function(v) { return String.format('{0}', v ? parseInt( v) : ''); },
1620 xtype : 'ColumnModel'
1624 afteredit : function (e)
1630 url : baseURL +'/Roo/Charass',
1632 charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
1633 charass_value : e.value,
1634 charass_target_type : 'I',
1635 charass_default : 1,
1636 charass_target_id : e.record.data.item_id
1647 cellclick : function (_self, row, col, e)
1649 var di = _this.grid.colModel.getDataIndex(col);
1651 var rec = _this.grid.ds.getAt(row);
1654 if (di == 'item_active') {
1656 var nv = rec.data.item_active ? 0 : 1;
1659 url : baseURL + '/Roo/Item',
1661 item_id : rec.data.item_id,
1664 success : function() {
1665 rec.set('item_active', nv);
1673 if(di == 'itemsrc_active'){
1678 if(rec.data.itemsrc_active * 1){
1679 Roo.MessageBox.confirm("Confirm", "Are you sure this product is no longer purchased",
1684 rec.set('itemsrc_active', 0);
1690 Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {
1691 _this.grid.footer.onClick('first');
1697 _this.locgrid.footer.onClick('first');
1703 celldblclick : function (_self, rowIndex, columnIndex, e)
1705 var s = _this.grid.ds.getAt(rowIndex);
1707 Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {
1708 _this.grid.footer.onClick('first');
1714 //_this.dialog = Pman.Dialog.FILL_IN
1715 if (_this.panel.active) {
1716 this.footer.onClick('first');
1727 fitContainer : true,
1731 title : _this._strings['068f80c7519d0528fb08e82137a72131'],
1733 xtype : 'GridPanel',
1735 activate : function() {
1738 _this.grid.footer.onClick('first');
1751 '|xns' : 'Roo.data',
1753 url : baseURL + '/Roo/location.php',
1758 '|xns' : 'Roo.data',
1761 'name': 'itemloc_id',
1765 'name': 'itemloc_itemsite_id',
1769 'name': 'itemloc_location_id',
1773 'name': 'itemloc_qty',
1777 'name': 'itemloc_expiration',
1779 'dateFormat': 'Y-m-d'
1782 'name': 'itemloc_consolflag',
1786 'name': 'itemloc_ls_id',
1790 'name': 'itemloc_warrpurc',
1792 'dateFormat': 'Y-m-d'
1797 totalProperty : 'total',
1799 xtype : 'JsonReader'
1801 '|xns' : 'Roo.data',
1803 sortInfo : { field : 'location_name', direction: 'ASC' },
1807 beforeload : function (_self, o)
1809 var sel = _this.grid.selModel.getSelectedCell();
1814 var rec = _this.grid.ds.getAt(sel[0]);
1815 o.params._stock_for_item_id = rec.data.item_id;
1816 //o.params['!itemloc_qty'] = 0;
1829 displayMsg : _this._strings['19029645d5286771ac708d1bcd118bf4'],
1830 emptyMsg : _this._strings['2cfd827c6e37453fe1ddde82a5bd9474'],
1833 xtype : 'PagingToolbar'
1835 '|xns' : 'Roo.grid',
1836 autoExpandColumn : 'location_name',
1842 '|xns' : 'Roo.grid',
1843 dataIndex : 'location_name',
1844 header : _this._strings['ce5bf551379459c1c61d2a204061c455'],
1845 renderer : function(v) { return String.format('{0}', v); },
1848 xtype : 'ColumnModel'
1851 '|xns' : 'Roo.grid',
1852 dataIndex : 'itemloc_realqty',
1853 header : _this._strings['156567f65fc207d39cadbf045687c521'],
1854 renderer : function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); },
1857 xtype : 'ColumnModel'
1863 _this.locgrid = this;
1864 //_this.dialog = Pman.Dialog.FILL_IN
1867 rowdblclick : function (_self, rowIndex, e)
1869 if (!_this.dialog) return;
1870 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
1871 _this.grid.footer.onClick('first');
1882 fitContainer : true,
1885 tableName : 'itemloc',
1886 title : _this._strings['759d259249621c817551c5fe726d5c57'],
1888 xtype : 'GridPanel',
1890 activate : function() {
1891 _this.locpanel = this;
1906 title : _this._strings['068f80c7519d0528fb08e82137a72131'],
1908 xtype : 'NestedLayoutPanel',