3 "name": "Pman.Tab.XtuplePriceLists",
4 "parent": "Pman.Tab.XtupleManage",
5 "title": "Pman.Tab.XtuplePriceLists",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtuplePriceLists.bjs",
13 "title": "Price List",
14 "xtype": "NestedLayoutPanel",
19 "xtype": "BorderLayout",
24 "xtype": "LayoutRegion",
31 "xtype": "LayoutRegion",
36 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
42 "tableName": "ipshead",
43 "title": "Price Lists",
49 "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.XtuplePriceList\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
50 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n"
53 "autoExpandColumn": "ipshead_descrip",
61 "xtype": "RowSelectionModel",
65 "*prop": "dataSource",
68 "|sortInfo": "{ field : 'ipshead_name', direction: 'ASC' }",
75 "|url": "baseURL + '/Roo/ipshead.php'",
80 "xtype": "JsonReader",
81 "totalProperty": "total",
85 "|fields": "[\n {\n 'name': 'ipshead_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_name',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_descrip',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_effective',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'ipshead_expires',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'ipshead_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_updated',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'ipshead_curr_id_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_curr_id_curr_base',\n 'type': 'int'\n },\n {\n 'name': 'ipshead_curr_id_curr_name',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_curr_id_curr_symbol',\n 'type': 'string'\n },\n {\n 'name': 'ipshead_curr_id_curr_abbr',\n 'type': 'string'\n }\n]"
92 "displayMsg": "Displaying ipshead{0} - {1} of {2}",
93 "emptyMsg": "No ipshead found",
95 "xtype": "PagingToolbar",
105 "click": "function (_self, e)\n{\n new Pman.Download({\n method: 'GET',\n url : baseURL + '/Roo/Ipsiteminfo',\n params : {\n _pricegrid : 1\n }\n });\n}"
107 "text": "Download Price Matrix",
109 "|xns": "Roo.Toolbar"
113 "click": "function (_self, e)\n{\n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Pricing'\n \n },\n function (data) {\n var msg = [];\n if (data.deleted) {\n msg.push(\"Deleted \" + data.deleted + \" Price(s)\");\n }\n if (data.updated) {\n msg.push(\"Updated \" + data.updated + \" Price(s)\");\n } \n if (data.inserted) {\n msg.push(\"Added \" + data.inserted + \" Price(s)\");\n }\n if (!msg.length) {\n msg.push(\"No data changed\");\n }\n Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}"
115 "text": "Upload Price Matrix",
117 "|xns": "Roo.Toolbar"
120 "|xns": "Roo.Toolbar",
126 "cls": "x-btn-text-icon",
127 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
129 "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
131 "|xns": "Roo.Toolbar"
135 "cls": "x-btn-text-icon",
136 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
139 "|click": "function()\n{\n Pman.genericDelete(_this, 'ipshead'); \n}\n "
141 "|xns": "Roo.Toolbar"
146 "*prop": "colModel[]",
147 "dataIndex": "ipshead_curr_id_curr_name",
148 "header": "Ipshead curr",
151 "xtype": "ColumnModel",
152 "|renderer": "function(v) { return String.format('{0}', v); }",
156 "*prop": "colModel[]",
157 "dataIndex": "ipshead_name",
158 "header": "Ipshead name",
161 "xtype": "ColumnModel",
162 "|renderer": "function(v) { return String.format('{0}', v); }",
166 "xtype": "ColumnModel",
167 "header": "Ipshead descrip",
169 "dataIndex": "ipshead_descrip",
170 "|renderer": "function(v) { return String.format('{0}', v); }",
172 "*prop": "colModel[]"
175 "xtype": "ColumnModel",
176 "header": "Ipshead effective",
178 "dataIndex": "ipshead_effective",
179 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
181 "*prop": "colModel[]"
184 "*prop": "colModel[]",
185 "dataIndex": "ipshead_expires",
186 "header": "Ipshead expires",
188 "xtype": "ColumnModel",
189 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
193 "xtype": "ColumnModel",
194 "header": "Ipshead updated",
196 "dataIndex": "ipshead_updated",
197 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
199 "*prop": "colModel[]"
207 "|activate": "function() {\n _this.ipanel = this;\n if (_this.igrid) {\n // _this.igrid.footer.onClick('first');\n }\n}"
210 "fitContainer": true,
215 "xtype": "GridPanel",
220 "|render": "function() \n{\n _this.igrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.ipanel.active) {\n //this.footer.onClick('first');\n }\n}",
221 "cellclick": "function (_self, row, col, e)\n{\n var di = _this.grid.colModel.getDataIndex(col);\n \n var rec = _this.grid.ds.getAt(row);\n \n if(di == 'item_image_filename'){\n if(!rec.data.item_image_id){\n return;\n }\n var u = baseURL;\n if(rec.data.item_image_from_hk){\n u = u.split('/');\n u.pop();\n u = u.join('/') + '/hk.php';\n }\n Pman.download( {\n url: u + '/Images/Download/' + rec.data.item_image_id + '/' + rec.data.item_image_filename\n });\n return;\n }\n \n if (di == 'item_active') {\n \n var nv = rec.data.item_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Item',\n params : {\n item_id : rec.data.item_id,\n item_active : nv\n },\n success : function() {\n rec.set('item_active', nv);\n }\n });\n return;\n \n \n }\n \n if(di == 'itemsrc_active'){\n if(!rec.data.itemsrc_active){\n Roo.MessageBox.alert('Error','Please edit it on Xtuple tool');\n return;\n }\n if(rec.data.itemsrc_active){\n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure this product is no longer purchased\",\n function (res) {\n if(res!='yes') {\n return;\n }\n rec.commit();\n });\n }\n }\n \n _this.locgrid.footer.onClick('first');\n \n \n \n \n}",
222 "afteredit": "function (e)\n{\n \n \n Roo.log(e);\n new Pman.Request({\n url : baseURL +'/Roo/Charass',\n params : {\n charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),\n charass_value : e.value,\n charass_target_type : 'I',\n charass_default : 1,\n charass_target_id : e.record.data.item_id\n },\n method : 'POST'\n });\n \n \n e.record.commit();\n \n \n \n}",
223 "rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
226 "autoExpandColumn": "item_descrip1",
229 "xtype": "EditorGrid",
234 "beforeload": "function (_self, o)\n{\n o.params = o.params || {}\n \n var p = _this.grid.getSelectionModel().getSelected();\n \n if(!p || p.ipshead_id * 1 < 1){\n this.removeAll();\n return;\n }\n \n o.params.item_active = 1;\n\n}",
235 "update": "function (_self, record, operation)\n{\n if(operation != 'commit'){\n return;\n }\n \n var nv = record.data.itemsrc_active ? 0 : 1;\n new Pman.Request({\n mask : 'Saving',\n url : baseURL + '/Roo/Itemsrc',\n params : {\n _update_by_item : 1,\n item_id : record.data.item_id,\n itemsrc_active : nv\n },\n success : function(res) {\n record.set('itemsrc_active', nv);\n }\n });\n}"
237 "*prop": "dataSource",
240 "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
245 "xtype": "HttpProxy",
247 "|url": "baseURL + '/Roo/item.php'",
252 "xtype": "JsonReader",
253 "totalProperty": "total",
257 "|fields": "[\n {\n 'name': 'item_id',\n 'type': 'int'\n },\n {\n 'name': 'item_number',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip1',\n 'type': 'string'\n },\n {\n 'name': 'item_descrip2',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_picklist',\n 'type': 'int'\n },\n {\n 'name': 'item_comments',\n 'type': 'string'\n },\n {\n 'name': 'item_sold',\n 'type': 'int'\n },\n {\n 'name': 'item_fractional',\n 'type': 'int'\n },\n {\n 'name': 'item_active',\n 'type': 'int'\n },\n {\n 'name': 'item_type',\n 'type': 'string'\n },\n {\n 'name': 'item_prodweight',\n 'type': 'float'\n },\n {\n 'name': 'item_packweight',\n 'type': 'float'\n },\n {\n 'name': 'item_prodcat_id',\n 'type': 'int'\n },\n {\n 'name': 'item_exclusive',\n 'type': 'int'\n },\n {\n 'name': 'item_listprice',\n 'type': 'float'\n },\n {\n 'name': 'item_config',\n 'type': 'int'\n },\n {\n 'name': 'item_extdescrip',\n 'type': 'string'\n },\n {\n 'name': 'item_upccode',\n 'type': 'string'\n },\n {\n 'name': 'item_maxcost',\n 'type': 'float'\n },\n {\n 'name': 'item_inv_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_warrdays',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_tax_recoverable',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_price_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_price_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'item_inv_uom_id_uom_name',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_inv_uom_id_uom_item_weight',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_id',\n 'type': 'int'\n },\n {\n 'name': 'item_freightclass_id_freightclass_code',\n 'type': 'string'\n },\n {\n 'name': 'item_freightclass_id_freightclass_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_id',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_code',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_descrip',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_mfg',\n 'type': 'int'\n },\n {\n 'name': 'item_classcode_id_classcode_creator',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_created',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_modifier',\n 'type': 'string'\n },\n {\n 'name': 'item_classcode_id_classcode_modified',\n 'type': 'date'\n },\n {\n 'name': 'item_classcode_id_classcode_type',\n 'type': 'string'\n }\n]"
264 "displayMsg": "Displaying item{0} - {1} of {2}",
265 "emptyMsg": "No item found",
267 "xtype": "PagingToolbar",
272 "click": "function (_self, e)\n{\n new Pman.Download({\n method: 'GET',\n url : baseURL + '/Roo/item',\n params : {\n _costgrid : 1\n }\n });\n}"
274 "text": "Download Standard costs",
276 "|xns": "Roo.Toolbar"
280 "click": "function (_self, e)\n{\n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Products'\n \n },\n function (data) {\n var msg = [];\n \n if (data.updated) {\n msg.push(\"Updated \" + data.updated + \" Products(s)\");\n } \n if (data.inserted) {\n msg.push(\"Added \" + data.inserted + \" Products(s)\");\n }\n if (data.skipped) {\n msg.push(\"Skipped \" + data.skipped);\n }\n \n if (!msg.length) {\n msg.push(\"No data changed\");\n }\n Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}"
282 "text": "Upload new products and costs",
284 "|xns": "Roo.Toolbar"
288 "click": "function (_self, e)\n{\n \n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a row\");\n return;\n }\n \n var rec = _this.grid.ds.getAt(sel[0]);\n if(rec.data.item_id * 1 < 1){\n return;\n }\n \n Pman.Dialog.Image.show({\n id : rec.data.item_image_id ? rec.data.item_image_id : 0,\n onid : rec.data.item_id,\n ontable : 'Item'\n }, function(data) {\n if (data) {\n _this.grid.footer.onClick('first');\n \n }\n \n });\n}"
290 "text": "Upload an image",
292 "|xns": "Roo.Toolbar"
296 "click": "function (_self, e)\n{\n Roo.MessageBox.progress (\"Syncing Stock\", \"Sending\");\n \n var offset = 0;\n \n function runSync() {\n \n new Pman.Request( {\n url : baseURL+'/Roo/Item',\n method : 'GET',\n params : {\n _syncFromHK : 1,\n offset : offset\n },\n success : function(res) {\n Roo.log(res);\n if (!res.data.total) {\n Roo.MessageBox.hide();\n return;\n }\n offset += res.data.limit;\n Roo.MessageBox.updateProgress ( offset / res.data.total, \"Done \" + offset + '/' + res.data.total);\n runSync();\n }\n \n \n });\n }\n runSync();\n}"
298 "text": "Sync Product Data from HK",
300 "|hidden": "(function() {\n\n return baseURL.match(/hk\\.php$/) ? true : false;\n})()",
301 "|xns": "Roo.Toolbar"
306 "*prop": "colModel[]",
307 "dataIndex": "item_number",
310 "xtype": "ColumnModel",
311 "|renderer": "function(v) { return String.format('{0}', v); }",
315 "*prop": "colModel[]",
317 "dataIndex": "item_actcost",
320 "xtype": "ColumnModel",
321 "|renderer": "function(v,x,r) {\n\n return String.format('{0}{1}', r.data.item_curr_name, Roo.util.Format.number(v,2)) ; \n \n }",