1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.XtupleItem = {
10 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
11 '346577d22bb510368e3eddab5df2ca13' :"Reference Files",
12 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
13 '956e816fa19ca04485c7101adbe07762' :"Displaying records {0} - {1} of {2}",
14 '82a43f89af6d331d80d441624c5c71fa' :"Default Location",
15 '538a3c9d82a4ea4250b987a357d41184' :"Item Parts",
16 '69395719de41dd8a31905b1e94c91816' :"Select classcode",
17 '03ab340b3f99e03cff9e84314ead38c0' :"Qty",
18 '5b8c99dad1893a85076709b2d3c2d2d0' :"IP Address",
19 '045a1ac263ac3a9b7420208bdc2df423' :"Select costcat",
20 '0c81971f67c0bd4b33799c5365ec2bf5' :"No Images found",
21 '151ccf95db9b81c11bb20fbc302af4b6' :"Select terms",
22 '786410e93beb0193d89f8608c54feb4b' :"Select item",
23 '0ac9012a8c03a76ee76f04321b3b7fda' :"Lead time",
24 '675c9bd3bbae30af03fe74346dcae9a7' :"Edit / Create item",
25 'dd24f967299e81b9603cb071693d5c32' :"Select vendinfo",
26 '023a5dfa857c4aa0156e6685231a1dbd' :"Select Type",
27 'e8586011952b0d098b0e568f20ca2b1f' :"Select Currency",
28 '8413c683b4b27cc3f4dbd4c90329d8ba' :"Comments",
29 '820dbd2b8f606aff866c0bbfb6b737c1' :"Changed",
30 '0eceeb45861f9585dd7a97a3e36f85c6' :"Created",
31 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
32 '9076cbba1d9ef79280b4f39e2aa0d115' :"Nothing found",
33 '386c339d37e737a436499d423a77df0c' :"Currency",
34 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
35 '7be1fa478799242847d4ef861ff6f8e1' :"Min Qty",
36 '76729937a5eb6b0fd88c42581161facd' :"Select Category",
37 '19df363d15888baa395364fbcd230c05' :"No itemsrc found",
38 '49ee3087348e8d44e1feda1917443987' :"Name",
39 '0d122b17933ab4173e9d75d55fc5e764' :"Standard Cost",
40 'df2ad52a14d681b1cd8495f8650fdb56' :"Select prodcat",
41 'e5353fc67b122d1b42181073b46cd060' :"Vendor Ref#",
42 'c19ea8f7a11074ac743c58d34830b233' :"Select plancode",
43 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
44 '20f39d1311ccbd3b7e61cdd4978719f9' :"Itemsite Settings",
45 '1656a671ba692e15836cd85df374556c' :"Price List",
46 'bb8913cd17d59f182acc7be1020007b7' :"UOM",
47 '76d5bf9597c882d6513f71759df298d5' :"Displaying parts {0} - {1} of {2}",
48 '3601146c4e948c32b6424d2c0a7f0118' :"Price",
49 '1814d65a76028fdfbadab64a5a8076df' :"Suppliers",
50 '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found",
51 '4ee972120bcda675f75222c87cb9d356' :"Who",
52 '16d2b386b2034b9488996466aaae0b57' :"History",
53 '089ba2b5edc96565fc22c584ecfbb1a6' :"Displaying events{0} - {1} of {2}",
54 'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
55 '7f841b4d2f7280eb82318988c6d649d1' :"Displaying itemsrc{0} - {1} of {2}",
56 'c0ed345ec857c06b31f7e88745c9bc40' :"Displaying Images {0} - {1} of {2}",
57 'a254c25adc7d10d7e9c4889484f875a5' :"Detail",
58 'c9cc8cce247e49bae79f15173ce97354' :"Save",
59 'ec9ceefe0c19f4c029008c23e3c947b7' :"Vendor",
60 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
61 '004bf6c9a40003140292e97330236c53' :"Action",
62 'f4c6f851b00d5518bf888815de279aba' :"Notes",
63 'f9838de820f2a2e16241033270c68e29' :"Select uom",
64 '1063e38cb53d94d386f21227fcd84717' :"Remove",
65 '7996af9149ed376ce252e35c4da7146b' :"Select Vendor"
71 show : function(data, cb)
79 this.dialog.show(this.data._el);
82 this.form.setValues(data);
83 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
91 this.dialog = Roo.factory({
94 alwaysShowTabs : true,
97 xtype : 'LayoutRegion'
105 title : _this._strings['675c9bd3bbae30af03fe74346dcae9a7'],
108 xtype : 'LayoutDialog',
112 text : _this._strings['ea4788705e6873b424c65e91c2846b19'],
116 click : function (_self, e)
124 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'],
128 click : function (_self, e)
133 // _this.dialog.el.mask("Saving");
134 _this.form.doAction("submit");
137 render : function (_self)
139 _this.saveBtn = this;
145 show : function (_self)
147 _this.dialog.layout.getRegion('center').showPanel(0);
154 title : _this._strings['a254c25adc7d10d7e9c4889484f875a5'],
156 xtype : 'ContentPanel',
162 style : 'margin:10px;',
163 url : baseURL + '/Roo/item.php',
167 actioncomplete : function(_self,action)
169 if (action.type == 'setdata') {
170 _this.form.findField('item_number').el.dom.readOnly = true;
171 _this.form.findField('item_type').disabled = true;
173 if(_this.data.item_id * 1 > 0){
178 '_id' : _this.data.item_id,
179 '_with_itemsite' : 1,
180 '_with_itemcost' : 1,
181 '_with_prodcat' : 1 ,
182 '_with_salesaccnt' : 1
188 _this.form.findField('item_number').el.dom.readOnly = false;
189 _this.form.findField('item_type').disabled = false;
190 _this.form.findField('item_salesaccnt').setValue('');
192 _this.form.findField('item_type').showHide();
196 if (action.type == 'load') {
197 _this.form.findField('item_type').showHide();
200 if (action.type =='submit') {
202 var id = _this.form.findField('item_id').getValue() * 1;
208 '_id' : action.result.data.item_id,
209 '_with_itemsite' : 1,
210 '_with_itemcost' : 1,
211 '_with_prodcat' : 1 ,
212 '_with_salesaccnt' : 1
219 if (_this.callback) {
220 _this.callback.call(_this, _this.form.getValues());
226 rendered : function (form)
236 name : 'item_number',
243 fieldLabel : 'Description',
244 name : 'item_descrip1',
251 fieldLabel : 'Description (2)',
252 name : 'item_descrip2',
267 [ 'P', "Purchased (eg. a standard product)"],
268 [ 'R' , "Reference (Non-Product)"],
269 [ 'K', "Kit (made up of products)"]
271 fields : [ 'ftype', 'fname'],
273 xtype : 'SimpleStore'
277 displayField : 'fname',
279 emptyText : _this._strings['023a5dfa857c4aa0156e6685231a1dbd'],
281 hiddenName : 'item_type',
284 name : 'item_type_name',
285 showHide : function() {
287 var it = this.getValue();
290 'item_itemcost_id_itemcost_curr_id',
291 'item_itemcost_id_itemcost_actcost',
292 'item_itemsite_id_itemsite_reorderlevel',
293 'item_itemsite_id_itemsite_leadtime',
294 'item_itemsite_id_itemsite_location_id',
295 'item_itemsite_id_itemsite_loccntrl',
296 'item_itemsite_id_itemsite_stocked',
297 'item_itemsite_id_itemsite_perishable',
299 'item_itemsite_id_itemsite_safetystock',
300 'item_itemsite_id_itemsite_controlmethod',
301 'item_itemsite_id_itemsite_plancode_id',
302 'item_itemsite_id_itemsite_costcat_id',
303 'item_itemsite_id_itemsite_active',
304 'item_itemsite_id_itemsite_sold'
314 _this.standardCostFieldSet.show();
315 _this.itemsiteFieldSet.show();
322 _this.form.findField('item_listprice').allowBlank = false;
323 _this.form.findField('item_listprice').actionMode = 'fieldEl';
324 _this.form.findField('item_listprice').hideMode = 'display';
325 _this.form.findField('item_listprice').show();
329 case 'R': // refrence
330 options = options.concat(r_req);
332 _this.standardCostFieldSet.hide();
335 case 'P': // purchased..
336 options = options.concat(r_req);
341 Roo.each(options, function(n) {
342 var ff = _this.form.findField(n);
343 ff.allowBlank = !state;
344 ff.actionMode = 'fieldEl';
345 ff.hideMode = 'display';
346 state ? ff.show() : ff.hide();
352 _this.standardCostFieldSet.hide();
353 _this.itemsiteFieldSet.hide();
360 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
361 triggerAction : 'all',
362 valueField : 'ftype',
367 beforeselect : function (combo, record, index)
369 (function() { combo.showHide(); }).defer(100);
382 url : baseURL + '/Roo/classcode.php',
388 fields : [{"name":"id","type":"int"},{"name":"classcode_code","type":"string"}],
391 totalProperty : 'total',
397 sortInfo : { direction : 'ASC', field: 'id' },
401 beforeload : function (_self, o){
402 o.params = o.params || {};
413 displayField : 'classcode_code',
415 emptyText : _this._strings['69395719de41dd8a31905b1e94c91816'],
416 fieldLabel : 'Class',
417 forceSelection : true,
418 hiddenName : 'item_classcode_id',
420 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
422 name : 'item_classcode_id_classcode_code',
424 qtip : _this._strings['69395719de41dd8a31905b1e94c91816'],
426 selectOnFocus : true,
427 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>',
428 triggerAction : 'all',
430 valueField : 'classcode_id',
444 url : baseURL + '/Roo/uom.php',
451 {"name":"id","type":"int"},
452 {"name":"uom_name","type":"string"},
453 {"name":"uom_descrip","type":"string"},
457 totalProperty : 'total',
463 sortInfo : { direction : 'ASC', field: 'uom_name' },
467 beforeload : function (_self, o){
468 o.params = o.params || {};
479 displayField : 'uom_descrip',
481 emptyText : _this._strings['f9838de820f2a2e16241033270c68e29'],
482 fieldLabel : 'Invoice UOM',
483 forceSelection : true,
484 hiddenName : 'item_inv_uom_id',
486 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
488 name : 'item_inv_uom_id_uom_descrip',
490 qtip : _this._strings['69395719de41dd8a31905b1e94c91816'],
492 selectOnFocus : true,
493 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>',
494 triggerAction : 'all',
496 valueField : 'uom_id',
510 url : baseURL + '/Roo/uom.php',
517 {"name":"id","type":"int"},
518 {"name":"uom_name","type":"string"},
519 {"name":"uom_descrip","type":"string"},
523 totalProperty : 'total',
529 sortInfo : { direction : 'ASC', field: 'uom_name' },
533 beforeload : function (_self, o){
534 o.params = o.params || {};
545 displayField : 'uom_descrip',
547 emptyText : _this._strings['f9838de820f2a2e16241033270c68e29'],
548 fieldLabel : 'Price UOM',
549 forceSelection : true,
550 hiddenName : 'item_price_uom_id',
552 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
554 name : 'item_price_uom_id_uom_descrip',
556 qtip : _this._strings['69395719de41dd8a31905b1e94c91816'],
558 selectOnFocus : true,
559 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>',
560 triggerAction : 'all',
562 valueField : 'uom_id',
574 allowDecimals : true,
575 decimalPrecision : 2,
576 fieldLabel : 'Weight',
577 name : 'item_prodweight',
580 xtype : 'NumberField'
584 fieldLabel : 'Item comments',
586 name : 'item_comments',
593 fieldLabel : 'Item sold',
603 fieldLabel : 'Item active',
605 name : 'item_active',
616 url : baseURL + '/Roo/prodcat.php',
622 fields : [{"name":"id","type":"int"},{"name":"prodcat_code","type":"string"}],
625 totalProperty : 'total',
631 sortInfo : { direction : 'ASC', field: 'id' },
635 beforeload : function (_self, o){
636 o.params = o.params || {};
648 displayField : 'prodcat_code',
650 emptyText : _this._strings['76729937a5eb6b0fd88c42581161facd'],
651 fieldLabel : 'Product Category',
652 forceSelection : true,
653 hiddenName : 'item_prodcat_id',
655 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
657 name : 'item_prodcat_id_prodcat_code',
659 qtip : _this._strings['df2ad52a14d681b1cd8495f8650fdb56'],
661 selectOnFocus : true,
662 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>',
663 triggerAction : 'all',
665 valueField : 'prodcat_id',
670 add : function (combo)
672 Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});
674 edit : function (combo, record)
676 var s = _this.form.findField('item_prodcat_id').getValue() * 1;
678 Roo.MessageBox.alert('Error','Please select a account assignment');
681 Pman.Dialog.XtupleProdcat.show({prodcat_id : s});
691 fieldLabel : 'Sales Account',
692 name : 'item_salesaccnt',
694 xtype : 'DisplayField'
698 fieldLabel : 'Item listprice',
699 name : 'item_listprice',
702 xtype : 'NumberField'
706 legend : _this._strings['0d122b17933ab4173e9d75d55fc5e764'],
707 style : 'width:320px',
711 render : function (_self)
713 _this.standardCostFieldSet = _self;
722 url : baseURL + '/Roo/curr_symbol.php',
728 fields : [{"name":"curr_id","type":"int"},"curr_symbol"],
731 totalProperty : 'total',
737 sortInfo : { direction : 'ASC', field: 'curr_symbol' },
741 beforeload : function (_self, o){
742 o.params = o.params || {};
754 displayField : 'curr_name',
756 emptyText : _this._strings['e8586011952b0d098b0e568f20ca2b1f'],
757 fieldLabel : 'Currency',
758 forceSelection : true,
759 hiddenName : 'item_itemcost_id_itemcost_curr_id',
761 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
765 qtip : _this._strings['e8586011952b0d098b0e568f20ca2b1f'],
766 queryParam : 'query[curr_name]',
767 selectOnFocus : true,
768 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>',
769 triggerAction : 'all',
771 valueField : 'curr_id',
783 fieldLabel : 'Value',
784 name : 'item_itemcost_id_itemcost_actcost',
787 xtype : 'NumberField'
803 legend : _this._strings['20f39d1311ccbd3b7e61cdd4978719f9'],
804 style : 'width:335px;',
808 render : function (_self)
810 _this.itemsiteFieldSet = _self;
817 fieldLabel : 'Reorder Level',
818 name : 'item_itemsite_id_itemsite_reorderlevel',
821 xtype : 'NumberField'
826 fieldLabel : 'Stock Safety Level',
827 name : 'item_itemsite_id_itemsite_safetystock',
830 xtype : 'NumberField'
835 fieldLabel : 'Lead time (Days)',
836 name : 'item_itemsite_id_itemsite_leadtime',
839 xtype : 'NumberField'
848 fields : [ 'ftype', 'fname'],
850 xtype : 'SimpleStore'
854 displayField : 'fname',
856 fieldLabel : 'Control Method',
857 hiddenName : 'item_itemsite_id_itemsite_controlmethod',
860 name : 'item_itemsite_id_itemsite_controlmethod_name',
861 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
862 triggerAction : 'all',
863 valueField : 'ftype',
877 url : baseURL + '/Roo/plancode.php',
883 fields : [{"name":"id","type":"int"},{"name":"plancode_code","type":"string"}],
886 totalProperty : 'total',
892 sortInfo : { direction : 'ASC', field: 'id' },
896 beforeload : function (_self, o){
897 o.params = o.params || {};
908 displayField : 'plancode_name',
910 emptyText : _this._strings['c19ea8f7a11074ac743c58d34830b233'],
911 fieldLabel : 'Planner Code',
912 forceSelection : true,
913 hiddenName : 'item_itemsite_id_itemsite_plancode_id',
915 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
917 name : 'plancode_name',
919 qtip : _this._strings['c19ea8f7a11074ac743c58d34830b233'],
921 selectOnFocus : true,
922 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>',
923 triggerAction : 'all',
925 valueField : 'plancode_id',
939 url : baseURL + '/Roo/costcat.php',
945 fields : [{"name":"id","type":"int"},{"name":"costcat_code","type":"string"}],
948 totalProperty : 'total',
954 sortInfo : { direction : 'ASC', field: 'id' },
958 beforeload : function (_self, o){
959 o.params = o.params || {};
970 displayField : 'costcat_code',
972 emptyText : _this._strings['045a1ac263ac3a9b7420208bdc2df423'],
973 fieldLabel : 'Costcat',
974 forceSelection : true,
975 hiddenName : 'item_itemsite_id_itemsite_costcat_id',
977 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
979 name : 'costcat_code',
981 qtip : _this._strings['045a1ac263ac3a9b7420208bdc2df423'],
983 selectOnFocus : true,
984 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>',
985 triggerAction : 'all',
987 valueField : 'costcat_id',
998 fieldLabel : 'Active',
1000 name : 'item_itemsite_id_itemsite_active',
1007 '|xns' : 'Roo.form',
1008 fieldLabel : 'Sold',
1010 name : 'item_itemsite_id_itemsite_sold',
1017 '|xns' : 'Roo.form',
1018 fieldLabel : 'Stocked',
1020 name : 'item_itemsite_id_itemsite_stocked',
1027 '|xns' : 'Roo.form',
1028 fieldLabel : 'Perishable',
1030 name : 'item_itemsite_id_itemsite_perishable',
1037 '|xns' : 'Roo.form',
1038 fieldLabel : 'Multi Location',
1040 name : 'item_itemsite_id_itemsite_loccntrl',
1049 '|xns' : 'Roo.data',
1051 url : baseURL + '/Roo/location.php',
1056 '|xns' : 'Roo.data',
1057 fields : [{"name":"location_id","type":"int"},"location_name"],
1060 totalProperty : 'total',
1062 xtype : 'JsonReader'
1064 '|xns' : 'Roo.data',
1066 sortInfo : { direction : 'ASC', field: 'location_name' },
1070 beforeload : function (_self, o){
1071 o.params = o.params || {};
1073 o.params.location_netable = 1;
1074 o.params._notinternalcompany = 1;
1075 o.params.location_restrict = 0;
1083 '|xns' : 'Roo.form',
1085 displayField : 'location_name',
1087 emptyText : _this._strings['82a43f89af6d331d80d441624c5c71fa'],
1088 fieldLabel : 'Default Location',
1089 forceSelection : true,
1090 hiddenName : 'item_itemsite_id_itemsite_location_id',
1092 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
1094 name : 'location_name',
1096 qtip : _this._strings['151ccf95db9b81c11bb20fbc302af4b6'],
1097 queryParam : 'query[location_name]',
1098 selectOnFocus : true,
1099 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>',
1100 triggerAction : 'all',
1102 valueField : 'location_id',
1118 '|xns' : 'Roo.form',
1140 '|xns' : 'Roo.data',
1142 url : baseURL + '/Roo/item.php',
1147 '|xns' : 'Roo.data',
1149 {"name":"id","type":"int"},
1150 {"name":"item_number","type":"string"}
1154 totalProperty : 'total',
1156 xtype : 'JsonReader'
1158 '|xns' : 'Roo.data',
1160 sortInfo : { direction : 'ASC', field: 'item_number' },
1164 beforeload : function (_self, o){
1165 o.params = o.params || {};
1167 o.params.item_active = 1;
1168 o.params['!item_type'] = 'K';
1176 '|xns' : 'Roo.bootstrap',
1179 displayField : 'item_number',
1181 emptyText : _this._strings['786410e93beb0193d89f8608c54feb4b'],
1182 fieldLabel : 'Item',
1183 forceSelection : true,
1184 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
1187 qtip : _this._strings['786410e93beb0193d89f8608c54feb4b'],
1188 queryParam : 'query[number_or_name]',
1189 selectOnFocus : true,
1190 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>',
1191 triggerAction : 'all',
1195 xns : Roo.bootstrap,
1198 render : function (_self)
1200 _this.partsBox = _self;
1202 select : function (combo, record, index)
1204 var item_id = _this.form.findField('item_id').getValue() * 1;
1206 if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || item_id < 1){
1212 _this.partsgrid.ds.each(function(d){
1213 if(record.data.item_id == d.data.bomitem_item_id){
1219 Roo.MessageBox.alert('Error', record.data.item_number + ' already exists!');
1220 _this.partsBox.reset();
1225 url : baseURL + '/Roo/bomitem.php',
1228 bomitem_parent_item_id : item_id,
1229 bomitem_item_id : record.data.item_id,
1232 success : function(res) {
1233 _this.partsBox.reset();
1234 _this.partsgrid.footer.onClick('first');
1245 '|xns' : 'Roo.Toolbar',
1251 cls : 'x-btn-text-icon',
1252 icon : rootURL + '/Pman/templates/images/trash.gif',
1253 text : _this._strings['1063e38cb53d94d386f21227fcd84717'],
1259 var sel = _this.partsgrid.getSelectionModel().getSelectedCell();
1261 if(!sel || !sel.length){
1262 Roo.MessageBox.alert("Error", "Please select a item from below list");
1266 var d = _this.partsgrid.ds.getAt(sel[0]);
1268 if(d.data.bomitem_id * 1 < 1){
1269 Roo.MessageBox.alert("Error", "Invaild selection");
1274 url : baseURL + '/Roo/bomitem.php',
1277 _delete : d.data.bomitem_id
1279 success : function(res) {
1280 _this.partsgrid.footer.onClick('first');
1292 '|xns' : 'Roo.data',
1294 url : baseURL + '/Roo/bomitem.php',
1299 '|xns' : 'Roo.data',
1302 'name': 'bomitem_id',
1308 totalProperty : 'total',
1310 xtype : 'JsonReader'
1312 '|xns' : 'Roo.data',
1314 sortInfo : { field : 'bomitem_item_id_item_name', direction: 'ASC' },
1318 beforeload : function (_self, o)
1320 o.params = o.params || {};
1322 var id = _this.form.findField('item_id').getValue() * 1;
1327 o.params.bom_parent_item_id = id;
1338 displayMsg : _this._strings['76d5bf9597c882d6513f71759df298d5'],
1339 emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'],
1342 xtype : 'PagingToolbar'
1344 '|xns' : 'Roo.grid',
1345 autoExpandColumn : 'bomitem_item_id_item_descrip1',
1349 xtype : 'EditorGrid',
1352 '|xns' : 'Roo.grid',
1353 dataIndex : 'bomitem_item_id_item_number',
1354 header : _this._strings['49ee3087348e8d44e1feda1917443987'],
1355 renderer : function(v) { return String.format('{0}', v); },
1358 xtype : 'ColumnModel'
1361 '|xns' : 'Roo.grid',
1362 dataIndex : 'bomitem_item_id_item_descrip1',
1363 header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'],
1364 renderer : function(v) { return String.format('{0}', v); },
1367 xtype : 'ColumnModel'
1372 '|xns' : 'Roo.form',
1374 cls : 'align-right',
1375 decimalPrecision : 0,
1378 xtype : 'NumberField'
1380 '|xns' : 'Roo.grid',
1382 xtype : 'GridEditor',
1388 '|xns' : 'Roo.grid',
1390 dataIndex : 'bomitem_qtyper',
1391 header : _this._strings['03ab340b3f99e03cff9e84314ead38c0'],
1392 renderer : function(v) { return String.format('{0}', v); },
1395 xtype : 'ColumnModel',
1403 afteredit : function (e)
1405 if(e.originalValue == e.value){
1412 url : baseURL + '/Roo/bomitem.php',
1415 bomitem_id : e.record.data.bomitem_id,
1416 bomitem_qtyper : e.value
1418 success : function() {
1419 e.record.set('bomitem_qtyper', e.value);
1428 beforeedit : function (e)
1430 if(e.field != 'bomitem_qtyper'){
1437 _this.partsgrid = this;
1438 //_this.dialog = Pman.Dialog.FILL_IN
1439 if (_this.partspanel.active) {
1440 this.footer.onClick('first');
1451 fitContainer : true,
1454 tableName : 'bomitem',
1455 title : _this._strings['538a3c9d82a4ea4250b987a357d41184'],
1457 xtype : 'GridPanel',
1459 activate : function() {
1460 _this.partspanel = this;
1462 try { if (MODULE.isBuilder) {
1466 var id = _this.form.findField('item_id').getValue() * 1;
1468 Roo.MessageBox.alert("Save First", "Save the item first, before adding parts");
1469 _this.dialog.layout.getRegion('center').showPanel(0);
1473 var type = _this.form.findField('item_type').getValue();
1475 if(!type.length || type != 'K'){
1476 Roo.MessageBox.alert("Error", "Can't add parts to non-kit item");
1477 _this.dialog.layout.getRegion('center').showPanel(0);
1481 if (_this.partsgrid) {
1482 _this.partsgrid.footer.onClick('first');
1496 '|xns' : 'Roo.data',
1531 'name': 'displayorder',
1539 'name': 'parent_image_id',
1545 'dateFormat' : 'Y-m-d H:i:s'
1566 totalProperty : 'total',
1568 xtype : 'JsonReader'
1571 '|xns' : 'Roo.data',
1573 url : baseURL + '/Roo/Images.php',
1577 '|xns' : 'Roo.data',
1579 sortInfo : { field: 'created' , direction: 'DESC' },
1583 beforeload : function (_self, o)
1585 o.params = o.params || {};
1587 var id = _this.form.findField('item_id').getValue();
1594 o.params.ontable = 'item';
1606 displayMsg : _this._strings['c0ed345ec857c06b31f7e88745c9bc40'],
1607 emptyMsg : _this._strings['0c81971f67c0bd4b33799c5365ec2bf5'],
1610 xtype : 'PagingToolbar'
1618 '|xns' : 'Roo.Toolbar',
1619 cls : 'x-btn-text-icon',
1620 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1621 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
1627 Pman.Dialog.Image.show({
1630 onid: _this.form.findField('item_id').getValue() * 1,
1633 if (!data) { return; }
1634 _this.grid.footer.onClick('first');
1641 '|xns' : 'Roo.Toolbar',
1642 cls : 'x-btn-text-icon',
1643 icon : rootURL + '/Pman/templates/images/trash.gif',
1644 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
1650 Pman.genericDelete(_this, 'Images');
1657 '|xns' : 'Roo.grid',
1658 autoExpandColumn : 'id',
1664 '|xns' : 'Roo.grid',
1665 dataIndex : 'created',
1666 header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'],
1667 renderer : function(v,x,r) {
1668 return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
1669 v.format('d/M/Y'), r.data.mimetype, r.data.filename,
1670 r.data.width, r.data.height
1676 xtype : 'ColumnModel'
1679 '|xns' : 'Roo.grid',
1681 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
1682 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename); },
1685 xtype : 'ColumnModel'
1689 render : function() {
1692 if (_this.panel.active) {
1693 this.footer.onClick('first');
1696 rowdblclick : function (_self, rowIndex, e)
1699 var s = _self.getDataSource().getAt(rowIndex);
1701 url : baseURL + '/Images/Download/' + s.data.id
1713 fitContainer : true,
1716 tableName : 'Images',
1717 title : _this._strings['346577d22bb510368e3eddab5df2ca13'],
1719 xtype : 'GridPanel',
1721 activate : function() {
1724 try { if (MODULE.isBuilder) {
1728 var id = _this.form.findField('item_id').getValue() * 1;
1730 Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
1731 _this.dialog.layout.getRegion('center').showPanel(0);
1736 _this.grid.footer.onClick('first');
1750 '|xns' : 'Roo.data',
1752 url : baseURL + '/Roo/ipshead.php',
1757 '|xns' : 'Roo.data',
1760 'name': 'ipshead_id',
1764 'name': 'ipshead_name',
1770 totalProperty : 'total',
1772 xtype : 'JsonReader'
1774 '|xns' : 'Roo.data',
1776 sortInfo : { field : 'ipshead_id', direction: 'ASC' },
1780 beforeload : function (_self, o)
1782 o.params = o.params || {};
1784 var id = _this.form.findField('item_id').getValue() * 1;
1789 o.params._with_item = id;
1800 displayMsg : _this._strings['956e816fa19ca04485c7101adbe07762'],
1801 emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'],
1804 xtype : 'PagingToolbar'
1806 '|xns' : 'Roo.grid',
1807 autoExpandColumn : 'ipshead_descrip',
1811 xtype : 'EditorGrid',
1814 '|xns' : 'Roo.grid',
1815 dataIndex : 'ipshead_name',
1816 header : _this._strings['49ee3087348e8d44e1feda1917443987'],
1817 renderer : function(v) { return String.format('{0}', v); },
1820 xtype : 'ColumnModel'
1823 '|xns' : 'Roo.grid',
1824 dataIndex : 'ipshead_descrip',
1825 header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'],
1826 renderer : function(v) { return String.format('{0}', v); },
1829 xtype : 'ColumnModel'
1832 '|xns' : 'Roo.grid',
1833 dataIndex : 'ipshead_curr_id_curr_name',
1834 header : _this._strings['386c339d37e737a436499d423a77df0c'],
1835 renderer : function(v) { return String.format('{0}', v); },
1838 xtype : 'ColumnModel'
1843 '|xns' : 'Roo.form',
1844 cls : 'align-right',
1845 decimalPrecision : 2,
1847 xtype : 'NumberField'
1849 '|xns' : 'Roo.grid',
1851 xtype : 'GridEditor',
1857 '|xns' : 'Roo.grid',
1859 dataIndex : 'ipshead_ipsitem_price',
1860 header : _this._strings['3601146c4e948c32b6424d2c0a7f0118'],
1861 renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); },
1864 xtype : 'ColumnModel',
1872 afteredit : function (e)
1874 if(e.originalValue == e.value){
1878 var id = _this.form.findField('item_id').getValue() * 1;
1885 url : baseURL + '/Roo/ipsiteminfo',
1888 ipsitem_ipshead_id : e.record.data.ipshead_id,
1889 ipsitem_item_id : id,
1890 ipsitem_price : e.record.data.ipshead_ipsitem_price,
1891 ipsitem_id : e.record.data.ipshead_ipsitem_id
1900 beforeedit : function (e)
1902 if(e.field != 'ipshead_ipsitem_price'){
1910 //_this.dialog = Pman.Dialog.FILL_IN
1911 if (_this.lpanel.active) {
1912 this.footer.onClick('first');
1923 fitContainer : true,
1926 tableName : 'ipshead',
1927 title : _this._strings['1656a671ba692e15836cd85df374556c'],
1929 xtype : 'GridPanel',
1931 activate : function() {
1932 _this.lpanel = this;
1934 try { if (MODULE.isBuilder) {
1938 var id = _this.form.findField('item_id').getValue() * 1;
1940 Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
1941 _this.dialog.layout.getRegion('center').showPanel(0);
1946 _this.lgrid.footer.onClick('first');
1960 '|xns' : 'Roo.data',
1962 url : baseURL + '/Roo/itemsrc.php',
1967 '|xns' : 'Roo.data',
1970 'name': 'itemsrc_id',
1974 'name': 'itemsrc_item_id',
1978 'name': 'itemsrc_item_id',
1982 'name': 'itemsrc_vend_id',
1986 'name': 'itemsrc_vend_id',
1990 'name': 'itemsrc_vend_item_number',
1994 'name': 'itemsrc_vend_item_descrip',
1998 'name': 'itemsrc_comments',
2002 'name': 'itemsrc_vend_uom',
2006 'name': 'itemsrc_invvendoruomratio',
2010 'name': 'itemsrc_minordqty',
2014 'name': 'itemsrc_multordqty',
2018 'name': 'itemsrc_leadtime',
2022 'name': 'itemsrc_ranking',
2026 'name': 'itemsrc_active',
2030 'name': 'itemsrc_manuf_name',
2034 'name': 'itemsrc_manuf_item_number',
2038 'name': 'itemsrc_manuf_item_descrip',
2042 'name': 'itemsrc_default',
2046 'name': 'itemsrc_upccode',
2052 totalProperty : 'total',
2054 xtype : 'JsonReader'
2056 '|xns' : 'Roo.data',
2058 sortInfo : { field : 'itemsrc_vend_id_vend_name', direction: 'ASC' },
2062 beforeload : function (_self, o)
2065 var id = 1 * _this.form.findField('item_id').getValue();
2070 o.params.itemsrc_item_id = id;
2072 update : function (_self, record, operation)
2077 if (operation != 'commit') {
2080 if (record.data.itemsrc_vend_id * 1 < 1) {
2081 return; // do not save.
2083 if (record.data.itemsrc_id * 1 < 0) {
2084 return; // do not save. -- updating at present...
2087 var p = Roo.apply({}, record.data);
2088 record.set('itemsrc_id', -1);
2091 url : baseURL + '/Roo/Itemsrc',
2094 success: function(res) {
2095 if (record.data.itemsrc_id *1 < 1) {
2096 record.set('itemsrc_id', res.data.itemsrc_id);
2112 displayMsg : _this._strings['7f841b4d2f7280eb82318988c6d649d1'],
2113 emptyMsg : _this._strings['19df363d15888baa395364fbcd230c05'],
2116 xtype : 'PagingToolbar'
2124 '|xns' : 'Roo.Toolbar',
2125 cls : 'x-btn-text-icon',
2126 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2127 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
2134 Roo.log("add presed");
2137 var grid = _this.itemsrcgrid;
2139 // uses form defaults or last row value.
2140 var nr = grid.ds.reader.newRow({
2142 itemsrc_item_id : _this.form.findField('item_id').getValue(),
2143 itemsrc_vend_id : 0,
2144 itemsrc_vend_id_vend_name : '',
2145 itemsrc_vend_item_number : '',
2146 itemsrc_vend_item_descrip : '',
2147 itemsrc_comments : '',
2148 itemsrc_vend_uom : 'EA',
2149 itemsrc_invvendoruomratio : 1.0,
2150 itemsrc_minordqty : 0,
2151 itemsrc_multordqty : 0,
2152 itemsrc_leadtime : 30,
2153 itemsrc_ranking : 0,
2154 itemsrc_active : true,
2155 itemsrc_manuf_name : '',
2156 itemsrc_manuf_item_number : '',
2157 itemsrc_manuf_item_descrip: '',
2158 itemsrc_default : true,
2159 itemsrc_upccode : ''
2163 grid.ds.insert(0, nr);
2164 grid.startEditing(0, 0); // type..
2172 '|xns' : 'Roo.grid',
2173 autoExpandColumn : 'itemsrc_comments',
2177 xtype : 'EditorGrid',
2184 '|xns' : 'Roo.data',
2186 url : baseURL + '/Roo/vendinfo.php',
2191 '|xns' : 'Roo.data',
2192 fields : [{"name":"id","type":"int"},{"name":"vend_name","type":"string"}],
2195 totalProperty : 'total',
2197 xtype : 'JsonReader'
2199 '|xns' : 'Roo.data',
2201 sortInfo : { direction : 'ASC', field: 'id' },
2205 beforeload : function (_self, o){
2206 o.params = o.params || {};
2215 '|xns' : 'Roo.form',
2217 displayField : 'vend_name',
2219 emptyText : _this._strings['7996af9149ed376ce252e35c4da7146b'],
2220 forceSelection : true,
2221 hiddenName : 'itemsrc_vend_id',
2223 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
2225 name : 'itemsrc_vend_id_vend_name',
2227 qtip : _this._strings['dd24f967299e81b9603cb071693d5c32'],
2228 queryParam : 'q[search]',
2229 selectOnFocus : true,
2230 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>',
2231 triggerAction : 'all',
2233 valueField : 'vend_id',
2242 '|xns' : 'Roo.grid',
2244 xtype : 'GridEditor',
2250 '|xns' : 'Roo.grid',
2251 dataIndex : 'itemsrc_vend_id',
2252 header : _this._strings['ec9ceefe0c19f4c029008c23e3c947b7'],
2253 renderer : function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); },
2256 xtype : 'ColumnModel',
2265 '|xns' : 'Roo.form',
2269 '|xns' : 'Roo.grid',
2271 xtype : 'GridEditor',
2277 '|xns' : 'Roo.grid',
2278 dataIndex : 'itemsrc_vend_item_number',
2279 header : _this._strings['e5353fc67b122d1b42181073b46cd060'],
2280 renderer : function(v) { return String.format('{0}', v); },
2283 xtype : 'ColumnModel',
2292 '|xns' : 'Roo.form',
2296 '|xns' : 'Roo.grid',
2298 xtype : 'GridEditor',
2304 '|xns' : 'Roo.grid',
2305 dataIndex : 'itemsrc_comments',
2306 header : _this._strings['8413c683b4b27cc3f4dbd4c90329d8ba'],
2307 renderer : function(v) { return String.format('{0}', v); },
2310 xtype : 'ColumnModel',
2317 '|xns' : 'Roo.grid',
2318 dataIndex : 'itemsrc_vend_uom',
2319 header : _this._strings['bb8913cd17d59f182acc7be1020007b7'],
2320 renderer : function(v) { return String.format('{0}', v); },
2323 xtype : 'ColumnModel'
2328 '|xns' : 'Roo.form',
2329 decimalPrecision : 0,
2332 xtype : 'NumberField'
2334 '|xns' : 'Roo.grid',
2336 xtype : 'GridEditor',
2342 '|xns' : 'Roo.grid',
2344 dataIndex : 'itemsrc_minordqty',
2345 header : _this._strings['7be1fa478799242847d4ef861ff6f8e1'],
2346 renderer : function(v) { return String.format('{0}', v); },
2349 xtype : 'ColumnModel',
2358 '|xns' : 'Roo.form',
2359 decimalPrecision : 0,
2362 xtype : 'NumberField'
2364 '|xns' : 'Roo.grid',
2366 xtype : 'GridEditor',
2372 '|xns' : 'Roo.grid',
2374 dataIndex : 'itemsrc_leadtime',
2375 header : _this._strings['0ac9012a8c03a76ee76f04321b3b7fda'],
2376 renderer : function(v) { return String.format('{0}', v); },
2379 xtype : 'ColumnModel',
2386 '|xns' : 'Roo.grid',
2387 dataIndex : 'itemsrc_active',
2388 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
2389 renderer : function(v) { return String.format('{0}', v); },
2392 xtype : 'ColumnModel'
2396 afteredit : function (e)
2402 _this.itemsrcgrid = this;
2404 if (_this.itemsrcpanel.active) {
2405 this.footer.onClick('first');
2408 rowdblclick : function (_self, rowIndex, e)
2410 if (!_this.dialog) return;
2411 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
2412 _this.grid.footer.onClick('first');
2423 fitContainer : true,
2426 tableName : 'itemsrc',
2427 title : _this._strings['1814d65a76028fdfbadab64a5a8076df'],
2429 xtype : 'GridPanel',
2431 activate : function() {
2432 _this.itemsrcpanel = this;
2434 try { if (MODULE.isBuilder) {
2438 var id = _this.form.findField('item_id').getValue() * 1;
2440 Roo.MessageBox.alert("Save First", "Save the item first, before adding suppliers");
2441 _this.dialog.layout.getRegion('center').showPanel(0);
2445 var type = _this.form.findField('item_type').getValue();
2448 Roo.MessageBox.alert("Error", "Can't add suppliers to kit item");
2449 _this.dialog.layout.getRegion('center').showPanel(0);
2453 if (_this.itemsrcgrid) {
2454 _this.itemsrcgrid.footer.onClick('first');
2467 '|xns' : 'Roo.data',
2469 url : baseURL + '/Roo/events.php',
2474 '|xns' : 'Roo.data',
2477 'name': 'event_when',
2489 'name': 'person_id_name',
2499 totalProperty : 'total',
2501 xtype : 'JsonReader'
2503 '|xns' : 'Roo.data',
2505 sortInfo : { field : 'event_when', direction: 'DESC' },
2509 beforeload : function (_self, options)
2511 options.params = options.params || {};
2513 options.params.on_table = 'item';
2514 options.params.on_id = _this.form.findField('item_id').getValue();
2525 displayMsg : _this._strings['089ba2b5edc96565fc22c584ecfbb1a6'],
2526 emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'],
2529 xtype : 'PagingToolbar'
2531 '|xns' : 'Roo.grid',
2532 autoExpandColumn : 'remarks',
2538 '|xns' : 'Roo.grid',
2539 dataIndex : 'event_when',
2540 header : _this._strings['820dbd2b8f606aff866c0bbfb6b737c1'],
2541 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
2544 xtype : 'ColumnModel'
2547 '|xns' : 'Roo.grid',
2548 dataIndex : 'action',
2549 header : _this._strings['004bf6c9a40003140292e97330236c53'],
2550 renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); },
2553 xtype : 'ColumnModel'
2556 '|xns' : 'Roo.grid',
2557 dataIndex : 'ipaddr',
2558 header : _this._strings['5b8c99dad1893a85076709b2d3c2d2d0'],
2559 renderer : function(v) { return String.format('{0}', v); },
2562 xtype : 'ColumnModel'
2565 '|xns' : 'Roo.grid',
2566 dataIndex : 'person_id_name',
2567 header : _this._strings['4ee972120bcda675f75222c87cb9d356'],
2568 renderer : function(v) { return String.format('{0}', v); },
2571 xtype : 'ColumnModel'
2574 '|xns' : 'Roo.grid',
2575 dataIndex : 'remarks',
2576 header : _this._strings['f4c6f851b00d5518bf888815de279aba'],
2577 renderer : function(v) { return String.format('{0}', v); },
2580 xtype : 'ColumnModel'
2587 if (_this.hpanel.active) {
2588 this.footer.onClick('first');
2599 fitContainer : true,
2602 tableName : 'events',
2603 title : _this._strings['16d2b386b2034b9488996466aaae0b57'],
2605 xtype : 'GridPanel',
2607 activate : function() {
2608 _this.hpanel = this;
2610 _this.hgrid.footer.onClick('first');