Pman.Dialog.XtupleItem = {
- dialog : false,
- callback: false,
-
- show : function(data, cb)
- {
- if (!this.dialog) {
- this.create();
+ _strings : {
+ '346577d22bb510368e3eddab5df2ca13' :"Reference Files",
+ 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
+ '92b17d3d0f13232ec1d46844c836d4db' :"Invoice UOM",
+ '390fc24b0feebfff8c3fb8625418c2e9' :"Perishable",
+ 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
+ '956e816fa19ca04485c7101adbe07762' :"Displaying records {0} - {1} of {2}",
+ '69395719de41dd8a31905b1e94c91816' :"Select classcode",
+ '82a43f89af6d331d80d441624c5c71fa' :"Default Location",
+ '538a3c9d82a4ea4250b987a357d41184' :"Item Parts",
+ '03ab340b3f99e03cff9e84314ead38c0' :"Qty",
+ '5b8c99dad1893a85076709b2d3c2d2d0' :"IP Address",
+ 'fce71ab09b7795157c6e23370b4afb26' :"Stocked",
+ '045a1ac263ac3a9b7420208bdc2df423' :"Select costcat",
+ '0c81971f67c0bd4b33799c5365ec2bf5' :"No Images found",
+ 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
+ '151ccf95db9b81c11bb20fbc302af4b6' :"Select terms",
+ '786410e93beb0193d89f8608c54feb4b' :"Select item",
+ '0ac9012a8c03a76ee76f04321b3b7fda' :"Lead time",
+ '675c9bd3bbae30af03fe74346dcae9a7' :"Edit / Create item",
+ 'dd24f967299e81b9603cb071693d5c32' :"Select vendinfo",
+ '023a5dfa857c4aa0156e6685231a1dbd' :"Select Type",
+ 'e8586011952b0d098b0e568f20ca2b1f' :"Select Currency",
+ '9bd81329febf6efe22788e03ddeaf0af' :"Class",
+ '8413c683b4b27cc3f4dbd4c90329d8ba' :"Comments",
+ '820dbd2b8f606aff866c0bbfb6b737c1' :"Changed",
+ 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
+ '0eceeb45861f9585dd7a97a3e36f85c6' :"Created",
+ '386c339d37e737a436499d423a77df0c' :"Currency",
+ '9076cbba1d9ef79280b4f39e2aa0d115' :"Nothing found",
+ '1243daf593fa297e07ab03bf06d925af' :"Searching...",
+ '6df5afb79e960381ed66568c2a644ec6' :"Description (2)",
+ '7be1fa478799242847d4ef861ff6f8e1' :"Min Qty",
+ '6665e3761028c84e1d228de3432229ed' :"SKU",
+ 'e54f1b41d200adbd96eb53634388d780' :"Sales Account",
+ '76729937a5eb6b0fd88c42581161facd' :"Select Category",
+ 'eccd13e2f1acfd6b8412a2caafa37a80' :"Stock Safety Level",
+ '43b2683180fe5e67a91696c834df0a32' :"Reorder Level",
+ 'e1a8f447925ed2867c591aa0865d170e' :"Multi Location",
+ '7d74f3b92b19da5e606d737d339a9679' :"Item",
+ '2ea154449c00001e87af8df7c0728678' :"Control Method",
+ '19df363d15888baa395364fbcd230c05' :"No itemsrc found",
+ '0d122b17933ab4173e9d75d55fc5e764' :"Standard Cost",
+ 'df2ad52a14d681b1cd8495f8650fdb56' :"Select prodcat",
+ '49ee3087348e8d44e1feda1917443987' :"Name",
+ 'e5353fc67b122d1b42181073b46cd060' :"Vendor Ref#",
+ 'c19ea8f7a11074ac743c58d34830b233' :"Select plancode",
+ 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
+ 'c056b1456660ea65aad6dfc664002b84' :"Item active",
+ '9d98e31f261471f426e906282544c15d' :"Item comments",
+ '20f39d1311ccbd3b7e61cdd4978719f9' :"Itemsite Settings",
+ '1656a671ba692e15836cd85df374556c' :"Price List",
+ 'bb8913cd17d59f182acc7be1020007b7' :"UOM",
+ 'f9c68217f6ef9a9afe7575e766bd7b9f' :"Planner Code",
+ '76d5bf9597c882d6513f71759df298d5' :"Displaying parts {0} - {1} of {2}",
+ '3601146c4e948c32b6424d2c0a7f0118' :"Price",
+ '1814d65a76028fdfbadab64a5a8076df' :"Suppliers",
+ '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found",
+ '4ee972120bcda675f75222c87cb9d356' :"Who",
+ '16d2b386b2034b9488996466aaae0b57' :"History",
+ '14fc4f0a5008e1d8d5645071755c596b' :"Price UOM",
+ '089ba2b5edc96565fc22c584ecfbb1a6' :"Displaying events{0} - {1} of {2}",
+ 'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
+ '148cb4c3e6469c6a92d24951485b65ff' :"Item listprice",
+ 'c96bc98500430b5eb8e9cfc5959e09b5' :"Item sold",
+ '7f841b4d2f7280eb82318988c6d649d1' :"Displaying itemsrc{0} - {1} of {2}",
+ 'a254c25adc7d10d7e9c4889484f875a5' :"Detail",
+ '5aa275a71868f3afcacfd6de452b07eb' :"Costcat",
+ 'c0ed345ec857c06b31f7e88745c9bc40' :"Displaying Images {0} - {1} of {2}",
+ 'c9cc8cce247e49bae79f15173ce97354' :"Save",
+ '6abc7326bcd435c1eb22ad3714db48c4' :"Lead time (Days)",
+ 'ec9ceefe0c19f4c029008c23e3c947b7' :"Vendor",
+ '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
+ '004bf6c9a40003140292e97330236c53' :"Action",
+ '689202409e48743b914713f96d93947c' :"Value",
+ 'f4c6f851b00d5518bf888815de279aba' :"Notes",
+ '10991ea03e3591bebc4c0827fc369540' :"Product Category",
+ 'f9838de820f2a2e16241033270c68e29' :"Select uom",
+ '8c489d0946f66d17d73f26366a4bf620' :"Weight",
+ 'd85a8a381c36f6dde21d81542830e2b1' :"Sold",
+ '1063e38cb53d94d386f21227fcd84717' :"Remove",
+ '7996af9149ed376ce252e35c4da7146b' :"Select Vendor"
+ },
+
+ dialog : false,
+ callback: false,
+
+ show : function(data, cb)
+ {
+ if (!this.dialog) {
+ this.create();
+ }
+
+ this.callback = cb;
+ this.data = data;
+ this.dialog.show(this.data._el);
+ if (this.form) {
+ this.form.reset();
+ this.form.setValues(data);
+ this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
+ }
+
+ },
+
+ create : function()
+ {
+ var _this = this;
+ this.dialog = Roo.factory({
+ closable : false,
+ collapsible : false,
+ height : 550,
+ modal : true,
+ resizable : false,
+ title : _this._strings['675c9bd3bbae30af03fe74346dcae9a7'] /* Edit / Create item */,
+ width : 800,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'LayoutDialog',
+ listeners : {
+ show : function (_self)
+ {
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ }
+ },
+ center : {
+ alwaysShowTabs : true,
+ tabPosition : 'top',
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'LayoutRegion'
+ },
+ buttons : [
+ {
+ text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.dialog.hide();
}
-
- this.callback = cb;
- this.data = data;
- this.dialog.show(this.data._el);
- if (this.form) {
- this.form.reset();
- this.form.setValues(data);
- this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
+ }
+ },
+ {
+ text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ // do some checks?
+
+
+ // _this.dialog.el.mask("Saving");
+ _this.form.doAction("submit");
+
+ },
+ render : function (_self)
+ {
+ _this.saveBtn = this;
}
-
- },
-
- create : function()
- {
- var _this = this;
- this.dialog = Roo.factory({
- center : {
- '|xns' : 'Roo',
- alwaysShowTabs : true,
- xtype : 'LayoutRegion',
- tabPosition : 'top',
- xns : Roo
+ }
+ }
+ ],
+ items : [
+ {
+ region : 'center',
+ title : _this._strings['a254c25adc7d10d7e9c4889484f875a5'] /* Detail */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'ContentPanel',
+ items : [
+ {
+ labelWidth : 120,
+ method : 'POST',
+ style : 'margin:10px;',
+ url : baseURL + '/Roo/item.php',
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Form',
+ listeners : {
+ actioncomplete : function(_self,action)
+ {
+ if (action.type == 'setdata') {
+ _this.form.findField('item_number').el.dom.readOnly = true;
+ _this.form.findField('item_type').disabled = true;
+
+ if(_this.data.item_id * 1 > 0){
+
+ this.load({
+ method: 'GET',
+ params: {
+ '_id' : _this.data.item_id,
+ '_with_itemsite' : 1,
+ '_with_itemcost' : 1,
+ '_with_prodcat' : 1 ,
+ '_with_salesaccnt' : 1
+ }
+ });
+ return;
+ }
+ // if it's new..
+ _this.form.findField('item_number').el.dom.readOnly = false;
+ _this.form.findField('item_type').disabled = false;
+ _this.form.findField('item_salesaccnt').setValue('');
+
+ _this.form.findField('item_type').showHide();
+
+ return;
+ }
+ if (action.type == 'load') {
+ _this.form.findField('item_type').showHide();
+ return;
+ }
+ if (action.type =='submit') {
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if (id < 1) {
+
+ this.load({
+ method: 'GET',
+ params: {
+ '_id' : action.result.data.item_id,
+ '_with_itemsite' : 1,
+ '_with_itemcost' : 1,
+ '_with_prodcat' : 1 ,
+ '_with_salesaccnt' : 1
+ }
+ });
+ return;
+ }
+ _this.dialog.hide();
+
+ if (_this.callback) {
+ _this.callback.call(_this, _this.form.getValues());
+ }
+ _this.form.reset();
+ return;
+ }
+ },
+ rendered : function (form)
+ {
+ _this.form= form;
+ }
+ },
+ items : [
+ {
+ allowBlank : false,
+ fieldLabel : _this._strings['6665e3761028c84e1d228de3432229ed'] /* SKU */,
+ name : 'item_number',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextField'
+ },
+ {
+ fieldLabel : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
+ name : 'item_descrip1',
+ width : 400,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextField'
+ },
+ {
+ fieldLabel : _this._strings['6df5afb79e960381ed66568c2a644ec6'] /* Description (2) */,
+ name : 'item_descrip2',
+ width : 400,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextField'
+ },
+ {
+ labelWidth : 120,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Column',
+ items : [
+ {
+ allowBlank : false,
+ displayField : 'fname',
+ editable : false,
+ emptyText : _this._strings['023a5dfa857c4aa0156e6685231a1dbd'] /* Select Type */,
+ fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
+ hiddenName : 'item_type',
+ listWidth : 200,
+ mode : 'local',
+ name : 'item_type_name',
+ showHide : function() {
+
+ var it = this.getValue();
+
+ var options = [
+ 'item_itemcost_id_itemcost_curr_id',
+ 'item_itemcost_id_itemcost_actcost',
+ 'item_itemsite_id_itemsite_reorderlevel',
+ 'item_itemsite_id_itemsite_leadtime',
+ 'item_itemsite_id_itemsite_location_id',
+ 'item_itemsite_id_itemsite_loccntrl',
+ 'item_itemsite_id_itemsite_stocked',
+ 'item_itemsite_id_itemsite_perishable',
+
+ 'item_itemsite_id_itemsite_safetystock',
+ 'item_itemsite_id_itemsite_controlmethod',
+ 'item_itemsite_id_itemsite_plancode_id',
+ 'item_itemsite_id_itemsite_costcat_id',
+ 'item_itemsite_id_itemsite_active',
+ 'item_itemsite_id_itemsite_sold'
+
+ ];
+
+ var r_req = [
+ 'item_listprice'
+ ];
+
+ var state = true;
+
+ _this.standardCostFieldSet.show();
+ _this.itemsiteFieldSet.show();
+
+
+ switch(it) {
+ case 'K':
+ state = false;
+
+ _this.form.findField('item_listprice').allowBlank = false;
+ _this.form.findField('item_listprice').actionMode = 'fieldEl';
+ _this.form.findField('item_listprice').hideMode = 'display';
+ _this.form.findField('item_listprice').show();
+
+ break;
+
+ case 'R': // refrence
+ options = options.concat(r_req);
+ state = false;
+ _this.standardCostFieldSet.hide();
+ break;
+
+ case 'P': // purchased..
+ options = options.concat(r_req);
+ // must have
+ break;
+ }
+
+ Roo.each(options, function(n) {
+ var ff = _this.form.findField(n);
+ ff.allowBlank = !state;
+ ff.actionMode = 'fieldEl';
+ ff.hideMode = 'display';
+ state ? ff.show() : ff.hide();
+
+ });
+
+
+ if(!state){
+ _this.standardCostFieldSet.hide();
+ _this.itemsiteFieldSet.hide();
+
+ }
+
+
+
},
- '|xns' : 'Roo',
- modal : true,
- collapsible : false,
- title : "Edit / Create item",
- xtype : 'LayoutDialog',
- width : 800,
- xns : Roo,
- closable : false,
- resizable : false,
- height : 550,
- buttons : [
- {
- '|xns' : 'Roo',
- text : "Cancel",
- xtype : 'Button',
- xns : Roo,
- listeners : {
- click : function (_self, e)
- {
- _this.dialog.hide();
- }
- }
- },
-{
- '|xns' : 'Roo',
- text : "Save",
- xtype : 'Button',
- xns : Roo,
- listeners : {
- render : function (_self)
- {
- _this.saveBtn = this;
- },
- click : function (_self, e)
- {
- // do some checks?
-
-
- // _this.dialog.el.mask("Saving");
- _this.form.doAction("submit");
-
- }
- }
- }
- ],
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
+ triggerAction : 'all',
+ valueField : 'ftype',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
listeners : {
- show : function (_self)
- {
- _this.dialog.layout.getRegion('center').showPanel(0);
- }
+ beforeselect : function (combo, record, index)
+ {
+ (function() { combo.showHide(); }).defer(100);
+ }
},
- items : [
- {
- '|xns' : 'Roo',
- region : 'center',
- title : "Detail",
- xtype : 'ContentPanel',
- xns : Roo,
- items : [
- {
- '|xns' : 'Roo.form',
- url : baseURL + '/Roo/item.php',
- method : 'POST',
- style : 'margin:10px;',
- xtype : 'Form',
- labelWidth : 120,
- xns : Roo.form,
- listeners : {
- actioncomplete : function(_self,action)
- {
- if (action.type == 'setdata') {
- _this.form.findField('item_number').el.dom.readOnly = true;
- _this.form.findField('item_type').disabled = true;
-
- if(_this.data.item_id * 1 > 0){
-
- this.load({
- method: 'GET',
- params: {
- '_id' : _this.data.item_id,
- '_with_itemsite' : 1,
- '_with_itemcost' : 1,
- '_with_prodcat' : 1 ,
- '_with_salesaccnt' : 1
- }
- });
- return;
- }
- // if it's new..
- _this.form.findField('item_number').el.dom.readOnly = false;
- _this.form.findField('item_type').disabled = false;
- _this.form.findField('item_salesaccnt').setValue('');
-
- return;
- }
- if (action.type == 'load') {
- _this.form.findField('item_type').showHide();
- return;
- }
- if (action.type =='submit') {
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if (id < 1) {
-
- this.load({
- method: 'GET',
- params: {
- '_id' : action.result.data.item_id,
- '_with_itemsite' : 1,
- '_with_itemcost' : 1,
- '_with_prodcat' : 1 ,
- '_with_salesaccnt' : 1
- }
- });
- return;
- }
- _this.dialog.hide();
-
- if (_this.callback) {
- _this.callback.call(_this, _this.form.getValues());
- }
- _this.form.reset();
- return;
- }
- },
- rendered : function (form)
- {
- _this.form= form;
- }
- },
- items : [
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'SKU',
- xtype : 'TextField',
- allowBlank : false,
- width : 200,
- xns : Roo.form,
- name : 'item_number'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Description',
- xtype : 'TextField',
- width : 400,
- xns : Roo.form,
- name : 'item_descrip1'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Description (2)',
- xtype : 'TextField',
- width : 400,
- xns : Roo.form,
- name : 'item_descrip2'
- },
- {
- '|xns' : 'Roo.form',
- xtype : 'Column',
- labelWidth : 120,
- xns : Roo.form,
- items : [
- {
- store : {
- '|xns' : 'Roo.data',
- xtype : 'SimpleStore',
- data : [
- [ 'P', "Purchased (eg. a standard product)"],
- [ 'R' , "Reference (Non-Product)"],
- [ 'K', "Kit (made up of products)"]
- ],
- fields : [ 'ftype', 'fname'],
- xns : Roo.data
- },
- '|xns' : 'Roo.form',
- listWidth : 200,
- triggerAction : 'all',
- fieldLabel : 'Type',
- displayField : 'fname',
- emptyText : "Select Type",
- hiddenName : 'item_type',
- valueField : 'ftype',
- xtype : 'ComboBox',
- allowBlank : false,
- showHide : function() {
-
- var it = this.getValue();
-
- var options = [
- 'item_itemcost_id_itemcost_curr_id',
- 'item_itemcost_id_itemcost_actcost',
- 'item_itemsite_id_itemsite_reorderlevel',
- 'item_itemsite_id_itemsite_leadtime',
- 'item_itemsite_id_itemsite_location_id',
- 'item_itemsite_id_itemsite_loccntrl',
- 'item_itemsite_id_itemsite_stocked',
- 'item_itemsite_id_itemsite_perishable',
-
- 'item_itemsite_id_itemsite_safetystock',
- 'item_itemsite_id_itemsite_controlmethod',
- 'item_itemsite_id_itemsite_plancode_id',
- 'item_itemsite_id_itemsite_costcat_id',
- 'item_itemsite_id_itemsite_active',
- 'item_itemsite_id_itemsite_sold'
-
- ];
-
- var r_req = [
- 'item_listprice'
- ];
-
- var state = true;
-
- _this.standardCostFieldSet.show();
- _this.itemsiteFieldSet.show();
- _this.form.findField('_update_related').setValue(1);
-
- switch(it) {
- case 'K':
- state = false;
-
- _this.form.findField('item_listprice').allowBlank = false;
- _this.form.findField('item_listprice').actionMode = 'fieldEl';
- _this.form.findField('item_listprice').hideMode = 'display';
- _this.form.findField('item_listprice').show();
-
- break;
-
- case 'R': // refrence
- options = options.concat(r_req);
- state = false;
- _this.standardCostFieldSet.hide();
- break;
-
- case 'P': // purchased..
- options = options.concat(r_req);
- // must have
- break;
- }
-
- Roo.each(options, function(n) {
- var ff = _this.form.findField(n);
- ff.allowBlank = !state;
- ff.actionMode = 'fieldEl';
- ff.hideMode = 'display';
- state ? ff.show() : ff.hide();
-
- });
-
-
- if(!state){
- _this.standardCostFieldSet.hide();
- _this.itemsiteFieldSet.hide();
- _this.form.findField('_update_related').setValue(0);
- }
-
-
-
- },
- editable : false,
- width : 200,
- xns : Roo.form,
- mode : 'local',
- name : 'item_type_name',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
- listeners : {
- beforeselect : function (combo, record, index)
- {
- (function() { combo.showHide(); }).defer(100);
- }
- },
- items : [
-
- ]
-
- },
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/classcode.php',
- method : 'GET',
- xtype : 'HttpProxy',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"id","type":"int"},{"name":"classcode_code","type":"string"}],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'id' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Class',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'classcode_code',
- emptyText : "Select classcode",
- hiddenName : 'item_classcode_id',
- minChars : 2,
- valueField : 'classcode_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : false,
- width : 200,
- xns : Roo.form,
- name : 'item_classcode_id_classcode_code',
- qtip : "Select classcode",
- queryParam : '',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- },
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/classcode.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"id","type":"int"},{"name":"classcode_code","type":"string"}],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'id' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Invoice UOM',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'uom_descrip',
- emptyText : "Select uom",
- hiddenName : 'item_inv_uom_id',
- minChars : 2,
- valueField : 'uom_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : false,
- width : 200,
- xns : Roo.form,
- name : 'item_inv_uom_id_uom_descrip',
- qtip : "Select classcode",
- queryParam : '',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Weight',
- xtype : 'NumberField',
- allowBlank : false,
- allowDecimals : true,
- decimalPrecision : 2,
- width : 200,
- xns : Roo.form,
- name : 'item_prodweight'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Item comments',
- xtype : 'TextArea',
- width : 200,
- xns : Roo.form,
- name : 'item_comments',
- height : 100
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Item sold',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 75,
- xns : Roo.form,
- name : 'item_sold'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Item active',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 75,
- xns : Roo.form,
- name : 'item_active'
- },
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/prodcat.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"id","type":"int"},{"name":"prodcat_code","type":"string"}],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- xns : Roo.data,
- sortInfo : { direction : 'ASC', field: 'id' },
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- alwaysQuery : true,
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Product Category',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'prodcat_code',
- emptyText : "Select Category",
- hiddenName : 'item_prodcat_id',
- minChars : 2,
- valueField : 'prodcat_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : false,
- width : 200,
- xns : Roo.form,
- name : 'item_prodcat_id_prodcat_code',
- qtip : "Select prodcat",
- queryParam : '',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>',
- loadingText : "Searching...",
- listeners : {
- add : function (combo)
- {
- Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});
- },
- edit : function (combo, record)
- {
- var s = _this.form.findField('item_prodcat_id').getValue() * 1;
- if(s < 1){
- Roo.MessageBox.alert('Error','Please select a account assignment');
- return;
- }
- Pman.Dialog.XtupleProdcat.show({prodcat_id : s});
- }
- },
- items : [
-
- ]
-
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Sales Account',
- xtype : 'DisplayField',
- xns : Roo.form,
- name : 'item_salesaccnt'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Item listprice',
- xtype : 'NumberField',
- width : 200,
- xns : Roo.form,
- name : 'item_listprice'
- },
- {
- '|xns' : 'Roo.form',
- style : 'width:320px',
- xtype : 'FieldSet',
- legend : "Standard Cost",
- xns : Roo.form,
- listeners : {
- render : function (_self)
- {
- _this.standardCostFieldSet = _self;
- }
- },
- items : [
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/curr_symbol.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'curr_id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"curr_id","type":"int"},"curr_symbol"],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'curr_symbol' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
-
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Currency',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'curr_name',
- emptyText : "Select Currency",
- hiddenName : 'item_itemcost_id_itemcost_curr_id',
- minChars : 2,
- valueField : 'curr_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : false,
- width : 200,
- xns : Roo.form,
- name : 'curr_name',
- qtip : "Select Currency",
- queryParam : 'query[curr_name]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Value',
- xtype : 'NumberField',
- allowBlank : false,
- width : 200,
- xns : Roo.form,
- name : 'item_itemcost_id_itemcost_actcost'
- }
- ]
-
- }
- ]
-
- },
- {
- '|xns' : 'Roo.form',
- xtype : 'Column',
- xns : Roo.form,
- items : [
- {
- '|xns' : 'Roo.form',
- xtype : 'FieldSet',
- legend : "Itemsite Settings",
- xns : Roo.form,
- style : 'width:335px;',
- labelWidth : 120,
- listeners : {
- render : function (_self)
- {
- _this.itemsiteFieldSet = _self;
- }
- },
- items : [
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Reorder Level',
- xtype : 'NumberField',
- allowBlank : false,
- width : 200,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_reorderlevel'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Stock Safety Level',
- xtype : 'NumberField',
- allowBlank : false,
- width : 200,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_safetystock'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Lead time (Days)',
- xtype : 'NumberField',
- allowBlank : false,
- width : 200,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_leadtime'
- },
- {
- store : {
- '|xns' : 'Roo.data',
- xtype : 'SimpleStore',
- data : [
- [ 'N', "None"],
- [ 'R' , "Regular"]
- ],
- fields : [ 'ftype', 'fname'],
- xns : Roo.data
- },
- '|xns' : 'Roo.form',
- listWidth : 200,
- triggerAction : 'all',
- fieldLabel : 'Control Method',
- displayField : 'fname',
- hiddenName : 'item_itemsite_id_itemsite_controlmethod',
- valueField : 'ftype',
- xtype : 'ComboBox',
- allowBlank : false,
- editable : false,
- width : 200,
- xns : Roo.form,
- mode : 'local',
- name : 'item_itemsite_id_itemsite_controlmethod_name',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
- items : [
-
- ]
-
- },
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/plancode.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"id","type":"int"},{"name":"plancode_code","type":"string"}],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- xns : Roo.data,
- sortInfo : { direction : 'ASC', field: 'id' },
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Planner Code',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'plancode_name',
- emptyText : "Select plancode",
- hiddenName : 'item_itemsite_id_itemsite_plancode_id',
- minChars : 2,
- valueField : 'plancode_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : false,
- width : 200,
- xns : Roo.form,
- name : 'plancode_name',
- qtip : "Select plancode",
- queryParam : '',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- },
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/costcat.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"id","type":"int"},{"name":"costcat_code","type":"string"}],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- xns : Roo.data,
- sortInfo : { direction : 'ASC', field: 'id' },
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Costcat',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'costcat_code',
- emptyText : "Select costcat",
- hiddenName : 'item_itemsite_id_itemsite_costcat_id',
- minChars : 2,
- valueField : 'costcat_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : false,
- width : 200,
- xns : Roo.form,
- name : 'costcat_code',
- qtip : "Select costcat",
- queryParam : '',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Active',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 75,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_active'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Sold',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 75,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_sold'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Stocked',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 75,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_stocked'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Perishable',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 75,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_perishable'
- },
- {
- '|xns' : 'Roo.form',
- fieldLabel : 'Multi Location',
- inputValue : true,
- xtype : 'Checkbox',
- valueOff : 0,
- width : 100,
- xns : Roo.form,
- name : 'item_itemsite_id_itemsite_loccntrl'
- },
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/location.php',
- method : 'GET',
- xtype : 'HttpProxy',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'location_id',
- root : 'data',
- xtype : 'JsonReader',
- fields : [{"name":"location_id","type":"int"},"location_name"],
- xns : Roo.data,
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'location_name' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- o.params.location_netable = 1;
- o.params._notinternalcompany = 1;
- o.params.location_restrict = 0;
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- fieldLabel : 'Default Location',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 200,
- displayField : 'location_name',
- emptyText : "Default Location",
- hiddenName : 'item_itemsite_id_itemsite_location_id',
- minChars : 2,
- valueField : 'location_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : false,
- editable : true,
- width : 200,
- xns : Roo.form,
- name : 'location_name',
- qtip : "Select terms",
- queryParam : 'query[location_name]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- }
- ]
-
- }
- ]
-
- },
- {
- '|xns' : 'Roo.form',
- xtype : 'Hidden',
- xns : Roo.form,
- width : 75,
- name : 'item_id'
- },
- {
- '|xns' : 'Roo.form',
- value : 1,
- xtype : 'Hidden',
- width : 75,
- xns : Roo.form,
- name : '_update_related'
- }
- ]
-
- }
- ]
-
- },
- {
- grid : {
- toolbar : {
- '|xns' : 'Roo',
- xtype : 'Toolbar',
- xns : Roo,
- items : [
- {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/item.php',
- method : 'GET',
- xtype : 'HttpProxy',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- fields : [
- {"name":"id","type":"int"},
- {"name":"item_number","type":"string"}
- ],
- xns : Roo.data,
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'item_number' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
-
- o.params.item_active = 1;
- o.params['!item_type'] = 'K';
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.bootstrap',
- alwaysQuery : true,
- triggerAction : 'all',
- fieldLabel : 'Item',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'item_number',
- emptyText : "Select item",
- minChars : 2,
- valueField : 'id',
- xtype : 'ComboBox',
- allowBlank : true,
- typeAhead : true,
- editable : true,
- width : 200,
- xns : Roo.bootstrap,
- qtip : "Select item",
- queryParam : 'query[number_or_name]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>',
- loadingText : "Searching...",
- listeners : {
- render : function (_self)
- {
- _this.partsBox = _self;
- },
- select : function (combo, record, index)
- {
- var item_id = _this.form.findField('item_id').getValue() * 1;
-
- if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || item_id < 1){
- return;
- }
-
- var err = false;
-
- _this.partsgrid.ds.each(function(d){
- if(record.data.item_id == d.data.bomitem_item_id){
- err = true;
- }
- });
-
- if(err){
- Roo.MessageBox.alert('Error', record.data.item_number + ' already exists!');
- _this.partsBox.reset();
- return;
- }
-
- new Pman.Request({
- url : baseURL + '/Roo/bomitem.php',
- method : 'POST',
- params : {
- bomitem_parent_item_id : item_id,
- bomitem_item_id : record.data.item_id
- },
- success : function(res) {
- _this.partsBox.reset();
- _this.partsgrid.footer.onClick('first');
- }
- });
- }
- },
- items : [
-
- ]
-
- },
- {
- '|xns' : 'Roo.Toolbar',
- xtype : 'Fill',
- xns : Roo.Toolbar
- },
- {
- '|xns' : 'Roo',
- text : "Remove",
- xtype : 'Button',
- cls : 'x-btn-text-icon',
- icon : rootURL + '/Pman/templates/images/trash.gif',
- xns : Roo,
- listeners : {
- click : function ()
- {
- var sel = _this.partsgrid.getSelectionModel().getSelectedCell();
-
- if(!sel || !sel.length){
- Roo.MessageBox.alert("Error", "Please select a item from below list");
- return;
- }
-
- var d = _this.partsgrid.ds.getAt(sel[0]);
-
- if(d.data.bomitem_id * 1 < 1){
- Roo.MessageBox.alert("Error", "Invaild selection");
- return;
- }
-
- new Pman.Request({
- url : baseURL + '/Roo/bomitem.php',
- method : 'POST',
- params : {
- _delete : d.data.bomitem_id
- },
- success : function(res) {
- _this.partsgrid.footer.onClick('first');
- }
- });
-
- }
- }
- }
- ]
-
- },
- dataSource : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/bomitem.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'bom_id',
- root : 'data',
- xtype : 'JsonReader',
- fields : [
- {
- 'name': 'bomitem_id',
- 'type': 'int'
- }
- ],
- xns : Roo.data,
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'bomitem_item_id_item_name', direction: 'ASC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- o.params = o.params || {};
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if(id < 1){
- return false;
- }
-
- o.params.bom_parent_item_id = id;
- }
- },
- items : [
-
- ]
-
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 50,
- xtype : 'PagingToolbar',
- emptyMsg : "Nothing found",
- xns : Roo,
- displayMsg : "Displaying parts {0} - {1} of {2}",
- displayInfo : true
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'bomitem_item_id_item_descrip1',
- xtype : 'EditorGrid',
- loadMask : true,
- clicksToEdit : 1,
- xns : Roo.grid,
- colModel : [
- {
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- header : 'Name',
- width : 150,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'bomitem_item_id_item_number'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- header : 'Description',
- width : 150,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'bomitem_item_id_item_descrip1'
- },
-{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- allowBlank : false,
- cls : 'align-right',
- xtype : 'NumberField',
- decimalPrecision : 0,
- xns : Roo.form,
- minValue : 0
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- align : 'right',
- header : 'Qty',
- width : 100,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'bomitem_qtyper',
- items : [
-
- ]
-
- }
- ],
- listeners : {
- beforeedit : function (e)
- {
- if(e.field != 'bomitem_qtyper'){
- return false;
- }
-
- },
- render : function()
- {
- _this.partsgrid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
- if (_this.partspanel.active) {
- this.footer.onClick('first');
- }
- },
- afteredit : function (e)
- {
- if(e.originalValue == e.value){
- return false;
- }
-
-
- new Pman.Request({
- method : 'POST',
- url : baseURL + '/Roo/bomitem.php',
- mask : 'Saving',
- params : {
- bomitem_id : e.record.data.bomitem_id,
- bomitem_qtyper : e.value
- },
- success : function() {
- e.record.set('bomitem_qtyper', e.value);
- }
-
- });
-
-
-
-
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo',
- background : true,
- region : 'center',
- fitToframe : true,
- title : "Item Parts",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'bomitem',
- listeners : {
- activate : function() {
- _this.partspanel = this;
-
- try { if (MODULE.isBuilder) {
- return;
- } } catch(e) { }
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if (id < 1) {
- Roo.MessageBox.alert("Save First", "Save the item first, before adding parts");
- _this.dialog.layout.getRegion('center').showPanel(0);
- return;
- }
-
- var type = _this.form.findField('item_type').getValue();
-
- if(!type.length || type != 'K'){
- Roo.MessageBox.alert("Error", "Can't add parts to non-kit item");
- _this.dialog.layout.getRegion('center').showPanel(0);
- return;
- }
-
- if (_this.partsgrid) {
- _this.partsgrid.footer.onClick('first');
-
- }
- }
- },
- items : [
-
- ]
-
- },
- {
- grid : {
- dataSource : {
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- fields : [
- {
- 'name': 'id',
- 'type': 'int'
- },
- {
- 'name': 'filename',
- 'type': 'string'
- },
- {
- 'name': 'ontable',
- 'type': 'string'
- },
- {
- 'name': 'onid',
- 'type': 'int'
- },
- {
- 'name': 'mimetype',
- 'type': 'string'
- },
- {
- 'name': 'width',
- 'type': 'int'
- },
- {
- 'name': 'height',
- 'type': 'int'
- },
- {
- 'name': 'filesize',
- 'type': 'int'
- },
- {
- 'name': 'displayorder',
- 'type': 'int'
- },
- {
- 'name': 'language',
- 'type': 'string'
- },
- {
- 'name': 'parent_image_id',
- 'type': 'int'
- },
- {
- 'name': 'created',
- 'type': 'date',
- 'dateFormat' : 'Y-m-d H:i:s'
- },
- {
- 'name': 'imgtype',
- 'type': 'string'
- },
- {
- 'name': 'linkurl',
- 'type': 'string'
- },
- {
- 'name': 'descript',
- 'type': 'string'
- },
- {
- 'name': 'title',
- 'type': 'string'
- }
- ],
- xns : Roo.data,
- totalProperty : 'total'
- },
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/Images.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field: 'created' , direction: 'DESC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- o.params = o.params || {};
-
- var id = _this.form.findField('item_id').getValue();
-
- if(id * 1 < 1){
- return false;
- }
-
- o.params.onid = id;
- o.params.ontable = 'item';
-
- }
- },
- items : [
-
- ]
-
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 25,
- xtype : 'PagingToolbar',
- emptyMsg : "No Images found",
- xns : Roo,
- displayInfo : true,
- displayMsg : "Displaying Images {0} - {1} of {2}"
- },
- toolbar : {
- '|xns' : 'Roo',
- xtype : 'Toolbar',
- xns : Roo,
- items : [
- {
- '|xns' : 'Roo.Toolbar',
- text : "Add",
- xtype : 'Button',
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
- xns : Roo.Toolbar,
- listeners : {
- click : function()
- {
- Pman.Dialog.Image.show({
- id : 0,
- ontable: 'item',
- onid: _this.form.findField('item_id').getValue() * 1,
- imgtype : ''
- }, function(data){
- if (!data) { return; }
- _this.grid.footer.onClick('first');
- });
-
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- text : "Delete",
- xtype : 'Button',
- cls : 'x-btn-text-icon',
- icon : rootURL + '/Pman/templates/images/trash.gif',
- xns : Roo.Toolbar,
- listeners : {
- click : function()
- {
- Pman.genericDelete(_this, 'Images');
- }
- }
- }
- ]
-
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'id',
- xtype : 'Grid',
- loadMask : true,
- xns : Roo.grid,
- colModel : [
- {
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- sortable : true,
- header : 'Created',
- width : 200,
- renderer : function(v,x,r) {
- return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
- v.format('d/M/Y'), r.data.mimetype, r.data.filename,
- r.data.width, r.data.height
- );
- },
- xns : Roo.grid,
- dataIndex : 'created'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 100,
- header : 'Image',
- renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename); },
- xns : Roo.grid,
- dataIndex : 'id'
- }
- ],
- listeners : {
- rowdblclick : function (_self, rowIndex, e)
- {
-
- var s = _self.getDataSource().getAt(rowIndex);
- new Pman.Download({
- url : baseURL + '/Images/Download/' + s.data.id
- });
-
- },
- render : function() {
- _this.grid = this;
-
- if (_this.panel.active) {
- this.footer.onClick('first');
- }
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo',
- region : 'center',
- fitToframe : true,
- background : true,
- title : "Reference Files",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'Images',
- listeners : {
- activate : function() {
- _this.panel = this;
-
- try { if (MODULE.isBuilder) {
- return;
- } } catch(e) { }
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if (id < 1) {
- Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
- _this.dialog.layout.getRegion('center').showPanel(0);
- return;
- }
-
- if (_this.grid) {
- _this.grid.footer.onClick('first');
-
- }
- }
- },
- items : [
-
- ]
-
- },
- {
- grid : {
- dataSource : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/ipshead.php',
- method : 'GET',
- xtype : 'HttpProxy',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'ipshead_id',
- root : 'data',
- xtype : 'JsonReader',
- fields : [
- {
- 'name': 'ipshead_id',
- 'type': 'int'
- },
- {
- 'name': 'ipshead_name',
- 'type': 'string'
- }
- ],
- xns : Roo.data,
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'ipshead_id', direction: 'ASC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, o)
- {
- o.params = o.params || {};
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if(id < 1){
- return false;
- }
-
- o.params._with_item = id;
- }
- },
- items : [
-
- ]
-
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 50,
- xtype : 'PagingToolbar',
- emptyMsg : "Nothing found",
- xns : Roo,
- displayMsg : "Displaying records {0} - {1} of {2}",
- displayInfo : true
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'ipshead_descrip',
- xtype : 'EditorGrid',
- loadMask : true,
- clicksToEdit : 1,
- xns : Roo.grid,
- colModel : [
- {
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 150,
- header : 'Name',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'ipshead_name'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 150,
- header : 'Description',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'ipshead_descrip'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 100,
- header : 'Currency',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'ipshead_curr_id_curr_name'
- },
-{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- xtype : 'NumberField',
- cls : 'align-right',
- decimalPrecision : 2,
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Price',
- width : 120,
- renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); },
- xns : Roo.grid,
- dataIndex : 'ipshead_ipsitem_price',
- items : [
-
- ]
-
- }
- ],
- listeners : {
- beforeedit : function (e)
- {
- if(e.field != 'ipshead_ipsitem_price'){
- return false;
- }
-
- },
- render : function()
- {
- _this.lgrid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
- if (_this.lpanel.active) {
- this.footer.onClick('first');
- }
- },
- afteredit : function (e)
- {
- if(e.originalValue == e.value){
- return false;
- }
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if(id < 1){
- return false;
- }
-
- new Pman.Request({
- method : 'POST',
- url : baseURL + '/Roo/ipsiteminfo',
- mask : 'Saving',
- params : {
- ipsitem_ipshead_id : e.record.data.ipshead_id,
- ipsitem_item_id : id,
- ipsitem_price : e.record.data.ipshead_ipsitem_price,
- ipsitem_id : e.record.data.ipshead_ipsitem_id
- }
-
- });
-
-
-
-
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo',
- region : 'center',
- fitToframe : true,
- background : true,
- title : "Price List",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'ipshead',
- listeners : {
- activate : function() {
- _this.lpanel = this;
-
- try { if (MODULE.isBuilder) {
- return;
- } } catch(e) { }
-
- var id = _this.form.findField('item_id').getValue() * 1;
- if (id < 1) {
- Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
- _this.dialog.layout.getRegion('center').showPanel(0);
- return;
- }
-
- if (_this.lgrid) {
- _this.lgrid.footer.onClick('first');
-
- }
- }
- },
- items : [
-
- ]
-
- },
- {
- grid : {
- dataSource : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/itemsrc.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [
- {
- 'name': 'itemsrc_id',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_item_id',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_item_id',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_vend_id',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_vend_id',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_vend_item_number',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_vend_item_descrip',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_comments',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_vend_uom',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_invvendoruomratio',
- 'type': 'float'
- },
- {
- 'name': 'itemsrc_minordqty',
- 'type': 'float'
- },
- {
- 'name': 'itemsrc_multordqty',
- 'type': 'float'
- },
- {
- 'name': 'itemsrc_leadtime',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_ranking',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_active',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_manuf_name',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_manuf_item_number',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_manuf_item_descrip',
- 'type': 'string'
- },
- {
- 'name': 'itemsrc_default',
- 'type': 'int'
- },
- {
- 'name': 'itemsrc_upccode',
- 'type': 'string'
- }
- ],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'itemsrc_vend_id_vend_name', direction: 'ASC' },
- xns : Roo.data,
- listeners : {
- update : function (_self, record, operation)
- {
- Roo.log(operation);
- Roo.log(record);
-
- if (operation != 'commit') {
- return;
- }
- if (record.data.itemsrc_vend_id * 1 < 1) {
- return; // do not save.
- }
- if (record.data.itemsrc_id * 1 < 0) {
- return; // do not save. -- updating at present...
- }
-
- var p = Roo.apply({}, record.data);
- record.set('itemsrc_id', -1);
-
- new Pman.Request({
- url : baseURL + '/Roo/Itemsrc',
- params : p,
- method : 'POST',
- success: function(res) {
- if (record.data.itemsrc_id *1 < 1) {
- record.set('itemsrc_id', res.data.itemsrc_id);
- }
- }
- });
-
-
- },
- beforeload : function (_self, o)
- {
-
- var id = 1 * _this.form.findField('item_id').getValue();
- if (!id) {
- this.removeAll();
- return false;
- }
- o.params.itemsrc_item_id = id;
- }
- },
- items : [
-
- ]
-
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 25,
- xtype : 'PagingToolbar',
- emptyMsg : "No itemsrc found",
- xns : Roo,
- displayInfo : true,
- displayMsg : "Displaying itemsrc{0} - {1} of {2}"
- },
- toolbar : {
- '|xns' : 'Roo',
- xtype : 'Toolbar',
- xns : Roo,
- items : [
- {
- '|xns' : 'Roo.Toolbar',
- text : "Add",
- xtype : 'Button',
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
- xns : Roo.Toolbar,
- listeners : {
- click : function()
- {
-
- Roo.log("add presed");
-
- // work out last
- var grid = _this.itemsrcgrid;
-
- // uses form defaults or last row value.
- var nr = grid.ds.reader.newRow({
- itemsrc_id : 0,
- itemsrc_item_id : _this.form.findField('item_id').getValue(),
-
- itemsrc_vend_id : 0,
- itemsrc_vend_item_number : '',
- itemsrc_vend_item_descrip : '',
- itemsrc_comments : '',
- itemsrc_vend_uom : 'EA',
- itemsrc_invvendoruomratio : 1.0,
- itemsrc_minordqty : 0,
- itemsrc_multordqty : 0,
- itemsrc_leadtime : 30,
- itemsrc_ranking : 0,
- itemsrc_active : true,
- itemsrc_manuf_name : '',
- itemsrc_manuf_item_number : '',
- itemsrc_manuf_item_descrip: '',
- itemsrc_default : true,
- itemsrc_upccode : ''
-
- });
- grid.stopEditing();
- grid.ds.insert(0, nr);
- grid.startEditing(0, 0); // type..
-
- }
- }
- }
- ]
-
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'itemsrc_comments',
- xtype : 'EditorGrid',
- loadMask : true,
- clicksToEdit : 1,
- xns : Roo.grid,
- colModel : [
- {
- editor : {
- field : {
- store : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/vendinfo.php',
- xtype : 'HttpProxy',
- method : 'GET',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- xns : Roo.data,
- fields : [{"name":"id","type":"int"},{"name":"vend_name","type":"string"}],
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- xns : Roo.data,
- sortInfo : { direction : 'ASC', field: 'id' },
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.form',
- listWidth : 400,
- triggerAction : 'all',
- forceSelection : true,
- selectOnFocus : true,
- pageSize : 20,
- displayField : 'vend_name',
- emptyText : "Select Vendor",
- hiddenName : 'itemsrc_vend_id',
- minChars : 2,
- valueField : 'vend_id',
- xtype : 'ComboBox',
- allowBlank : false,
- typeAhead : true,
- editable : true,
- width : 300,
- xns : Roo.form,
- name : 'itemsrc_vend_id_vend_name',
- qtip : "Select vendinfo",
- queryParam : 'q[search]',
- tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>',
- loadingText : "Searching...",
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 120,
- header : 'Vendor',
- renderer : function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_vend_id',
- items : [
-
- ]
-
- },
-{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- xtype : 'TextField',
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 100,
- header : 'Vendor Ref#',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_vend_item_number',
- items : [
-
- ]
-
- },
-{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- xtype : 'TextField',
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 200,
- header : 'Comments',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_comments',
- items : [
-
- ]
-
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 50,
- header : 'UOM',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_vend_uom'
- },
-{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- minValue : 0,
- xtype : 'NumberField',
- decimalPrecision : 0,
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Min Qty',
- width : 50,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_minordqty',
- items : [
-
- ]
-
- },
-{
- editor : {
- field : {
- '|xns' : 'Roo.form',
- minValue : 0,
- xtype : 'NumberField',
- decimalPrecision : 0,
- xns : Roo.form
- },
- '|xns' : 'Roo.grid',
- xtype : 'GridEditor',
- xns : Roo.grid,
- items : [
-
- ]
-
- },
- '|xns' : 'Roo.grid',
- align : 'right',
- xtype : 'ColumnModel',
- header : 'Lead time',
- width : 75,
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_leadtime',
- items : [
-
- ]
-
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 50,
- header : 'Active',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'itemsrc_active'
- }
- ],
- listeners : {
- rowdblclick : function (_self, rowIndex, e)
- {
- if (!_this.dialog) return;
- _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
- _this.grid.footer.onClick('first');
- });
- },
- render : function()
- {
- _this.itemsrcgrid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
-
- },
- afteredit : function (e)
- {
- e.record.commit();
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo',
- region : 'center',
- fitToframe : true,
- background : true,
- title : "Suppliers",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'itemsrc',
- listeners : {
- activate : function() {
- _this.itemsrcpanel = this;
- if (_this.itemsrcgrid) {
- _this.itemsrcgrid.footer.onClick('first');
- }
- }
- },
- items : [
-
- ]
-
- },
- {
- grid : {
- dataSource : {
- proxy : {
- '|xns' : 'Roo.data',
- url : baseURL + '/Roo/events.php',
- method : 'GET',
- xtype : 'HttpProxy',
- xns : Roo.data
- },
- reader : {
- '|xns' : 'Roo.data',
- id : 'id',
- root : 'data',
- xtype : 'JsonReader',
- fields : [
- {
- 'name': 'event_when',
- 'type': 'date'
- },
- {
- 'name': 'action',
- 'type': 'string'
- },
- {
- 'name': 'ipaddr',
- 'type': 'string'
- },
- {
- 'name': 'person_id_name',
- 'type': 'string'
- },
- {
- 'name': 'remarks',
- 'type': 'string'
- }
- ],
- xns : Roo.data,
- totalProperty : 'total'
- },
- '|xns' : 'Roo.data',
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { field : 'event_when', direction: 'DESC' },
- xns : Roo.data,
- listeners : {
- beforeload : function (_self, options)
- {
- options.params = options.params || {};
-
- options.params.on_table = 'item';
- options.params.on_id = _this.form.findField('item_id').getValue();
- }
- },
- items : [
-
- ]
-
- },
- footer : {
- '|xns' : 'Roo',
- pageSize : 25,
- xtype : 'PagingToolbar',
- emptyMsg : "No Events found",
- xns : Roo,
- displayMsg : "Displaying events{0} - {1} of {2}",
- displayInfo : true
- },
- '|xns' : 'Roo.grid',
- autoExpandColumn : 'remarks',
- xtype : 'Grid',
- loadMask : true,
- xns : Roo.grid,
- colModel : [
- {
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 120,
- header : 'Changed',
- renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
- xns : Roo.grid,
- dataIndex : 'event_when'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 200,
- header : 'Action',
- renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); },
- xns : Roo.grid,
- dataIndex : 'action'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 200,
- header : 'IP Address',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'ipaddr'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 75,
- header : 'Who',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'person_id_name'
- },
-{
- '|xns' : 'Roo.grid',
- xtype : 'ColumnModel',
- width : 200,
- header : 'Notes',
- renderer : function(v) { return String.format('{0}', v); },
- xns : Roo.grid,
- dataIndex : 'remarks'
- }
- ],
- listeners : {
- render : function()
- {
- _this.hgrid = this;
- if (_this.hpanel.active) {
- this.footer.onClick('first');
- }
- }
- },
- items : [
-
- ]
-
- },
- '|xns' : 'Roo',
- region : 'center',
- fitToframe : true,
- background : true,
- title : "History",
- xtype : 'GridPanel',
- fitContainer : true,
- xns : Roo,
- tableName : 'events',
- listeners : {
- activate : function() {
- _this.hpanel = this;
- if (_this.hgrid) {
- _this.hgrid.footer.onClick('first');
- }
- }
- },
- items : [
-
- ]
-
- }
+ store : {
+ data : [
+ [ 'P', "Purchased (eg. a standard product)"],
+ [ 'R' , "Reference (Non-Product)"],
+ [ 'K', "Kit (made up of products)"]
+ ],
+ fields : [ 'ftype', 'fname'],
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'SimpleStore'
+ }
+ },
+ {
+ allowBlank : false,
+ displayField : 'classcode_code',
+ editable : false,
+ emptyText : _this._strings['69395719de41dd8a31905b1e94c91816'] /* Select classcode */,
+ fieldLabel : _this._strings['9bd81329febf6efe22788e03ddeaf0af'] /* Class */,
+ forceSelection : true,
+ hiddenName : 'item_classcode_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'item_classcode_id_classcode_code',
+ pageSize : 20,
+ qtip : _this._strings['69395719de41dd8a31905b1e94c91816'] /* Select classcode */,
+ queryParam : '',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'classcode_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/classcode.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"id","type":"int"},{"name":"classcode_code","type":"string"}],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ allowBlank : false,
+ displayField : 'uom_descrip',
+ editable : false,
+ emptyText : _this._strings['f9838de820f2a2e16241033270c68e29'] /* Select uom */,
+ fieldLabel : _this._strings['92b17d3d0f13232ec1d46844c836d4db'] /* Invoice UOM */,
+ forceSelection : true,
+ hiddenName : 'item_inv_uom_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'item_inv_uom_id_uom_descrip',
+ pageSize : 20,
+ qtip : _this._strings['69395719de41dd8a31905b1e94c91816'] /* Select classcode */,
+ queryParam : '',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'uom_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'uom_name' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/uom.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {"name":"id","type":"int"},
+ {"name":"uom_name","type":"string"},
+ {"name":"uom_descrip","type":"string"},
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ allowBlank : false,
+ displayField : 'uom_descrip',
+ editable : false,
+ emptyText : _this._strings['f9838de820f2a2e16241033270c68e29'] /* Select uom */,
+ fieldLabel : _this._strings['14fc4f0a5008e1d8d5645071755c596b'] /* Price UOM */,
+ forceSelection : true,
+ hiddenName : 'item_price_uom_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'item_price_uom_id_uom_descrip',
+ pageSize : 20,
+ qtip : _this._strings['69395719de41dd8a31905b1e94c91816'] /* Select classcode */,
+ queryParam : '',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{uom_descrip}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'uom_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'uom_name' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/uom.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {"name":"id","type":"int"},
+ {"name":"uom_name","type":"string"},
+ {"name":"uom_descrip","type":"string"},
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ allowBlank : false,
+ allowDecimals : true,
+ decimalPrecision : 2,
+ fieldLabel : _this._strings['8c489d0946f66d17d73f26366a4bf620'] /* Weight */,
+ name : 'item_prodweight',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ },
+ {
+ fieldLabel : _this._strings['9d98e31f261471f426e906282544c15d'] /* Item comments */,
+ height : 100,
+ name : 'item_comments',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextArea'
+ },
+ {
+ fieldLabel : _this._strings['c96bc98500430b5eb8e9cfc5959e09b5'] /* Item sold */,
+ inputValue : true,
+ name : 'item_sold',
+ valueOff : 0,
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ fieldLabel : _this._strings['c056b1456660ea65aad6dfc664002b84'] /* Item active */,
+ inputValue : true,
+ name : 'item_active',
+ valueOff : 0,
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ allowBlank : false,
+ alwaysQuery : true,
+ displayField : 'prodcat_code',
+ editable : false,
+ emptyText : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
+ fieldLabel : _this._strings['10991ea03e3591bebc4c0827fc369540'] /* Product Category */,
+ forceSelection : true,
+ hiddenName : 'item_prodcat_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'item_prodcat_id_prodcat_code',
+ pageSize : 20,
+ qtip : _this._strings['df2ad52a14d681b1cd8495f8650fdb56'] /* Select prodcat */,
+ queryParam : '',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'prodcat_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ listeners : {
+ add : function (combo)
+ {
+ Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});
+ },
+ edit : function (combo, record)
+ {
+ var s = _this.form.findField('item_prodcat_id').getValue() * 1;
+ if(s < 1){
+ Roo.MessageBox.alert('Error','Please select a account assignment');
+ return;
+ }
+ Pman.Dialog.XtupleProdcat.show({prodcat_id : s});
+ }
+ },
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/prodcat.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"id","type":"int"},{"name":"prodcat_code","type":"string"}],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ fieldLabel : _this._strings['e54f1b41d200adbd96eb53634388d780'] /* Sales Account */,
+ name : 'item_salesaccnt',
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'DisplayField'
+ },
+ {
+ fieldLabel : _this._strings['148cb4c3e6469c6a92d24951485b65ff'] /* Item listprice */,
+ name : 'item_listprice',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ },
+ {
+ legend : _this._strings['0d122b17933ab4173e9d75d55fc5e764'] /* Standard Cost */,
+ style : 'width:320px',
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'FieldSet',
+ listeners : {
+ render : function (_self)
+ {
+ _this.standardCostFieldSet = _self;
+ }
+ },
+ items : [
+ {
+ allowBlank : false,
+ displayField : 'curr_name',
+ editable : false,
+ emptyText : _this._strings['e8586011952b0d098b0e568f20ca2b1f'] /* Select Currency */,
+ fieldLabel : _this._strings['386c339d37e737a436499d423a77df0c'] /* Currency */,
+ forceSelection : true,
+ hiddenName : 'item_itemcost_id_itemcost_curr_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'curr_name',
+ pageSize : 20,
+ qtip : _this._strings['e8586011952b0d098b0e568f20ca2b1f'] /* Select Currency */,
+ queryParam : 'query[curr_name]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'curr_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'curr_symbol' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/curr_symbol.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"curr_id","type":"int"},"curr_symbol"],
+ id : 'curr_id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ allowBlank : false,
+ fieldLabel : _this._strings['689202409e48743b914713f96d93947c'] /* Value */,
+ name : 'item_itemcost_id_itemcost_actcost',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ }
]
-
- });
- }
+ }
+ ]
+ },
+ {
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Column',
+ items : [
+ {
+ labelWidth : 120,
+ legend : _this._strings['20f39d1311ccbd3b7e61cdd4978719f9'] /* Itemsite Settings */,
+ style : 'width:335px;',
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'FieldSet',
+ listeners : {
+ render : function (_self)
+ {
+ _this.itemsiteFieldSet = _self;
+ }
+ },
+ items : [
+ {
+ allowBlank : false,
+ fieldLabel : _this._strings['43b2683180fe5e67a91696c834df0a32'] /* Reorder Level */,
+ name : 'item_itemsite_id_itemsite_reorderlevel',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ },
+ {
+ allowBlank : false,
+ fieldLabel : _this._strings['eccd13e2f1acfd6b8412a2caafa37a80'] /* Stock Safety Level */,
+ name : 'item_itemsite_id_itemsite_safetystock',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ },
+ {
+ allowBlank : false,
+ fieldLabel : _this._strings['6abc7326bcd435c1eb22ad3714db48c4'] /* Lead time (Days) */,
+ name : 'item_itemsite_id_itemsite_leadtime',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ },
+ {
+ allowBlank : false,
+ displayField : 'fname',
+ editable : false,
+ fieldLabel : _this._strings['2ea154449c00001e87af8df7c0728678'] /* Control Method */,
+ hiddenName : 'item_itemsite_id_itemsite_controlmethod',
+ listWidth : 200,
+ mode : 'local',
+ name : 'item_itemsite_id_itemsite_controlmethod_name',
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
+ triggerAction : 'all',
+ valueField : 'ftype',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ data : [
+ [ 'N', "None"],
+ [ 'R' , "Regular"]
+ ],
+ fields : [ 'ftype', 'fname'],
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'SimpleStore'
+ }
+ },
+ {
+ allowBlank : false,
+ displayField : 'plancode_name',
+ editable : false,
+ emptyText : _this._strings['c19ea8f7a11074ac743c58d34830b233'] /* Select plancode */,
+ fieldLabel : _this._strings['f9c68217f6ef9a9afe7575e766bd7b9f'] /* Planner Code */,
+ forceSelection : true,
+ hiddenName : 'item_itemsite_id_itemsite_plancode_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'plancode_name',
+ pageSize : 20,
+ qtip : _this._strings['c19ea8f7a11074ac743c58d34830b233'] /* Select plancode */,
+ queryParam : '',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'plancode_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/plancode.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"id","type":"int"},{"name":"plancode_code","type":"string"}],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ allowBlank : false,
+ displayField : 'costcat_code',
+ editable : false,
+ emptyText : _this._strings['045a1ac263ac3a9b7420208bdc2df423'] /* Select costcat */,
+ fieldLabel : _this._strings['5aa275a71868f3afcacfd6de452b07eb'] /* Costcat */,
+ forceSelection : true,
+ hiddenName : 'item_itemsite_id_itemsite_costcat_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'costcat_code',
+ pageSize : 20,
+ qtip : _this._strings['045a1ac263ac3a9b7420208bdc2df423'] /* Select costcat */,
+ queryParam : '',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'costcat_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/costcat.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"id","type":"int"},{"name":"costcat_code","type":"string"}],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ fieldLabel : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
+ inputValue : true,
+ name : 'item_itemsite_id_itemsite_active',
+ valueOff : 0,
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ fieldLabel : _this._strings['d85a8a381c36f6dde21d81542830e2b1'] /* Sold */,
+ inputValue : true,
+ name : 'item_itemsite_id_itemsite_sold',
+ valueOff : 0,
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ fieldLabel : _this._strings['fce71ab09b7795157c6e23370b4afb26'] /* Stocked */,
+ inputValue : true,
+ name : 'item_itemsite_id_itemsite_stocked',
+ valueOff : 0,
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ fieldLabel : _this._strings['390fc24b0feebfff8c3fb8625418c2e9'] /* Perishable */,
+ inputValue : true,
+ name : 'item_itemsite_id_itemsite_perishable',
+ valueOff : 0,
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ fieldLabel : _this._strings['e1a8f447925ed2867c591aa0865d170e'] /* Multi Location */,
+ inputValue : true,
+ name : 'item_itemsite_id_itemsite_loccntrl',
+ valueOff : 0,
+ width : 100,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Checkbox'
+ },
+ {
+ allowBlank : false,
+ displayField : 'location_name',
+ editable : true,
+ emptyText : _this._strings['82a43f89af6d331d80d441624c5c71fa'] /* Default Location */,
+ fieldLabel : _this._strings['82a43f89af6d331d80d441624c5c71fa'] /* Default Location */,
+ forceSelection : true,
+ hiddenName : 'item_itemsite_id_itemsite_location_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'location_name',
+ pageSize : 200,
+ qtip : _this._strings['151ccf95db9b81c11bb20fbc302af4b6'] /* Select terms */,
+ queryParam : 'query[location_name]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : false,
+ valueField : 'location_id',
+ width : 200,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'location_name' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ o.params.location_netable = 1;
+ o.params._notinternalcompany = 1;
+ o.params.location_restrict = 0;
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/location.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"location_id","type":"int"},"location_name"],
+ id : 'location_id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ name : 'item_id',
+ width : 75,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'Hidden'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'bomitem',
+ title : _this._strings['538a3c9d82a4ea4250b987a357d41184'] /* Item Parts */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.partspanel = this;
+
+ try { if (MODULE.isBuilder) {
+ return;
+ } } catch(e) { }
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if (id < 1) {
+ Roo.MessageBox.alert("Save First", "Save the item first, before adding parts");
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ return;
+ }
+
+ var type = _this.form.findField('item_type').getValue();
+
+ if(!type.length || type != 'K'){
+ Roo.MessageBox.alert("Error", "Can't add parts to non-kit item");
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ return;
+ }
+
+ if (_this.partsgrid) {
+ _this.partsgrid.footer.onClick('first');
+
+ }
+ }
+ },
+ grid : {
+ autoExpandColumn : 'bomitem_item_id_item_descrip1',
+ clicksToEdit : 1,
+ loadMask : true,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'EditorGrid',
+ listeners : {
+ afteredit : function (e)
+ {
+ if(e.originalValue == e.value){
+ return false;
+ }
+
+
+ new Pman.Request({
+ method : 'POST',
+ url : baseURL + '/Roo/bomitem.php',
+ mask : 'Saving',
+ params : {
+ bomitem_id : e.record.data.bomitem_id,
+ bomitem_qtyper : e.value
+ },
+ success : function() {
+ e.record.set('bomitem_qtyper', e.value);
+ }
+
+ });
+
+
+
+
+ },
+ beforeedit : function (e)
+ {
+ if(e.field != 'bomitem_qtyper'){
+ return false;
+ }
+
+ },
+ render : function()
+ {
+ _this.partsgrid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+ if (_this.partspanel.active) {
+ this.footer.onClick('first');
+ }
+ }
+ },
+ footer : {
+ displayInfo : true,
+ displayMsg : _this._strings['76d5bf9597c882d6513f71759df298d5'] /* Displaying parts {0} - {1} of {2} */,
+ emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'] /* Nothing found */,
+ pageSize : 50,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'PagingToolbar'
+ },
+ toolbar : {
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Toolbar',
+ items : [
+ {
+ allowBlank : true,
+ alwaysQuery : true,
+ displayField : 'item_number',
+ editable : true,
+ emptyText : _this._strings['786410e93beb0193d89f8608c54feb4b'] /* Select item */,
+ fieldLabel : _this._strings['7d74f3b92b19da5e606d737d339a9679'] /* Item */,
+ forceSelection : true,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ pageSize : 20,
+ qtip : _this._strings['786410e93beb0193d89f8608c54feb4b'] /* Select item */,
+ queryParam : 'query[number_or_name]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{item_number}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'id',
+ width : 200,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ xtype : 'ComboBox',
+ listeners : {
+ render : function (_self)
+ {
+ _this.partsBox = _self;
+ },
+ select : function (combo, record, index)
+ {
+ var item_id = _this.form.findField('item_id').getValue() * 1;
+
+ if(typeof(record) == 'undefined' || !record || record.data.id * 1 < 1 || item_id < 1){
+ return;
+ }
+
+ var err = false;
+
+ _this.partsgrid.ds.each(function(d){
+ if(record.data.item_id == d.data.bomitem_item_id){
+ err = true;
+ }
+ });
+
+ if(err){
+ Roo.MessageBox.alert('Error', record.data.item_number + ' already exists!');
+ _this.partsBox.reset();
+ return;
+ }
+
+ new Pman.Request({
+ url : baseURL + '/Roo/bomitem.php',
+ method : 'POST',
+ params : {
+ bomitem_parent_item_id : item_id,
+ bomitem_item_id : record.data.item_id,
+ bomitem_qtyper : 1
+ },
+ success : function(res) {
+ _this.partsBox.reset();
+ _this.partsgrid.footer.onClick('first');
+ }
+ });
+ }
+ },
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'item_number' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+
+ o.params.item_active = 1;
+ o.params['!item_type'] = 'K';
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/item.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {"name":"id","type":"int"},
+ {"name":"item_number","type":"string"}
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ },
+ {
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Fill'
+ },
+ {
+ cls : 'x-btn-text-icon',
+ icon : rootURL + '/Pman/templates/images/trash.gif',
+ text : _this._strings['1063e38cb53d94d386f21227fcd84717'] /* Remove */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Button',
+ listeners : {
+ click : function ()
+ {
+ var sel = _this.partsgrid.getSelectionModel().getSelectedCell();
+
+ if(!sel || !sel.length){
+ Roo.MessageBox.alert("Error", "Please select a item from below list");
+ return;
+ }
+
+ var d = _this.partsgrid.ds.getAt(sel[0]);
+
+ if(d.data.bomitem_id * 1 < 1){
+ Roo.MessageBox.alert("Error", "Invaild selection");
+ return;
+ }
+
+ new Pman.Request({
+ url : baseURL + '/Roo/bomitem.php',
+ method : 'POST',
+ params : {
+ _delete : d.data.bomitem_id
+ },
+ success : function(res) {
+ _this.partsgrid.footer.onClick('first');
+ }
+ });
+
+ }
+ }
+ }
+ ]
+ },
+ dataSource : {
+ remoteSort : true,
+ sortInfo : { field : 'bomitem_item_id_item_name', direction: 'ASC' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if(id < 1){
+ return false;
+ }
+
+ o.params.bom_parent_item_id = id;
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/bomitem.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {
+ 'name': 'bomitem_id',
+ 'type': 'int'
+ }
+ ],
+ id : 'bom_id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ },
+ colModel : [
+ {
+ dataIndex : 'bomitem_item_id_item_number',
+ header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 150,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'bomitem_item_id_item_descrip1',
+ header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 150,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ align : 'right',
+ dataIndex : 'bomitem_qtyper',
+ header : _this._strings['03ab340b3f99e03cff9e84314ead38c0'] /* Qty */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 100,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ allowBlank : false,
+ cls : 'align-right',
+ decimalPrecision : 0,
+ minValue : 0,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'Images',
+ title : _this._strings['346577d22bb510368e3eddab5df2ca13'] /* Reference Files */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.panel = this;
+
+ try { if (MODULE.isBuilder) {
+ return;
+ } } catch(e) { }
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if (id < 1) {
+ Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ return;
+ }
+
+ if (_this.grid) {
+ _this.grid.footer.onClick('first');
+
+ }
+ }
+ },
+ grid : {
+ autoExpandColumn : 'id',
+ loadMask : true,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'Grid',
+ listeners : {
+ render : function() {
+ _this.grid = this;
+
+ if (_this.panel.active) {
+ this.footer.onClick('first');
+ }
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+
+ var s = _self.getDataSource().getAt(rowIndex);
+ new Pman.Download({
+ url : baseURL + '/Images/Download/' + s.data.id
+ });
+
+ }
+ },
+ footer : {
+ displayInfo : true,
+ displayMsg : _this._strings['c0ed345ec857c06b31f7e88745c9bc40'] /* Displaying Images {0} - {1} of {2} */,
+ emptyMsg : _this._strings['0c81971f67c0bd4b33799c5365ec2bf5'] /* No Images found */,
+ pageSize : 25,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'PagingToolbar'
+ },
+ toolbar : {
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Toolbar',
+ items : [
+ {
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+ text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+ Pman.Dialog.Image.show({
+ id : 0,
+ ontable: 'item',
+ onid: _this.form.findField('item_id').getValue() * 1,
+ imgtype : ''
+ }, function(data){
+ if (!data) { return; }
+ _this.grid.footer.onClick('first');
+ });
+
+ }
+ }
+ },
+ {
+ cls : 'x-btn-text-icon',
+ icon : rootURL + '/Pman/templates/images/trash.gif',
+ text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+ Pman.genericDelete(_this, 'Images');
+ }
+ }
+ }
+ ]
+ },
+ dataSource : {
+ remoteSort : true,
+ sortInfo : { field: 'created' , direction: 'DESC' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+
+ var id = _this.form.findField('item_id').getValue();
+
+ if(id * 1 < 1){
+ return false;
+ }
+
+ o.params.onid = id;
+ o.params.ontable = 'item';
+
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/Images.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'filename',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ontable',
+ 'type': 'string'
+ },
+ {
+ 'name': 'onid',
+ 'type': 'int'
+ },
+ {
+ 'name': 'mimetype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'width',
+ 'type': 'int'
+ },
+ {
+ 'name': 'height',
+ 'type': 'int'
+ },
+ {
+ 'name': 'filesize',
+ 'type': 'int'
+ },
+ {
+ 'name': 'displayorder',
+ 'type': 'int'
+ },
+ {
+ 'name': 'language',
+ 'type': 'string'
+ },
+ {
+ 'name': 'parent_image_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'created',
+ 'type': 'date',
+ 'dateFormat' : 'Y-m-d H:i:s'
+ },
+ {
+ 'name': 'imgtype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'linkurl',
+ 'type': 'string'
+ },
+ {
+ 'name': 'descript',
+ 'type': 'string'
+ },
+ {
+ 'name': 'title',
+ 'type': 'string'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ },
+ colModel : [
+ {
+ dataIndex : 'created',
+ header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'] /* Created */,
+ renderer : function(v,x,r) {
+ return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
+ v.format('d/M/Y'), r.data.mimetype, r.data.filename,
+ r.data.width, r.data.height
+ );
+ },
+ sortable : true,
+ width : 200,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'id',
+ header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
+ renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename); },
+ width : 100,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ }
+ ]
+ }
+ },
+ {
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'ipshead',
+ title : _this._strings['1656a671ba692e15836cd85df374556c'] /* Price List */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.lpanel = this;
+
+ try { if (MODULE.isBuilder) {
+ return;
+ } } catch(e) { }
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if (id < 1) {
+ Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ return;
+ }
+
+ if (_this.lgrid) {
+ _this.lgrid.footer.onClick('first');
+
+ }
+ }
+ },
+ grid : {
+ autoExpandColumn : 'ipshead_descrip',
+ clicksToEdit : 1,
+ loadMask : true,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'EditorGrid',
+ listeners : {
+ afteredit : function (e)
+ {
+ if(e.originalValue == e.value){
+ return false;
+ }
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if(id < 1){
+ return false;
+ }
+
+ new Pman.Request({
+ method : 'POST',
+ url : baseURL + '/Roo/ipsiteminfo',
+ mask : 'Saving',
+ params : {
+ ipsitem_ipshead_id : e.record.data.ipshead_id,
+ ipsitem_item_id : id,
+ ipsitem_price : e.record.data.ipshead_ipsitem_price,
+ ipsitem_id : e.record.data.ipshead_ipsitem_id
+ }
+
+ });
+
+
+
+
+ },
+ beforeedit : function (e)
+ {
+ if(e.field != 'ipshead_ipsitem_price'){
+ return false;
+ }
+
+ },
+ render : function()
+ {
+ _this.lgrid = this;
+ //_this.dialog = Pman.Dialog.FILL_IN
+ if (_this.lpanel.active) {
+ this.footer.onClick('first');
+ }
+ }
+ },
+ footer : {
+ displayInfo : true,
+ displayMsg : _this._strings['956e816fa19ca04485c7101adbe07762'] /* Displaying records {0} - {1} of {2} */,
+ emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'] /* Nothing found */,
+ pageSize : 50,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'PagingToolbar'
+ },
+ dataSource : {
+ remoteSort : true,
+ sortInfo : { field : 'ipshead_id', direction: 'ASC' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if(id < 1){
+ return false;
+ }
+
+ o.params._with_item = id;
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/ipshead.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {
+ 'name': 'ipshead_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'ipshead_name',
+ 'type': 'string'
+ }
+ ],
+ id : 'ipshead_id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ },
+ colModel : [
+ {
+ dataIndex : 'ipshead_name',
+ header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 150,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'ipshead_descrip',
+ header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 150,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'ipshead_curr_id_curr_name',
+ header : _this._strings['386c339d37e737a436499d423a77df0c'] /* Currency */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 100,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ align : 'right',
+ dataIndex : 'ipshead_ipsitem_price',
+ header : _this._strings['3601146c4e948c32b6424d2c0a7f0118'] /* Price */,
+ renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); },
+ width : 120,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ cls : 'align-right',
+ decimalPrecision : 2,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'itemsrc',
+ title : _this._strings['1814d65a76028fdfbadab64a5a8076df'] /* Suppliers */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.itemsrcpanel = this;
+
+ try { if (MODULE.isBuilder) {
+ return;
+ } } catch(e) { }
+
+ var id = _this.form.findField('item_id').getValue() * 1;
+ if (id < 1) {
+ Roo.MessageBox.alert("Save First", "Save the item first, before adding suppliers");
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ return false;
+ }
+
+ var type = _this.form.findField('item_type').getValue();
+
+ if(type == 'K'){
+ Roo.MessageBox.alert("Error", "Can't add suppliers to kit item");
+ _this.dialog.layout.getRegion('center').showPanel(0);
+ return false;
+ }
+
+ if (_this.itemsrcgrid) {
+ _this.itemsrcgrid.footer.onClick('first');
+ }
+ }
+ },
+ grid : {
+ autoExpandColumn : 'itemsrc_comments',
+ clicksToEdit : 1,
+ loadMask : true,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'EditorGrid',
+ listeners : {
+ afteredit : function (e)
+ {
+ e.record.commit();
+ },
+ render : function()
+ {
+ _this.itemsrcgrid = this;
+
+ if (_this.itemsrcpanel.active) {
+ this.footer.onClick('first');
+ }
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ if (!_this.dialog) return;
+ _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ },
+ footer : {
+ displayInfo : true,
+ displayMsg : _this._strings['7f841b4d2f7280eb82318988c6d649d1'] /* Displaying itemsrc{0} - {1} of {2} */,
+ emptyMsg : _this._strings['19df363d15888baa395364fbcd230c05'] /* No itemsrc found */,
+ pageSize : 25,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'PagingToolbar'
+ },
+ toolbar : {
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Toolbar',
+ items : [
+ {
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+ text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+
+ Roo.log("add presed");
+
+ // work out last
+ var grid = _this.itemsrcgrid;
+
+ // uses form defaults or last row value.
+ var nr = grid.ds.reader.newRow({
+ itemsrc_id : 0,
+ itemsrc_item_id : _this.form.findField('item_id').getValue(),
+ itemsrc_vend_id : 0,
+ itemsrc_vend_id_vend_name : '',
+ itemsrc_vend_item_number : '',
+ itemsrc_vend_item_descrip : '',
+ itemsrc_comments : '',
+ itemsrc_vend_uom : 'EA',
+ itemsrc_invvendoruomratio : 1.0,
+ itemsrc_minordqty : 0,
+ itemsrc_multordqty : 0,
+ itemsrc_leadtime : 30,
+ itemsrc_ranking : 0,
+ itemsrc_active : true,
+ itemsrc_manuf_name : '',
+ itemsrc_manuf_item_number : '',
+ itemsrc_manuf_item_descrip: '',
+ itemsrc_default : true,
+ itemsrc_upccode : ''
+
+ });
+ grid.stopEditing();
+ grid.ds.insert(0, nr);
+ grid.startEditing(0, 0); // type..
+
+ }
+ }
+ }
+ ]
+ },
+ dataSource : {
+ remoteSort : true,
+ sortInfo : { field : 'itemsrc_vend_id_vend_name', direction: 'ASC' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o)
+ {
+
+ var id = 1 * _this.form.findField('item_id').getValue();
+ if (!id) {
+ this.removeAll();
+ return false;
+ }
+ o.params.itemsrc_item_id = id;
+ },
+ update : function (_self, record, operation)
+ {
+ Roo.log(operation);
+ Roo.log(record);
+
+ if (operation != 'commit') {
+ return;
+ }
+ if (record.data.itemsrc_vend_id * 1 < 1) {
+ return; // do not save.
+ }
+ if (record.data.itemsrc_id * 1 < 0) {
+ return; // do not save. -- updating at present...
+ }
+
+ var p = Roo.apply({}, record.data);
+ record.set('itemsrc_id', -1);
+
+ new Pman.Request({
+ url : baseURL + '/Roo/Itemsrc',
+ params : p,
+ method : 'POST',
+ success: function(res) {
+ if (record.data.itemsrc_id *1 < 1) {
+ record.set('itemsrc_id', res.data.itemsrc_id);
+ }
+ }
+ });
+
+
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/itemsrc.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {
+ 'name': 'itemsrc_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_item_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_item_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_vend_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_vend_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_vend_item_number',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_vend_item_descrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_comments',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_vend_uom',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_invvendoruomratio',
+ 'type': 'float'
+ },
+ {
+ 'name': 'itemsrc_minordqty',
+ 'type': 'float'
+ },
+ {
+ 'name': 'itemsrc_multordqty',
+ 'type': 'float'
+ },
+ {
+ 'name': 'itemsrc_leadtime',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_ranking',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_manuf_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_manuf_item_number',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_manuf_item_descrip',
+ 'type': 'string'
+ },
+ {
+ 'name': 'itemsrc_default',
+ 'type': 'int'
+ },
+ {
+ 'name': 'itemsrc_upccode',
+ 'type': 'string'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ },
+ colModel : [
+ {
+ dataIndex : 'itemsrc_vend_id',
+ header : _this._strings['ec9ceefe0c19f4c029008c23e3c947b7'] /* Vendor */,
+ renderer : function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); },
+ width : 120,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ allowBlank : false,
+ displayField : 'vend_name',
+ editable : true,
+ emptyText : _this._strings['7996af9149ed376ce252e35c4da7146b'] /* Select Vendor */,
+ forceSelection : true,
+ hiddenName : 'itemsrc_vend_id',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
+ minChars : 2,
+ name : 'itemsrc_vend_id_vend_name',
+ pageSize : 20,
+ qtip : _this._strings['dd24f967299e81b9603cb071693d5c32'] /* Select vendinfo */,
+ queryParam : 'q[search]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'vend_id',
+ width : 300,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'ComboBox',
+ store : {
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'id' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/vendinfo.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [{"name":"id","type":"int"},{"name":"vend_name","type":"string"}],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ }
+ }
+ },
+ {
+ dataIndex : 'itemsrc_vend_item_number',
+ header : _this._strings['e5353fc67b122d1b42181073b46cd060'] /* Vendor Ref# */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 100,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextField'
+ }
+ }
+ },
+ {
+ dataIndex : 'itemsrc_comments',
+ header : _this._strings['8413c683b4b27cc3f4dbd4c90329d8ba'] /* Comments */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 200,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextField'
+ }
+ }
+ },
+ {
+ dataIndex : 'itemsrc_vend_uom',
+ header : _this._strings['bb8913cd17d59f182acc7be1020007b7'] /* UOM */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 50,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ align : 'right',
+ dataIndex : 'itemsrc_minordqty',
+ header : _this._strings['7be1fa478799242847d4ef861ff6f8e1'] /* Min Qty */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 50,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ decimalPrecision : 0,
+ minValue : 0,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ }
+ }
+ },
+ {
+ align : 'right',
+ dataIndex : 'itemsrc_leadtime',
+ header : _this._strings['0ac9012a8c03a76ee76f04321b3b7fda'] /* Lead time */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 75,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel',
+ editor : {
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'GridEditor',
+ field : {
+ decimalPrecision : 0,
+ minValue : 0,
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'NumberField'
+ }
+ }
+ },
+ {
+ dataIndex : 'itemsrc_active',
+ header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 50,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ }
+ ]
+ }
+ },
+ {
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'events',
+ title : _this._strings['16d2b386b2034b9488996466aaae0b57'] /* History */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.hpanel = this;
+ if (_this.hgrid) {
+ _this.hgrid.footer.onClick('first');
+ }
+ }
+ },
+ grid : {
+ autoExpandColumn : 'remarks',
+ loadMask : true,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'Grid',
+ listeners : {
+ render : function()
+ {
+ _this.hgrid = this;
+ if (_this.hpanel.active) {
+ this.footer.onClick('first');
+ }
+ }
+ },
+ footer : {
+ displayInfo : true,
+ displayMsg : _this._strings['089ba2b5edc96565fc22c584ecfbb1a6'] /* Displaying events{0} - {1} of {2} */,
+ emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
+ pageSize : 25,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'PagingToolbar'
+ },
+ dataSource : {
+ remoteSort : true,
+ sortInfo : { field : 'event_when', direction: 'DESC' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, options)
+ {
+ options.params = options.params || {};
+
+ options.params.on_table = 'item';
+ options.params.on_id = _this.form.findField('item_id').getValue();
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/events.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {
+ 'name': 'event_when',
+ 'type': 'date'
+ },
+ {
+ 'name': 'action',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ipaddr',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ },
+ colModel : [
+ {
+ dataIndex : 'event_when',
+ header : _this._strings['820dbd2b8f606aff866c0bbfb6b737c1'] /* Changed */,
+ renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
+ width : 120,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'action',
+ header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
+ renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); },
+ width : 200,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'ipaddr',
+ header : _this._strings['5b8c99dad1893a85076709b2d3c2d2d0'] /* IP Address */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 200,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'person_id_name',
+ header : _this._strings['4ee972120bcda675f75222c87cb9d356'] /* Who */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 75,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'remarks',
+ header : _this._strings['f4c6f851b00d5518bf888815de279aba'] /* Notes */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 200,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ }
+ ]
+ }
+ }
+ ]
+ });
+ }
};