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 'ec53a8c4f07baed5d8825072c89799be' :"Status",
33 '2cfd827c6e37453fe1ddde82a5bd9474' :"No itemloc found",
34 'd8ab3576a67fe0cc175ee77d57d0fd85' :"Pickface",
35 '5bc3fd20294c17c9803942958fd7f26d' :"Show Inactive",
36 '70cd7e06502a63356290711ec3b11223' :"Upload new products and costs",
37 'c6ca371871d835c79c8654b5cd788cc7' :"Product Group",
38 '695dbdb13fad32669a68d8fec8541c7f' :"Download Standard costs",
39 '156567f65fc207d39cadbf045687c521' :"Itemloc qty",
40 'c2f1d503b95bf9f3aa4d775a216c5c73' :"Sync Product Data from HK",
41 '36c454c4130e4444e8410f11d6d998f0' :"Tools - Upload/Download",
42 'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
43 '7fee866379427143414dd7a72e56414b' :"Report start :",
44 'a9e35d03ee7f31f5bb199379a6d3547a' :"Select Brand",
45 '35be52be39d3efcd0cd2b3721fc3c298' :"Cost (base)",
46 '750587d31c68779e7f615c190a9dc23f' :"Last purchase price",
47 'b2ee912b91d69b435159c7c3f6df7f5f' :"Number",
48 '173cf046739c17fd7c97ec3540d58807' :"(function() { return (new Date()).format('Y') + '-01-01'; })()",
49 'c20ad4d76fe97759aa27a0c99bff6710' :"12"
52 part : ["Xtuple", "Item" ],
53 order : '001-Pman.Tab.XtupleItem',
55 parent : 'Pman.Tab.XtupleManage',
56 name : "Pman.Tab.XtupleItem",
66 title : _this._strings['068f80c7519d0528fb08e82137a72131'] /* Products */,
69 xtype : 'NestedLayoutPanel',
73 xtype : 'BorderLayout',
77 xtype : 'LayoutRegion'
84 xtype : 'LayoutRegion'
93 title : _this._strings['068f80c7519d0528fb08e82137a72131'] /* Products */,
98 activate : function() {
101 _this.grid.footer.onClick('first');
106 autoExpandColumn : 'item_descrip1',
111 xtype : 'EditorGrid',
113 afteredit : function (e)
119 url : baseURL +'/Roo/Charass',
121 charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
122 charass_value : e.value,
123 charass_target_type : 'I',
125 charass_target_id : e.record.data.item_id
136 cellclick : function (_self, row, col, e)
138 var di = _this.grid.colModel.getDataIndex(col);
140 var rec = _this.grid.ds.getAt(row);
143 if (di == 'item_active') {
145 var nv = rec.data.item_active ? 0 : 1;
148 url : baseURL + '/Roo/Item',
150 item_id : rec.data.item_id,
153 success : function() {
154 rec.set('item_active', nv);
162 if(di == 'itemsrc_active'){
167 if(rec.data.itemsrc_active * 1){
168 Roo.MessageBox.confirm("Confirm", "Are you sure this product is no longer purchased",
173 rec.set('itemsrc_active', 0);
179 Pman.Dialog.XtupleItem.show( { item_id : rec.data.item_id } , function() {
180 _this.grid.footer.onClick('first');
186 _this.locgrid.footer.onClick('first');
192 celldblclick : function (_self, rowIndex, columnIndex, e)
194 var s = _this.grid.ds.getAt(rowIndex);
196 Pman.Dialog.XtupleItem.show( { item_id : s.data.item_id } , function() {
197 _this.grid.footer.onClick('first');
203 //_this.dialog = Pman.Dialog.FILL_IN
204 if (_this.panel.active) {
205 this.footer.onClick('first');
211 displayMsg : _this._strings['aa554e9e2270df2127bfe9096f1bd9ce'] /* Displaying item{0} - {1} of {2} */,
212 emptyMsg : _this._strings['f1c3ca6cadc4a9f57a08d5f7482a3f83'] /* No item found */,
216 xtype : 'PagingToolbar',
219 text : _this._strings['36c454c4130e4444e8410f11d6d998f0'] /* Tools - Upload/Download */,
221 '|xns' : 'Roo.Toolbar',
229 text : _this._strings['695dbdb13fad32669a68d8fec8541c7f'] /* Download Standard costs */,
234 click : function (_self, e)
238 url : baseURL + '/Roo/item',
247 text : _this._strings['70cd7e06502a63356290711ec3b11223'] /* Upload new products and costs */,
252 click : function (_self, e)
254 // 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");
257 Pman.Dialog.Image.show(
259 _url : baseURL+'/Xtuple/Import/Products',
267 msg.push("Updated " + data.updated + " Products(s)");
270 msg.push("Added " + data.inserted + " Products(s)");
273 msg.push("Skipped " + data.skipped);
277 msg.push("No data changed");
279 Roo.MessageBox.alert("Notice", msg.join("\n"));
292 hidden : (function() {
294 return baseURL.match(/hk\.php$/) ? true : false;
296 text : _this._strings['c2f1d503b95bf9f3aa4d775a216c5c73'] /* Sync Product Data from HK */,
301 click : function (_self, e)
303 Roo.MessageBox.progress ("Syncing Stock", "Sending");
310 url : baseURL+'/Roo/Item',
317 success : function(res) {
319 if (!res.data.total) {
320 Roo.MessageBox.hide();
323 offset += res.data.limit;
324 Roo.MessageBox.updateProgress ( offset / res.data.total, "Done " + offset + '/' + res.data.total);
336 hidden : (function() {
338 return baseURL.match(/hk\.php$/) ? true : false;
340 text : _this._strings['d6ea9efa48916e9563d76ddc233ebe2a'] /* Sync Product from HK (New Products Only) */,
345 click : function (_self, e)
347 Roo.MessageBox.progress ("Syncing Stock", "Sending");
354 url : baseURL+'/Roo/Item',
360 success : function(res) {
363 Roo.MessageBox.hide();
364 _this.grid.footer.onClick('refresh');
376 hidden : (function() {
378 return baseURL.match(/hk\.php$/) ? true : false;
380 text : _this._strings['44ca8ce0e02dee5d520525ac21bcbee9'] /* Sync Product from HK (Based on Search) */,
385 click : function (_self, e)
387 Roo.MessageBox.progress ("Syncing Stock", "Sending");
394 url : baseURL+'/Roo/Item',
398 item_number : _this.search.getValue()
400 success : function(res) {
403 Roo.MessageBox.hide();
404 _this.grid.footer.onClick('refresh');
428 displayField : 'charass_value',
430 emptyText : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'] /* Select Brand */,
431 forceSelection : true,
433 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
436 qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'] /* Select Brand */,
437 queryParam : 'query[charass_value]',
438 selectOnFocus : true,
439 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
440 triggerAction : 'all',
446 render : function (_self)
448 _this.brandSel = _self;
450 select : function (combo, record, index)
452 _this.grid.footer.onClick('first');
457 sortInfo : { field : 'charass_value' , direction : 'ASC' },
462 beforeload : function (_self, o)
464 o.params = o.params || {};
465 // staff can see all logs, other companies can only see their own.
466 // look for all of the charass 's with the same type= eg. brand.
468 o.params.charass_char_id_char_name = 'BRAND';
469 o.params.charass_target_type ='I';
470 o.params._distinct = 'charass_value';
471 o.params._columns = 'charass_value';
477 url : baseURL + '/Roo/Charass.php',
489 'name': 'person_name',
493 'name': 'event_when',
495 'dateFormat': 'Y-m-d'
522 'name': 'person_id_id',
526 'name': 'person_id_office_id',
530 'name': 'person_id_name',
534 'name': 'person_id_phone',
538 'name': 'person_id_fax',
542 'name': 'person_id_email',
546 'name': 'person_id_company_id',
550 'name': 'person_id_role',
554 'name': 'person_id_active',
558 'name': 'person_id_remarks',
562 'name': 'person_id_passwd',
566 'name': 'person_id_owner_id',
570 'name': 'person_id_lang',
574 'name': 'person_id_no_reset_sent',
578 'name': 'person_id_action_type',
582 'name': 'person_id_project_id',
586 'name': 'person_id_deleted_by',
590 'name': 'person_id_deleted_dt',
596 totalProperty : 'total',
604 emptyText : _this._strings['9a8faafb674c03474827bcb6fcde43a3'] /* Search Product */,
609 render : function (_self)
611 _this.search = _self;
613 specialkey : function (_self, e)
615 _this.grid.footer.onClick('first');
621 icon : rootURL + '/Pman/templates/images/search.gif',
623 '|xns' : 'Roo.Toolbar',
626 click : function (_self, e)
628 _this.grid.footer.onClick('first');
634 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
636 '|xns' : 'Roo.Toolbar',
639 click : function (_self, e)
641 _this.search.setValue('');
645 _this.grid.footer.onClick('first');
651 '|xns' : 'Roo.Toolbar',
656 text : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
658 '|xns' : 'Roo.Toolbar',
661 render : function (_self)
663 _this.active = _self;
665 toggle : function (_self, pressed)
668 this.setText(pressed ? "Hide Inactive" : "Show Inactive");
669 (function() { _this.grid.footer.onClick('first'); }).defer(100);
675 '|xns' : 'Roo.Toolbar',
679 cls : 'x-btn-text-icon',
680 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
681 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
683 '|xns' : 'Roo.Toolbar',
689 Pman.Dialog.XtupleItem.show( { item_id : 0 } , function() {
690 _this.grid.footer.onClick('first');
696 text : _this._strings['ee3585dbcb1e8f8826f3403c1e9d898c'] /* Rename SKU */,
698 '|xns' : 'Roo.Toolbar',
703 var s = _this.grid.selModel.getSelectedCell();
705 Roo.MessageBox.alert("Error", "Select a product");
708 var rec = _this.grid.ds.getAt(s[0]);
712 Roo.MessageBox.prompt(
714 "Warning changing SKU names affects historical data, and should only be done if you are sure that this is ok",
722 item_id : rec.data.item_id,
735 var change = function(params){
737 url : baseURL + '/Roo/Item',
741 success : function(res) {
743 _this.grid.footer.onClick('refresh');
744 if(typeof(res.data) == 'string'){
745 Roo.MessageBox.alert("Notice", 'SKU has been renamed');
749 Roo.each(res.data, function(o){
750 offices.push(Pman.Xtuple.offices[o]);
752 Roo.MessageBox.alert("Notice", 'SKU has been renamed in ' + offices.join(", "));
755 failure : function(res) {
758 if (res.errors.confirm.length) {
760 Roo.each(res.errors.confirm, function(o){
761 offices.push(Pman.Xtuple.offices[o]);
763 Roo.MessageBox.confirm(
765 " Do you want to change the name in " + offices.join(", ") + "?",
768 Roo.MessageBox.alert("Notice", 'SKU was not changed');
771 delete params['_check'];
772 params._can_change_sku = 1;
779 Roo.MessageBox.alert("Error", res.errorMsg);
790 '|xns' : 'Roo.Toolbar',
794 text : _this._strings['7fee866379427143414dd7a72e56414b'] /* Report start : */,
796 '|xns' : 'Roo.Toolbar',
802 value : (function() { return (new Date()).format('Y') + '-01-01'; })(),
807 render : function (_self)
809 _this.dateFrom = _self;
815 displayField : 'fname',
817 fieldLabel : _this._strings['ec53a8c4f07baed5d8825072c89799be'] /* Status */,
818 hiddenName : 'cm_status',
821 name : 'cm_status_name',
822 triggerAction : 'all',
824 valueField : 'ftype',
830 render : function (_self)
832 _this.datespan = _self;
837 [ '1', "Single Month Sales"],
838 [ '3', "Quarter Sales"],
839 [ '6', "Half year Sales"] ,
840 [ '12', "Full Year Sales"]
842 fields : [ 'ftype', 'fname'],
845 xtype : 'SimpleStore'
849 text : _this._strings['e924991fc4c883bc237e69efe884d674'] /* Download Sales Report */,
851 '|xns' : 'Roo.Toolbar',
854 click : function (_self, e)
856 if (!_this.brandSel.getValue().length) {
857 Roo.MessageBox.alert("Error", "Select a brand to download");
862 url : baseURL + '/Xtuple/Reports/SalesByCountryItemYear',
864 date_from : _this.dateFrom.getValue(),
865 brand : _this.brandSel.getValue(),
866 span : _this.datespan.getValue()
878 sortInfo : { field : 'item_number', direction: 'ASC' },
883 beforeload : function (_self, o)
885 o.params._with_prodcat = 1;
886 o.params._with_char = 1;
887 o.params._with_itemsrc_active = 1;
888 o.params._with_last_purchase_price = 1;
889 o.params._with_image = 1;
890 var s = _this.search.getValue();
892 o.params['query[number_or_name]'] = s;
894 if (!_this.active.pressed) {
895 o.params.item_active = 1;
897 if (_this.brandSel.getValue().length) {
898 o.params._with_brand = _this.brandSel.getValue()
901 o.params._with_stock_balance = 1;
903 load : function (_self, records, options)
906 var cm = _this.grid.getColumnModel();
908 cm.setColumnHeader(cm.getIndexByDataIndex('item_stock_balance'),records[0].data.default_location_name);
911 update : function (_self, record, operation)
913 if(operation != 'commit'){
917 var nv = record.data.itemsrc_active ? 0 : 1;
920 url : baseURL + '/Roo/Itemsrc',
923 item_id : record.data.item_id,
926 success : function(res) {
927 record.set('itemsrc_active', nv);
934 url : baseURL + '/Roo/item.php',
946 'name': 'item_number',
950 'name': 'item_descrip1',
954 'name': 'item_descrip2',
958 'name': 'item_classcode_id',
962 'name': 'item_picklist',
966 'name': 'item_comments',
974 'name': 'item_fractional',
978 'name': 'item_active',
986 'name': 'item_prodweight',
990 'name': 'item_packweight',
994 'name': 'item_prodcat_id',
998 'name': 'item_exclusive',
1002 'name': 'item_listprice',
1006 'name': 'item_config',
1010 'name': 'item_extdescrip',
1014 'name': 'item_upccode',
1018 'name': 'item_maxcost',
1022 'name': 'item_inv_uom_id',
1026 'name': 'item_price_uom_id',
1030 'name': 'item_warrdays',
1034 'name': 'item_freightclass_id',
1038 'name': 'item_tax_recoverable',
1042 'name': 'item_price_uom_id_uom_id',
1046 'name': 'item_price_uom_id_uom_name',
1050 'name': 'item_price_uom_id_uom_descrip',
1054 'name': 'item_price_uom_id_uom_item_weight',
1058 'name': 'item_inv_uom_id_uom_id',
1062 'name': 'item_inv_uom_id_uom_name',
1066 'name': 'item_inv_uom_id_uom_descrip',
1070 'name': 'item_inv_uom_id_uom_item_weight',
1074 'name': 'item_freightclass_id_freightclass_id',
1078 'name': 'item_freightclass_id_freightclass_code',
1082 'name': 'item_freightclass_id_freightclass_descrip',
1086 'name': 'item_classcode_id_classcode_id',
1090 'name': 'item_classcode_id_classcode_code',
1094 'name': 'item_classcode_id_classcode_descrip',
1098 'name': 'item_classcode_id_classcode_mfg',
1102 'name': 'item_classcode_id_classcode_creator',
1106 'name': 'item_classcode_id_classcode_created',
1110 'name': 'item_classcode_id_classcode_modifier',
1114 'name': 'item_classcode_id_classcode_modified',
1118 'name': 'item_classcode_id_classcode_type',
1124 totalProperty : 'total',
1126 '|xns' : 'Roo.data',
1127 xtype : 'JsonReader'
1132 dataIndex : 'item_image_id',
1133 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
1134 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); },
1138 '|xns' : 'Roo.grid',
1139 xtype : 'ColumnModel'
1142 dataIndex : 'item_char_brand',
1143 header : _this._strings['1be6f9eb563f3bf85c78b4219bf09de9'] /* Brand */,
1144 renderer : function(v) { return String.format('{0}', v); },
1148 '|xns' : 'Roo.grid',
1149 xtype : 'ColumnModel',
1152 '|xns' : 'Roo.grid',
1153 xtype : 'GridEditor',
1157 displayField : 'charass_value',
1159 forceSelection : false,
1161 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1164 qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'] /* Select Brand */,
1165 queryParam : 'query[charass_value]',
1166 selectOnFocus : true,
1167 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
1168 triggerAction : 'all',
1171 '|xns' : 'Roo.form',
1175 sortInfo : { field : 'charass_value' , direction : 'ASC' },
1177 '|xns' : 'Roo.data',
1180 beforeload : function (_self, o)
1182 o.params = o.params || {};
1183 // staff can see all logs, other companies can only see their own.
1184 // look for all of the charass 's with the same type= eg. brand.
1186 o.params.charass_char_id_char_name = 'BRAND';
1187 o.params.charass_target_type ='I';
1188 o.params._distinct = 'charass_value';
1189 o.params._columns = 'charass_value';
1195 url : baseURL + '/Roo/Charass.php',
1197 '|xns' : 'Roo.data',
1207 'name': 'person_name',
1211 'name': 'event_when',
1213 'dateFormat': 'Y-m-d'
1232 'name': 'person_id',
1240 'name': 'person_id_id',
1244 'name': 'person_id_office_id',
1248 'name': 'person_id_name',
1252 'name': 'person_id_phone',
1256 'name': 'person_id_fax',
1260 'name': 'person_id_email',
1264 'name': 'person_id_company_id',
1268 'name': 'person_id_role',
1272 'name': 'person_id_active',
1276 'name': 'person_id_remarks',
1280 'name': 'person_id_passwd',
1284 'name': 'person_id_owner_id',
1288 'name': 'person_id_lang',
1292 'name': 'person_id_no_reset_sent',
1296 'name': 'person_id_action_type',
1300 'name': 'person_id_project_id',
1304 'name': 'person_id_deleted_by',
1308 'name': 'person_id_deleted_dt',
1314 totalProperty : 'total',
1316 '|xns' : 'Roo.data',
1317 xtype : 'JsonReader'
1324 dataIndex : 'item_char_productgroup',
1325 header : _this._strings['c6ca371871d835c79c8654b5cd788cc7'] /* Product Group */,
1326 renderer : function(v) { return String.format('{0}', v); },
1330 '|xns' : 'Roo.grid',
1331 xtype : 'ColumnModel',
1334 '|xns' : 'Roo.grid',
1335 xtype : 'GridEditor',
1339 displayField : 'charass_value',
1341 forceSelection : false,
1343 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1346 qtip : _this._strings['a9e35d03ee7f31f5bb199379a6d3547a'] /* Select Brand */,
1347 queryParam : 'query[charass_value]',
1348 selectOnFocus : true,
1349 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{charass_value}</b> </div>',
1350 triggerAction : 'all',
1353 '|xns' : 'Roo.form',
1357 sortInfo : { field : 'charass_value' , direction : 'ASC' },
1359 '|xns' : 'Roo.data',
1362 beforeload : function (_self, o)
1364 o.params = o.params || {};
1365 // staff can see all logs, other companies can only see their own.
1366 // look for all of the charass 's with the same type= eg. brand.
1368 o.params.charass_char_id_char_name = 'PRODUCTGROUP';
1369 o.params.charass_target_type ='I';
1370 o.params._distinct = 'charass_value';
1371 o.params._columns = 'charass_value';
1376 url : baseURL + '/Roo/Charass.php',
1378 '|xns' : 'Roo.data',
1388 'name': 'person_name',
1392 'name': 'event_when',
1394 'dateFormat': 'Y-m-d'
1413 'name': 'person_id',
1421 'name': 'person_id_id',
1425 'name': 'person_id_office_id',
1429 'name': 'person_id_name',
1433 'name': 'person_id_phone',
1437 'name': 'person_id_fax',
1441 'name': 'person_id_email',
1445 'name': 'person_id_company_id',
1449 'name': 'person_id_role',
1453 'name': 'person_id_active',
1457 'name': 'person_id_remarks',
1461 'name': 'person_id_passwd',
1465 'name': 'person_id_owner_id',
1469 'name': 'person_id_lang',
1473 'name': 'person_id_no_reset_sent',
1477 'name': 'person_id_action_type',
1481 'name': 'person_id_project_id',
1485 'name': 'person_id_deleted_by',
1489 'name': 'person_id_deleted_dt',
1495 totalProperty : 'total',
1497 '|xns' : 'Roo.data',
1498 xtype : 'JsonReader'
1505 dataIndex : 'item_number',
1506 header : _this._strings['b2ee912b91d69b435159c7c3f6df7f5f'] /* Number */,
1507 renderer : function(v) { return String.format('<B>{0}</B>', v); },
1511 '|xns' : 'Roo.grid',
1512 xtype : 'ColumnModel'
1515 dataIndex : 'item_char_pickface_location',
1516 header : _this._strings['d8ab3576a67fe0cc175ee77d57d0fd85'] /* Pickface */,
1517 renderer : function(v) { return String.format('{0}', v); },
1521 '|xns' : 'Roo.grid',
1522 xtype : 'ColumnModel',
1525 '|xns' : 'Roo.grid',
1526 xtype : 'GridEditor',
1529 '|xns' : 'Roo.form',
1535 dataIndex : 'item_char_pallet_location',
1536 header : _this._strings['fe78f3efbfa84d8485d589031596c5b8'] /* Pallet */,
1537 renderer : function(v) { return String.format('{0}', v); },
1541 '|xns' : 'Roo.grid',
1542 xtype : 'ColumnModel',
1545 '|xns' : 'Roo.grid',
1546 xtype : 'GridEditor',
1549 '|xns' : 'Roo.form',
1555 dataIndex : 'item_descrip1',
1556 header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
1557 renderer : function(v) { return String.format('{0}', v); },
1561 '|xns' : 'Roo.grid',
1562 xtype : 'ColumnModel'
1565 dataIndex : 'itemsrc_active',
1566 header : _this._strings['ce4ee01637f4279d02d0f232459dc9a4'] /* Purchased */,
1567 renderer : function(v) {
1568 var state = v * 1 > 0 ? '-checked' : '';
1570 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1576 '|xns' : 'Roo.grid',
1577 xtype : 'ColumnModel'
1580 dataIndex : 'item_sold',
1581 header : _this._strings['41e902bb1b2db625736ede3bacc41fe0'] /* is Sold? */,
1582 renderer : function(v) {
1583 var state = v * 1 > 0 ? '-checked' : '';
1585 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1591 '|xns' : 'Roo.grid',
1592 xtype : 'ColumnModel'
1595 dataIndex : 'item_active',
1596 header : _this._strings['68f43fdcf074903d65da764642a4b968'] /* is Active? */,
1597 renderer : function(v) {
1598 var state = v * 1 > 0 ? '-checked' : '';
1600 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1606 '|xns' : 'Roo.grid',
1607 xtype : 'ColumnModel'
1611 dataIndex : 'last_purchase_price',
1612 header : _this._strings['750587d31c68779e7f615c190a9dc23f'] /* Last purchase price */,
1613 renderer : function(v,x,r) {
1615 return String.format('{0}{1}', r.data.last_purchase_price_curr_name, Roo.util.Format.number(v,2)) ;
1620 '|xns' : 'Roo.grid',
1621 xtype : 'ColumnModel'
1624 dataIndex : 'item_prodcat_id_prodcat_code',
1625 header : _this._strings['89217b1527e14cced20e78111a8f5027'] /* Item prodcat */,
1626 renderer : function(v,x,r) {
1627 return String.format('{0}/{1}', r.data.item_type, v);
1631 '|xns' : 'Roo.grid',
1632 xtype : 'ColumnModel'
1636 dataIndex : 'item_actcost',
1637 header : _this._strings['20b4f77bd00b4f63a49ec8e08f3bf6a6'] /* Cost */,
1638 renderer : function(v,x,r) {
1640 return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ;
1645 '|xns' : 'Roo.grid',
1646 xtype : 'ColumnModel'
1650 dataIndex : 'item_base_cost',
1651 header : _this._strings['35be52be39d3efcd0cd2b3721fc3c298'] /* Cost (base) */,
1652 renderer : function(v,x,r) {
1654 return String.format('{0}{1}', r.data.item_base_curr, Roo.util.Format.number(v,2)) ;
1659 '|xns' : 'Roo.grid',
1660 xtype : 'ColumnModel'
1664 dataIndex : 'item_stock_balance',
1665 header : _this._strings['99a808d8d16122d70e44bd7f709d30fb'] /* Balance */,
1666 renderer : function(v) { return String.format('{0}', v ? parseInt( v) : ''); },
1669 '|xns' : 'Roo.grid',
1670 xtype : 'ColumnModel'
1677 fitContainer : true,
1680 tableName : 'itemloc',
1681 title : _this._strings['759d259249621c817551c5fe726d5c57'] /* itemloc */,
1684 xtype : 'GridPanel',
1686 activate : function() {
1687 _this.locpanel = this;
1692 autoExpandColumn : 'location_name',
1695 '|xns' : 'Roo.grid',
1700 _this.locgrid = this;
1701 //_this.dialog = Pman.Dialog.FILL_IN
1704 rowdblclick : function (_self, rowIndex, e)
1706 if (!_this.dialog) return;
1707 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
1708 _this.grid.footer.onClick('first');
1714 displayMsg : _this._strings['19029645d5286771ac708d1bcd118bf4'] /* Displaying itemloc{0} - {1} of {2} */,
1715 emptyMsg : _this._strings['2cfd827c6e37453fe1ddde82a5bd9474'] /* No itemloc found */,
1719 xtype : 'PagingToolbar'
1723 sortInfo : { field : 'location_name', direction: 'ASC' },
1725 '|xns' : 'Roo.data',
1728 beforeload : function (_self, o)
1730 var sel = _this.grid.selModel.getSelectedCell();
1735 var rec = _this.grid.ds.getAt(sel[0]);
1736 o.params._stock_for_item_id = rec.data.item_id;
1737 //o.params['!itemloc_qty'] = 0;
1744 url : baseURL + '/Roo/location.php',
1746 '|xns' : 'Roo.data',
1752 'name': 'itemloc_id',
1756 'name': 'itemloc_itemsite_id',
1760 'name': 'itemloc_location_id',
1764 'name': 'itemloc_qty',
1768 'name': 'itemloc_expiration',
1770 'dateFormat': 'Y-m-d'
1773 'name': 'itemloc_consolflag',
1777 'name': 'itemloc_ls_id',
1781 'name': 'itemloc_warrpurc',
1783 'dateFormat': 'Y-m-d'
1788 totalProperty : 'total',
1790 '|xns' : 'Roo.data',
1791 xtype : 'JsonReader'
1796 dataIndex : 'location_name',
1797 header : _this._strings['ce5bf551379459c1c61d2a204061c455'] /* Location */,
1798 renderer : function(v) { return String.format('{0}', v); },
1801 '|xns' : 'Roo.grid',
1802 xtype : 'ColumnModel'
1805 dataIndex : 'itemloc_realqty',
1806 header : _this._strings['156567f65fc207d39cadbf045687c521'] /* Itemloc qty */,
1807 renderer : function(v) { return String.format('{0}', v*1 ? (v*1).toFixed(0) : ''); },
1810 '|xns' : 'Roo.grid',
1811 xtype : 'ColumnModel'