1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.XtupleItem = {
12 show : function(data, cb)
20 this.dialog.show(this.data._el);
23 this.form.setValues(data);
24 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
32 this.dialog = Roo.factory({
35 alwaysShowTabs : true,
36 xtype : 'LayoutRegion',
43 title : "Edit / Create item",
44 xtype : 'LayoutDialog',
57 click : function (_self, e)
69 render : function (_self)
73 click : function (_self, e)
78 // _this.dialog.el.mask("Saving");
79 _this.form.doAction("submit");
86 show : function (_self)
88 _this.dialog.layout.getRegion('center').showPanel(0);
96 xtype : 'ContentPanel',
101 url : baseURL + '/Roo/item.php',
103 style : 'margin:10px;',
108 actioncomplete : function(_self,action)
110 if (action.type == 'setdata') {
111 _this.form.findField('item_number').el.dom.readOnly = true;
112 _this.form.findField('item_type').disabled = true;
114 if(_this.data.item_id * 1 > 0){
119 '_id' : _this.data.item_id,
120 '_with_itemsite' : 1,
121 '_with_itemcost' : 1,
122 '_with_prodcat' : 1 ,
123 '_with_salesaccnt' : 1
129 _this.form.findField('item_number').el.dom.readOnly = false;
130 _this.form.findField('item_type').disabled = false;
131 _this.form.findField('item_salesaccnt').setValue('');
135 if (action.type == 'load') {
136 _this.form.findField('item_type').showHide();
139 if (action.type =='submit') {
141 var id = _this.form.findField('item_id').getValue() * 1;
147 '_id' : action.result.data.item_id,
148 '_with_itemsite' : 1,
149 '_with_itemcost' : 1,
150 '_with_prodcat' : 1 ,
151 '_with_salesaccnt' : 1
158 if (_this.callback) {
159 _this.callback.call(_this, _this.form.getValues());
165 rendered : function (form)
182 fieldLabel : 'Description',
186 name : 'item_descrip1'
190 fieldLabel : 'Description (2)',
194 name : 'item_descrip2'
205 xtype : 'SimpleStore',
207 [ 'P', "Purchased (eg. a standard product)"],
208 [ 'R' , "Reference (Non-Product)"],
209 [ 'K', "Kit (made up of products)"]
211 fields : [ 'ftype', 'fname'],
216 triggerAction : 'all',
218 displayField : 'fname',
219 emptyText : "Select Type",
220 hiddenName : 'item_type',
221 valueField : 'ftype',
224 showHide : function() {
226 var it = this.getValue();
229 'item_itemcost_id_itemcost_curr_id',
230 'item_itemcost_id_itemcost_actcost',
231 'item_itemsite_id_itemsite_reorderlevel',
232 'item_itemsite_id_itemsite_leadtime',
233 'item_itemsite_id_itemsite_location_id',
234 'item_itemsite_id_itemsite_loccntrl',
235 'item_itemsite_id_itemsite_stocked',
236 'item_itemsite_id_itemsite_perishable',
238 'item_itemsite_id_itemsite_safetystock',
239 'item_itemsite_id_itemsite_controlmethod',
240 'item_itemsite_id_itemsite_plancode_id',
241 'item_itemsite_id_itemsite_costcat_id',
242 'item_itemsite_id_itemsite_active',
243 'item_itemsite_id_itemsite_sold'
253 _this.standardCostFieldSet.show();
254 _this.itemsiteFieldSet.show();
255 _this.form.findField('_update_related').setValue(1);
261 _this.form.findField('item_listprice').allowBlank = false;
262 _this.form.findField('item_listprice').actionMode = 'fieldEl';
263 _this.form.findField('item_listprice').hideMode = 'display';
264 _this.form.findField('item_listprice').show();
268 case 'R': // refrence
269 options = options.concat(r_req);
271 _this.standardCostFieldSet.hide();
274 case 'P': // purchased..
275 options = options.concat(r_req);
280 Roo.each(options, function(n) {
281 var ff = _this.form.findField(n);
282 ff.allowBlank = !state;
283 ff.actionMode = 'fieldEl';
284 ff.hideMode = 'display';
285 state ? ff.show() : ff.hide();
291 _this.standardCostFieldSet.hide();
292 _this.itemsiteFieldSet.hide();
293 _this.form.findField('_update_related').setValue(0);
303 name : 'item_type_name',
304 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
306 beforeselect : function (combo, record, index)
308 (function() { combo.showHide(); }).defer(100);
320 url : baseURL + '/Roo/classcode.php',
329 xtype : 'JsonReader',
331 fields : [{"name":"id","type":"int"},{"name":"classcode_code","type":"string"}],
332 totalProperty : 'total'
337 sortInfo : { direction : 'ASC', field: 'id' },
340 beforeload : function (_self, o){
341 o.params = o.params || {};
352 triggerAction : 'all',
353 fieldLabel : 'Class',
354 forceSelection : true,
355 selectOnFocus : true,
357 displayField : 'classcode_code',
358 emptyText : "Select classcode",
359 hiddenName : 'item_classcode_id',
361 valueField : 'classcode_id',
368 name : 'item_classcode_id_classcode_code',
369 qtip : "Select classcode",
371 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{classcode_code}</b> </div>',
372 loadingText : "Searching...",
380 fieldLabel : 'Weight',
381 xtype : 'NumberField',
383 allowDecimals : true,
384 decimalPrecision : 2,
387 name : 'item_prodweight'
391 fieldLabel : 'Item comments',
395 name : 'item_comments',
400 fieldLabel : 'Item sold',
410 fieldLabel : 'Item active',
422 url : baseURL + '/Roo/prodcat.php',
431 xtype : 'JsonReader',
433 fields : [{"name":"id","type":"int"},{"name":"prodcat_code","type":"string"}],
434 totalProperty : 'total'
440 sortInfo : { direction : 'ASC', field: 'id' },
442 beforeload : function (_self, o){
443 o.params = o.params || {};
455 triggerAction : 'all',
456 fieldLabel : 'Product Category',
457 forceSelection : true,
458 selectOnFocus : true,
460 displayField : 'prodcat_code',
461 emptyText : "Select Category",
462 hiddenName : 'item_prodcat_id',
464 valueField : 'prodcat_id',
471 name : 'item_prodcat_id_prodcat_code',
472 qtip : "Select prodcat",
474 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{prodcat_code}</b> </div>',
475 loadingText : "Searching...",
477 add : function (combo)
479 Pman.Dialog.XtupleProdcat.show({prodcat_id : 0});
481 edit : function (combo, record)
483 var s = _this.form.findField('item_prodcat_id').getValue() * 1;
485 Roo.MessageBox.alert('Error','Please select a account assignment');
488 Pman.Dialog.XtupleProdcat.show({prodcat_id : s});
498 fieldLabel : 'Sales Account',
499 xtype : 'DisplayField',
501 name : 'item_salesaccnt'
505 fieldLabel : 'Item listprice',
506 xtype : 'NumberField',
509 name : 'item_listprice'
513 style : 'width:320px',
515 legend : "Standard Cost",
518 render : function (_self)
520 _this.standardCostFieldSet = _self;
528 url : baseURL + '/Roo/curr_symbol.php',
537 xtype : 'JsonReader',
539 fields : [{"name":"curr_id","type":"int"},"curr_symbol"],
540 totalProperty : 'total'
545 sortInfo : { direction : 'ASC', field: 'curr_symbol' },
548 beforeload : function (_self, o){
549 o.params = o.params || {};
561 triggerAction : 'all',
562 fieldLabel : 'Currency',
563 forceSelection : true,
564 selectOnFocus : true,
566 displayField : 'curr_name',
567 emptyText : "Select Currency",
568 hiddenName : 'item_itemcost_id_itemcost_curr_id',
570 valueField : 'curr_id',
578 qtip : "Select Currency",
579 queryParam : 'query[curr_name]',
580 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>',
581 loadingText : "Searching...",
589 fieldLabel : 'Value',
590 xtype : 'NumberField',
594 name : 'item_itemcost_id_itemcost_actcost'
610 legend : "Itemsite Settings",
612 style : 'width:335px;',
615 render : function (_self)
617 _this.itemsiteFieldSet = _self;
623 fieldLabel : 'Reorder Level',
624 xtype : 'NumberField',
628 name : 'item_itemsite_id_itemsite_reorderlevel'
632 fieldLabel : 'Stock Safety Level',
633 xtype : 'NumberField',
637 name : 'item_itemsite_id_itemsite_safetystock'
641 fieldLabel : 'Lead time (Days)',
642 xtype : 'NumberField',
646 name : 'item_itemsite_id_itemsite_leadtime'
651 xtype : 'SimpleStore',
656 fields : [ 'ftype', 'fname'],
661 triggerAction : 'all',
662 fieldLabel : 'Control Method',
663 displayField : 'fname',
664 hiddenName : 'item_itemsite_id_itemsite_controlmethod',
665 valueField : 'ftype',
672 name : 'item_itemsite_id_itemsite_controlmethod_name',
673 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fname}</b> </div>',
683 url : baseURL + '/Roo/plancode.php',
692 xtype : 'JsonReader',
694 fields : [{"name":"id","type":"int"},{"name":"plancode_code","type":"string"}],
695 totalProperty : 'total'
701 sortInfo : { direction : 'ASC', field: 'id' },
703 beforeload : function (_self, o){
704 o.params = o.params || {};
715 triggerAction : 'all',
716 fieldLabel : 'Planner Code',
717 forceSelection : true,
718 selectOnFocus : true,
720 displayField : 'plancode_name',
721 emptyText : "Select plancode",
722 hiddenName : 'item_itemsite_id_itemsite_plancode_id',
724 valueField : 'plancode_id',
731 name : 'plancode_name',
732 qtip : "Select plancode",
734 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{plancode_name}</b> </div>',
735 loadingText : "Searching...",
745 url : baseURL + '/Roo/costcat.php',
754 xtype : 'JsonReader',
756 fields : [{"name":"id","type":"int"},{"name":"costcat_code","type":"string"}],
757 totalProperty : 'total'
763 sortInfo : { direction : 'ASC', field: 'id' },
765 beforeload : function (_self, o){
766 o.params = o.params || {};
777 triggerAction : 'all',
778 fieldLabel : 'Costcat',
779 forceSelection : true,
780 selectOnFocus : true,
782 displayField : 'costcat_code',
783 emptyText : "Select costcat",
784 hiddenName : 'item_itemsite_id_itemsite_costcat_id',
786 valueField : 'costcat_id',
793 name : 'costcat_code',
794 qtip : "Select costcat",
796 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{costcat_code}</b> </div>',
797 loadingText : "Searching...",
805 fieldLabel : 'Active',
811 name : 'item_itemsite_id_itemsite_active'
821 name : 'item_itemsite_id_itemsite_sold'
825 fieldLabel : 'Stocked',
831 name : 'item_itemsite_id_itemsite_stocked'
835 fieldLabel : 'Perishable',
841 name : 'item_itemsite_id_itemsite_perishable'
845 fieldLabel : 'Multi Location',
851 name : 'item_itemsite_id_itemsite_loccntrl'
857 url : baseURL + '/Roo/location.php',
866 xtype : 'JsonReader',
867 fields : [{"name":"location_id","type":"int"},"location_name"],
869 totalProperty : 'total'
874 sortInfo : { direction : 'ASC', field: 'location_name' },
877 beforeload : function (_self, o){
878 o.params = o.params || {};
880 o.params.location_netable = 1;
881 o.params._notinternalcompany = 1;
882 o.params.location_restrict = 0;
892 triggerAction : 'all',
893 fieldLabel : 'Default Location',
894 forceSelection : true,
895 selectOnFocus : true,
897 displayField : 'location_name',
898 emptyText : "Default Location",
899 hiddenName : 'item_itemsite_id_itemsite_location_id',
901 valueField : 'location_id',
908 name : 'location_name',
909 qtip : "Select terms",
910 queryParam : 'query[location_name]',
911 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> </div>',
912 loadingText : "Searching...",
937 name : '_update_related'
950 url : baseURL + '/Roo/ipshead.php',
959 xtype : 'JsonReader',
962 'name': 'ipshead_id',
966 'name': 'ipshead_name',
971 totalProperty : 'total'
976 sortInfo : { field : 'bom_item_id_item_name', direction: 'ASC' },
979 beforeload : function (_self, o)
981 o.params = o.params || {};
983 var id = _this.form.findField('item_id').getValue() * 1;
988 o.params.bom_parent_item_id = id;
999 xtype : 'PagingToolbar',
1000 emptyMsg : "Nothing found",
1002 displayMsg : "Displaying records {0} - {1} of {2}",
1005 '|xns' : 'Roo.grid',
1006 autoExpandColumn : 'bom_item_id_item_descrip',
1007 xtype : 'EditorGrid',
1013 '|xns' : 'Roo.grid',
1014 xtype : 'ColumnModel',
1017 renderer : function(v) { return String.format('{0}', v); },
1019 dataIndex : 'bom_item_id_item_name'
1022 '|xns' : 'Roo.grid',
1023 xtype : 'ColumnModel',
1024 header : 'Description',
1026 renderer : function(v) { return String.format('{0}', v); },
1028 dataIndex : 'bom_item_id_item_descrip'
1031 '|xns' : 'Roo.grid',
1032 xtype : 'ColumnModel',
1035 renderer : function(v) { return String.format('{0}', v); },
1037 dataIndex : 'bom_qtyper'
1041 beforeedit : function (e)
1043 if(e.field != 'ipshead_ipsitem_price'){
1050 _this.partsgrid = this;
1051 //_this.dialog = Pman.Dialog.FILL_IN
1052 if (_this.partspanel.active) {
1053 this.footer.onClick('first');
1056 afteredit : function (e)
1058 if(e.originalValue == e.value){
1064 var id = _this.form.findField('item_id').getValue() * 1;
1071 url : baseURL + '/Roo/ipsiteminfo',
1074 ipsitem_ipshead_id : e.record.data.ipshead_id,
1075 ipsitem_item_id : id,
1076 ipsitem_price : e.record.data.ipshead_ipsitem_price,
1077 ipsitem_id : e.record.data.ipshead_ipsitem_id
1096 title : "Item Parts",
1097 xtype : 'GridPanel',
1098 fitContainer : true,
1100 tableName : 'ipshead',
1102 activate : function() {
1103 _this.lpanel = this;
1105 try { if (MODULE.isBuilder) {
1109 var id = _this.form.findField('item_id').getValue() * 1;
1111 Roo.MessageBox.alert("Save First", "Save the item first, before adding parts");
1112 _this.dialog.layout.getRegion('center').showPanel(0);
1116 if (_this.partsgrid) {
1117 _this.partsgrid.footer.onClick('first');
1131 '|xns' : 'Roo.data',
1134 xtype : 'JsonReader',
1169 'name': 'displayorder',
1177 'name': 'parent_image_id',
1183 'dateFormat' : 'Y-m-d H:i:s'
1203 totalProperty : 'total'
1206 '|xns' : 'Roo.data',
1207 url : baseURL + '/Roo/Images.php',
1208 xtype : 'HttpProxy',
1212 '|xns' : 'Roo.data',
1215 sortInfo : { field: 'created' , direction: 'DESC' },
1218 beforeload : function (_self, o)
1220 o.params = o.params || {};
1222 var id = _this.form.findField('item_id').getValue();
1229 o.params.ontable = 'item';
1241 xtype : 'PagingToolbar',
1242 emptyMsg : "No Images found",
1245 displayMsg : "Displaying Images {0} - {1} of {2}"
1253 '|xns' : 'Roo.Toolbar',
1256 cls : 'x-btn-text-icon',
1257 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1262 Pman.Dialog.Image.show({
1265 onid: _this.form.findField('item_id').getValue() * 1,
1268 if (!data) { return; }
1269 _this.grid.footer.onClick('first');
1276 '|xns' : 'Roo.Toolbar',
1279 cls : 'x-btn-text-icon',
1280 icon : rootURL + '/Pman/templates/images/trash.gif',
1285 Pman.genericDelete(_this, 'Images');
1292 '|xns' : 'Roo.grid',
1293 autoExpandColumn : 'id',
1299 '|xns' : 'Roo.grid',
1300 xtype : 'ColumnModel',
1304 renderer : function(v,x,r) {
1305 return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
1306 v.format('d/M/Y'), r.data.mimetype, r.data.filename,
1307 r.data.width, r.data.height
1311 dataIndex : 'created'
1314 '|xns' : 'Roo.grid',
1315 xtype : 'ColumnModel',
1318 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename); },
1324 rowdblclick : function (_self, rowIndex, e)
1327 var s = _self.getDataSource().getAt(rowIndex);
1329 url : baseURL + '/Images/Download/' + s.data.id
1333 render : function() {
1336 if (_this.panel.active) {
1337 this.footer.onClick('first');
1350 title : "Reference Files",
1351 xtype : 'GridPanel',
1352 fitContainer : true,
1354 tableName : 'Images',
1356 activate : function() {
1359 try { if (MODULE.isBuilder) {
1363 var id = _this.form.findField('item_id').getValue() * 1;
1365 Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
1366 _this.dialog.layout.getRegion('center').showPanel(0);
1371 _this.grid.footer.onClick('first');
1385 '|xns' : 'Roo.data',
1386 url : baseURL + '/Roo/ipshead.php',
1388 xtype : 'HttpProxy',
1392 '|xns' : 'Roo.data',
1395 xtype : 'JsonReader',
1398 'name': 'ipshead_id',
1402 'name': 'ipshead_name',
1407 totalProperty : 'total'
1409 '|xns' : 'Roo.data',
1412 sortInfo : { field : 'ipshead_id', direction: 'ASC' },
1415 beforeload : function (_self, o)
1417 o.params = o.params || {};
1419 var id = _this.form.findField('item_id').getValue() * 1;
1424 o.params._with_item = id;
1435 xtype : 'PagingToolbar',
1436 emptyMsg : "Nothing found",
1438 displayMsg : "Displaying records {0} - {1} of {2}",
1441 '|xns' : 'Roo.grid',
1442 autoExpandColumn : 'ipshead_descrip',
1443 xtype : 'EditorGrid',
1449 '|xns' : 'Roo.grid',
1450 xtype : 'ColumnModel',
1453 renderer : function(v) { return String.format('{0}', v); },
1455 dataIndex : 'ipshead_name'
1458 '|xns' : 'Roo.grid',
1459 xtype : 'ColumnModel',
1461 header : 'Description',
1462 renderer : function(v) { return String.format('{0}', v); },
1464 dataIndex : 'ipshead_descrip'
1467 '|xns' : 'Roo.grid',
1468 xtype : 'ColumnModel',
1470 header : 'Currency',
1471 renderer : function(v) { return String.format('{0}', v); },
1473 dataIndex : 'ipshead_curr_id_curr_name'
1478 '|xns' : 'Roo.form',
1479 xtype : 'NumberField',
1480 cls : 'align-right',
1481 decimalPrecision : 2,
1484 '|xns' : 'Roo.grid',
1485 xtype : 'GridEditor',
1492 '|xns' : 'Roo.grid',
1494 xtype : 'ColumnModel',
1497 renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); },
1499 dataIndex : 'ipshead_ipsitem_price',
1507 beforeedit : function (e)
1509 if(e.field != 'ipshead_ipsitem_price'){
1517 //_this.dialog = Pman.Dialog.FILL_IN
1518 if (_this.lpanel.active) {
1519 this.footer.onClick('first');
1522 afteredit : function (e)
1524 if(e.originalValue == e.value){
1528 var id = _this.form.findField('item_id').getValue() * 1;
1535 url : baseURL + '/Roo/ipsiteminfo',
1538 ipsitem_ipshead_id : e.record.data.ipshead_id,
1539 ipsitem_item_id : id,
1540 ipsitem_price : e.record.data.ipshead_ipsitem_price,
1541 ipsitem_id : e.record.data.ipshead_ipsitem_id
1560 title : "Price List",
1561 xtype : 'GridPanel',
1562 fitContainer : true,
1564 tableName : 'ipshead',
1566 activate : function() {
1567 _this.lpanel = this;
1569 try { if (MODULE.isBuilder) {
1573 var id = _this.form.findField('item_id').getValue() * 1;
1575 Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
1576 _this.dialog.layout.getRegion('center').showPanel(0);
1581 _this.lgrid.footer.onClick('first');
1595 '|xns' : 'Roo.data',
1596 url : baseURL + '/Roo/itemsrc.php',
1597 xtype : 'HttpProxy',
1602 '|xns' : 'Roo.data',
1605 xtype : 'JsonReader',
1609 'name': 'itemsrc_id',
1613 'name': 'itemsrc_item_id',
1617 'name': 'itemsrc_item_id',
1621 'name': 'itemsrc_vend_id',
1625 'name': 'itemsrc_vend_id',
1629 'name': 'itemsrc_vend_item_number',
1633 'name': 'itemsrc_vend_item_descrip',
1637 'name': 'itemsrc_comments',
1641 'name': 'itemsrc_vend_uom',
1645 'name': 'itemsrc_invvendoruomratio',
1649 'name': 'itemsrc_minordqty',
1653 'name': 'itemsrc_multordqty',
1657 'name': 'itemsrc_leadtime',
1661 'name': 'itemsrc_ranking',
1665 'name': 'itemsrc_active',
1669 'name': 'itemsrc_manuf_name',
1673 'name': 'itemsrc_manuf_item_number',
1677 'name': 'itemsrc_manuf_item_descrip',
1681 'name': 'itemsrc_default',
1685 'name': 'itemsrc_upccode',
1689 totalProperty : 'total'
1691 '|xns' : 'Roo.data',
1694 sortInfo : { field : 'itemsrc_vend_id_vend_name', direction: 'ASC' },
1697 update : function (_self, record, operation)
1702 if (operation != 'commit') {
1705 if (record.data.itemsrc_vend_id * 1 < 1) {
1706 return; // do not save.
1708 if (record.data.itemsrc_id * 1 < 0) {
1709 return; // do not save. -- updating at present...
1712 var p = Roo.apply({}, record.data);
1713 record.set('itemsrc_id', -1);
1716 url : baseURL + '/Roo/Itemsrc',
1719 success: function(res) {
1720 if (record.data.itemsrc_id *1 < 1) {
1721 record.set('itemsrc_id', res.data.itemsrc_id);
1728 beforeload : function (_self, o)
1731 var id = 1 * _this.form.findField('item_id').getValue();
1736 o.params.itemsrc_item_id = id;
1747 xtype : 'PagingToolbar',
1748 emptyMsg : "No itemsrc found",
1751 displayMsg : "Displaying itemsrc{0} - {1} of {2}"
1759 '|xns' : 'Roo.Toolbar',
1762 cls : 'x-btn-text-icon',
1763 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1769 Roo.log("add presed");
1772 var grid = _this.itemsrcgrid;
1774 // uses form defaults or last row value.
1775 var nr = grid.ds.reader.newRow({
1777 itemsrc_item_id : _this.form.findField('item_id').getValue(),
1779 itemsrc_vend_id : 0,
1780 itemsrc_vend_item_number : '',
1781 itemsrc_vend_item_descrip : '',
1782 itemsrc_comments : '',
1783 itemsrc_vend_uom : 'EA',
1784 itemsrc_invvendoruomratio : 1.0,
1785 itemsrc_minordqty : 0,
1786 itemsrc_multordqty : 0,
1787 itemsrc_leadtime : 30,
1788 itemsrc_ranking : 0,
1789 itemsrc_active : true,
1790 itemsrc_manuf_name : '',
1791 itemsrc_manuf_item_number : '',
1792 itemsrc_manuf_item_descrip: '',
1793 itemsrc_default : true,
1794 itemsrc_upccode : ''
1798 grid.ds.insert(0, nr);
1799 grid.startEditing(0, 0); // type..
1807 '|xns' : 'Roo.grid',
1808 autoExpandColumn : 'itemsrc_comments',
1809 xtype : 'EditorGrid',
1819 '|xns' : 'Roo.data',
1820 url : baseURL + '/Roo/vendinfo.php',
1821 xtype : 'HttpProxy',
1826 '|xns' : 'Roo.data',
1829 xtype : 'JsonReader',
1831 fields : [{"name":"id","type":"int"},{"name":"vend_name","type":"string"}],
1832 totalProperty : 'total'
1834 '|xns' : 'Roo.data',
1838 sortInfo : { direction : 'ASC', field: 'id' },
1840 beforeload : function (_self, o){
1841 o.params = o.params || {};
1850 '|xns' : 'Roo.form',
1852 triggerAction : 'all',
1853 forceSelection : true,
1854 selectOnFocus : true,
1856 displayField : 'vend_name',
1857 emptyText : "Select Vendor",
1858 hiddenName : 'itemsrc_vend_id',
1860 valueField : 'vend_id',
1867 name : 'itemsrc_vend_id_vend_name',
1868 qtip : "Select vendinfo",
1869 queryParam : 'q[search]',
1870 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>',
1871 loadingText : "Searching...",
1877 '|xns' : 'Roo.grid',
1878 xtype : 'GridEditor',
1885 '|xns' : 'Roo.grid',
1886 xtype : 'ColumnModel',
1889 renderer : function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); },
1891 dataIndex : 'itemsrc_vend_id',
1900 '|xns' : 'Roo.form',
1901 xtype : 'TextField',
1904 '|xns' : 'Roo.grid',
1905 xtype : 'GridEditor',
1912 '|xns' : 'Roo.grid',
1913 xtype : 'ColumnModel',
1915 header : 'Vendor Ref#',
1916 renderer : function(v) { return String.format('{0}', v); },
1918 dataIndex : 'itemsrc_vend_item_number',
1927 '|xns' : 'Roo.form',
1928 xtype : 'TextField',
1931 '|xns' : 'Roo.grid',
1932 xtype : 'GridEditor',
1939 '|xns' : 'Roo.grid',
1940 xtype : 'ColumnModel',
1942 header : 'Comments',
1943 renderer : function(v) { return String.format('{0}', v); },
1945 dataIndex : 'itemsrc_comments',
1952 '|xns' : 'Roo.grid',
1953 xtype : 'ColumnModel',
1956 renderer : function(v) { return String.format('{0}', v); },
1958 dataIndex : 'itemsrc_vend_uom'
1963 '|xns' : 'Roo.form',
1965 xtype : 'NumberField',
1966 decimalPrecision : 0,
1969 '|xns' : 'Roo.grid',
1970 xtype : 'GridEditor',
1977 '|xns' : 'Roo.grid',
1979 xtype : 'ColumnModel',
1982 renderer : function(v) { return String.format('{0}', v); },
1984 dataIndex : 'itemsrc_minordqty',
1993 '|xns' : 'Roo.form',
1995 xtype : 'NumberField',
1996 decimalPrecision : 0,
1999 '|xns' : 'Roo.grid',
2000 xtype : 'GridEditor',
2007 '|xns' : 'Roo.grid',
2009 xtype : 'ColumnModel',
2010 header : 'Lead time',
2012 renderer : function(v) { return String.format('{0}', v); },
2014 dataIndex : 'itemsrc_leadtime',
2021 '|xns' : 'Roo.grid',
2022 xtype : 'ColumnModel',
2025 renderer : function(v) { return String.format('{0}', v); },
2027 dataIndex : 'itemsrc_active'
2031 rowdblclick : function (_self, rowIndex, e)
2033 if (!_this.dialog) return;
2034 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
2035 _this.grid.footer.onClick('first');
2040 _this.itemsrcgrid = this;
2041 //_this.dialog = Pman.Dialog.FILL_IN
2044 afteredit : function (e)
2058 title : "Suppliers",
2059 xtype : 'GridPanel',
2060 fitContainer : true,
2062 tableName : 'itemsrc',
2064 activate : function() {
2065 _this.itemsrcpanel = this;
2066 if (_this.itemsrcgrid) {
2067 _this.itemsrcgrid.footer.onClick('first');
2080 '|xns' : 'Roo.data',
2081 url : baseURL + '/Roo/events.php',
2083 xtype : 'HttpProxy',
2087 '|xns' : 'Roo.data',
2090 xtype : 'JsonReader',
2093 'name': 'event_when',
2105 'name': 'person_id_name',
2114 totalProperty : 'total'
2116 '|xns' : 'Roo.data',
2119 sortInfo : { field : 'event_when', direction: 'DESC' },
2122 beforeload : function (_self, options)
2124 options.params = options.params || {};
2126 options.params.on_table = 'item';
2127 options.params.on_id = _this.form.findField('item_id').getValue();
2138 xtype : 'PagingToolbar',
2139 emptyMsg : "No Events found",
2141 displayMsg : "Displaying events{0} - {1} of {2}",
2144 '|xns' : 'Roo.grid',
2145 autoExpandColumn : 'remarks',
2151 '|xns' : 'Roo.grid',
2152 xtype : 'ColumnModel',
2155 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
2157 dataIndex : 'event_when'
2160 '|xns' : 'Roo.grid',
2161 xtype : 'ColumnModel',
2164 renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); },
2166 dataIndex : 'action'
2169 '|xns' : 'Roo.grid',
2170 xtype : 'ColumnModel',
2172 header : 'IP Address',
2173 renderer : function(v) { return String.format('{0}', v); },
2175 dataIndex : 'ipaddr'
2178 '|xns' : 'Roo.grid',
2179 xtype : 'ColumnModel',
2182 renderer : function(v) { return String.format('{0}', v); },
2184 dataIndex : 'person_id_name'
2187 '|xns' : 'Roo.grid',
2188 xtype : 'ColumnModel',
2191 renderer : function(v) { return String.format('{0}', v); },
2193 dataIndex : 'remarks'
2200 if (_this.hpanel.active) {
2201 this.footer.onClick('first');
2215 xtype : 'GridPanel',
2216 fitContainer : true,
2218 tableName : 'events',
2220 activate : function() {
2221 _this.hpanel = this;
2223 _this.hgrid.footer.onClick('first');