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'
955 url : baseURL + '/Roo/bomitem.php',
964 xtype : 'JsonReader',
967 'name': 'bomitem_id',
972 totalProperty : 'total'
977 sortInfo : { field : 'bomitem_item_id_item_name', direction: 'ASC' },
980 beforeload : function (_self, o)
982 o.params = o.params || {};
984 var id = _this.form.findField('item_id').getValue() * 1;
989 o.params.bom_parent_item_id = id;
1000 xtype : 'PagingToolbar',
1001 emptyMsg : "Nothing found",
1003 displayMsg : "Displaying parts {0} - {1} of {2}",
1006 '|xns' : 'Roo.grid',
1007 autoExpandColumn : 'bomitem_item_id_item_descrip1',
1008 xtype : 'EditorGrid',
1014 '|xns' : 'Roo.grid',
1015 xtype : 'ColumnModel',
1018 renderer : function(v) { return String.format('{0}', v); },
1020 dataIndex : 'bomitem_item_id_item_name'
1023 '|xns' : 'Roo.grid',
1024 xtype : 'ColumnModel',
1025 header : 'Description',
1027 renderer : function(v) { return String.format('{0}', v); },
1029 dataIndex : 'bomitem_item_id_item_descrip1'
1032 '|xns' : 'Roo.grid',
1033 xtype : 'ColumnModel',
1036 renderer : function(v) { return String.format('{0}', v); },
1038 dataIndex : 'bomitem_qtyper'
1042 beforeedit : function (e)
1044 if(e.field != 'ipshead_ipsitem_price'){
1051 _this.partsgrid = this;
1052 //_this.dialog = Pman.Dialog.FILL_IN
1053 if (_this.partspanel.active) {
1054 this.footer.onClick('first');
1057 afteredit : function (e)
1059 if(e.originalValue == e.value){
1065 var id = _this.form.findField('item_id').getValue() * 1;
1072 url : baseURL + '/Roo/ipsiteminfo',
1075 ipsitem_ipshead_id : e.record.data.ipshead_id,
1076 ipsitem_item_id : id,
1077 ipsitem_price : e.record.data.ipshead_ipsitem_price,
1078 ipsitem_id : e.record.data.ipshead_ipsitem_id
1097 title : "Item Parts",
1098 xtype : 'GridPanel',
1099 fitContainer : true,
1101 tableName : 'bomitem',
1103 activate : function() {
1104 _this.lpanel = this;
1106 try { if (MODULE.isBuilder) {
1110 var id = _this.form.findField('item_id').getValue() * 1;
1112 Roo.MessageBox.alert("Save First", "Save the item first, before adding parts");
1113 _this.dialog.layout.getRegion('center').showPanel(0);
1117 if (_this.partsgrid) {
1118 _this.partsgrid.footer.onClick('first');
1132 '|xns' : 'Roo.data',
1135 xtype : 'JsonReader',
1170 'name': 'displayorder',
1178 'name': 'parent_image_id',
1184 'dateFormat' : 'Y-m-d H:i:s'
1204 totalProperty : 'total'
1207 '|xns' : 'Roo.data',
1208 url : baseURL + '/Roo/Images.php',
1209 xtype : 'HttpProxy',
1213 '|xns' : 'Roo.data',
1216 sortInfo : { field: 'created' , direction: 'DESC' },
1219 beforeload : function (_self, o)
1221 o.params = o.params || {};
1223 var id = _this.form.findField('item_id').getValue();
1230 o.params.ontable = 'item';
1242 xtype : 'PagingToolbar',
1243 emptyMsg : "No Images found",
1246 displayMsg : "Displaying Images {0} - {1} of {2}"
1254 '|xns' : 'Roo.Toolbar',
1257 cls : 'x-btn-text-icon',
1258 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1263 Pman.Dialog.Image.show({
1266 onid: _this.form.findField('item_id').getValue() * 1,
1269 if (!data) { return; }
1270 _this.grid.footer.onClick('first');
1277 '|xns' : 'Roo.Toolbar',
1280 cls : 'x-btn-text-icon',
1281 icon : rootURL + '/Pman/templates/images/trash.gif',
1286 Pman.genericDelete(_this, 'Images');
1293 '|xns' : 'Roo.grid',
1294 autoExpandColumn : 'id',
1300 '|xns' : 'Roo.grid',
1301 xtype : 'ColumnModel',
1305 renderer : function(v,x,r) {
1306 return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',
1307 v.format('d/M/Y'), r.data.mimetype, r.data.filename,
1308 r.data.width, r.data.height
1312 dataIndex : 'created'
1315 '|xns' : 'Roo.grid',
1316 xtype : 'ColumnModel',
1319 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename); },
1325 rowdblclick : function (_self, rowIndex, e)
1328 var s = _self.getDataSource().getAt(rowIndex);
1330 url : baseURL + '/Images/Download/' + s.data.id
1334 render : function() {
1337 if (_this.panel.active) {
1338 this.footer.onClick('first');
1351 title : "Reference Files",
1352 xtype : 'GridPanel',
1353 fitContainer : true,
1355 tableName : 'Images',
1357 activate : function() {
1360 try { if (MODULE.isBuilder) {
1364 var id = _this.form.findField('item_id').getValue() * 1;
1366 Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
1367 _this.dialog.layout.getRegion('center').showPanel(0);
1372 _this.grid.footer.onClick('first');
1386 '|xns' : 'Roo.data',
1387 url : baseURL + '/Roo/ipshead.php',
1389 xtype : 'HttpProxy',
1393 '|xns' : 'Roo.data',
1396 xtype : 'JsonReader',
1399 'name': 'ipshead_id',
1403 'name': 'ipshead_name',
1408 totalProperty : 'total'
1410 '|xns' : 'Roo.data',
1413 sortInfo : { field : 'ipshead_id', direction: 'ASC' },
1416 beforeload : function (_self, o)
1418 o.params = o.params || {};
1420 var id = _this.form.findField('item_id').getValue() * 1;
1425 o.params._with_item = id;
1436 xtype : 'PagingToolbar',
1437 emptyMsg : "Nothing found",
1439 displayMsg : "Displaying records {0} - {1} of {2}",
1442 '|xns' : 'Roo.grid',
1443 autoExpandColumn : 'ipshead_descrip',
1444 xtype : 'EditorGrid',
1450 '|xns' : 'Roo.grid',
1451 xtype : 'ColumnModel',
1454 renderer : function(v) { return String.format('{0}', v); },
1456 dataIndex : 'ipshead_name'
1459 '|xns' : 'Roo.grid',
1460 xtype : 'ColumnModel',
1462 header : 'Description',
1463 renderer : function(v) { return String.format('{0}', v); },
1465 dataIndex : 'ipshead_descrip'
1468 '|xns' : 'Roo.grid',
1469 xtype : 'ColumnModel',
1471 header : 'Currency',
1472 renderer : function(v) { return String.format('{0}', v); },
1474 dataIndex : 'ipshead_curr_id_curr_name'
1479 '|xns' : 'Roo.form',
1480 xtype : 'NumberField',
1481 cls : 'align-right',
1482 decimalPrecision : 2,
1485 '|xns' : 'Roo.grid',
1486 xtype : 'GridEditor',
1493 '|xns' : 'Roo.grid',
1495 xtype : 'ColumnModel',
1498 renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); },
1500 dataIndex : 'ipshead_ipsitem_price',
1508 beforeedit : function (e)
1510 if(e.field != 'ipshead_ipsitem_price'){
1518 //_this.dialog = Pman.Dialog.FILL_IN
1519 if (_this.lpanel.active) {
1520 this.footer.onClick('first');
1523 afteredit : function (e)
1525 if(e.originalValue == e.value){
1529 var id = _this.form.findField('item_id').getValue() * 1;
1536 url : baseURL + '/Roo/ipsiteminfo',
1539 ipsitem_ipshead_id : e.record.data.ipshead_id,
1540 ipsitem_item_id : id,
1541 ipsitem_price : e.record.data.ipshead_ipsitem_price,
1542 ipsitem_id : e.record.data.ipshead_ipsitem_id
1561 title : "Price List",
1562 xtype : 'GridPanel',
1563 fitContainer : true,
1565 tableName : 'ipshead',
1567 activate : function() {
1568 _this.lpanel = this;
1570 try { if (MODULE.isBuilder) {
1574 var id = _this.form.findField('item_id').getValue() * 1;
1576 Roo.MessageBox.alert("Save First", "Save the item first, before adding image");
1577 _this.dialog.layout.getRegion('center').showPanel(0);
1582 _this.lgrid.footer.onClick('first');
1596 '|xns' : 'Roo.data',
1597 url : baseURL + '/Roo/itemsrc.php',
1598 xtype : 'HttpProxy',
1603 '|xns' : 'Roo.data',
1606 xtype : 'JsonReader',
1610 'name': 'itemsrc_id',
1614 'name': 'itemsrc_item_id',
1618 'name': 'itemsrc_item_id',
1622 'name': 'itemsrc_vend_id',
1626 'name': 'itemsrc_vend_id',
1630 'name': 'itemsrc_vend_item_number',
1634 'name': 'itemsrc_vend_item_descrip',
1638 'name': 'itemsrc_comments',
1642 'name': 'itemsrc_vend_uom',
1646 'name': 'itemsrc_invvendoruomratio',
1650 'name': 'itemsrc_minordqty',
1654 'name': 'itemsrc_multordqty',
1658 'name': 'itemsrc_leadtime',
1662 'name': 'itemsrc_ranking',
1666 'name': 'itemsrc_active',
1670 'name': 'itemsrc_manuf_name',
1674 'name': 'itemsrc_manuf_item_number',
1678 'name': 'itemsrc_manuf_item_descrip',
1682 'name': 'itemsrc_default',
1686 'name': 'itemsrc_upccode',
1690 totalProperty : 'total'
1692 '|xns' : 'Roo.data',
1695 sortInfo : { field : 'itemsrc_vend_id_vend_name', direction: 'ASC' },
1698 update : function (_self, record, operation)
1703 if (operation != 'commit') {
1706 if (record.data.itemsrc_vend_id * 1 < 1) {
1707 return; // do not save.
1709 if (record.data.itemsrc_id * 1 < 0) {
1710 return; // do not save. -- updating at present...
1713 var p = Roo.apply({}, record.data);
1714 record.set('itemsrc_id', -1);
1717 url : baseURL + '/Roo/Itemsrc',
1720 success: function(res) {
1721 if (record.data.itemsrc_id *1 < 1) {
1722 record.set('itemsrc_id', res.data.itemsrc_id);
1729 beforeload : function (_self, o)
1732 var id = 1 * _this.form.findField('item_id').getValue();
1737 o.params.itemsrc_item_id = id;
1748 xtype : 'PagingToolbar',
1749 emptyMsg : "No itemsrc found",
1752 displayMsg : "Displaying itemsrc{0} - {1} of {2}"
1760 '|xns' : 'Roo.Toolbar',
1763 cls : 'x-btn-text-icon',
1764 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1770 Roo.log("add presed");
1773 var grid = _this.itemsrcgrid;
1775 // uses form defaults or last row value.
1776 var nr = grid.ds.reader.newRow({
1778 itemsrc_item_id : _this.form.findField('item_id').getValue(),
1780 itemsrc_vend_id : 0,
1781 itemsrc_vend_item_number : '',
1782 itemsrc_vend_item_descrip : '',
1783 itemsrc_comments : '',
1784 itemsrc_vend_uom : 'EA',
1785 itemsrc_invvendoruomratio : 1.0,
1786 itemsrc_minordqty : 0,
1787 itemsrc_multordqty : 0,
1788 itemsrc_leadtime : 30,
1789 itemsrc_ranking : 0,
1790 itemsrc_active : true,
1791 itemsrc_manuf_name : '',
1792 itemsrc_manuf_item_number : '',
1793 itemsrc_manuf_item_descrip: '',
1794 itemsrc_default : true,
1795 itemsrc_upccode : ''
1799 grid.ds.insert(0, nr);
1800 grid.startEditing(0, 0); // type..
1808 '|xns' : 'Roo.grid',
1809 autoExpandColumn : 'itemsrc_comments',
1810 xtype : 'EditorGrid',
1820 '|xns' : 'Roo.data',
1821 url : baseURL + '/Roo/vendinfo.php',
1822 xtype : 'HttpProxy',
1827 '|xns' : 'Roo.data',
1830 xtype : 'JsonReader',
1832 fields : [{"name":"id","type":"int"},{"name":"vend_name","type":"string"}],
1833 totalProperty : 'total'
1835 '|xns' : 'Roo.data',
1839 sortInfo : { direction : 'ASC', field: 'id' },
1841 beforeload : function (_self, o){
1842 o.params = o.params || {};
1851 '|xns' : 'Roo.form',
1853 triggerAction : 'all',
1854 forceSelection : true,
1855 selectOnFocus : true,
1857 displayField : 'vend_name',
1858 emptyText : "Select Vendor",
1859 hiddenName : 'itemsrc_vend_id',
1861 valueField : 'vend_id',
1868 name : 'itemsrc_vend_id_vend_name',
1869 qtip : "Select vendinfo",
1870 queryParam : 'q[search]',
1871 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{vend_name}</b> </div>',
1872 loadingText : "Searching...",
1878 '|xns' : 'Roo.grid',
1879 xtype : 'GridEditor',
1886 '|xns' : 'Roo.grid',
1887 xtype : 'ColumnModel',
1890 renderer : function(v,x,r) { return String.format('{0}', r.data.itemsrc_vend_id_vend_name); },
1892 dataIndex : 'itemsrc_vend_id',
1901 '|xns' : 'Roo.form',
1902 xtype : 'TextField',
1905 '|xns' : 'Roo.grid',
1906 xtype : 'GridEditor',
1913 '|xns' : 'Roo.grid',
1914 xtype : 'ColumnModel',
1916 header : 'Vendor Ref#',
1917 renderer : function(v) { return String.format('{0}', v); },
1919 dataIndex : 'itemsrc_vend_item_number',
1928 '|xns' : 'Roo.form',
1929 xtype : 'TextField',
1932 '|xns' : 'Roo.grid',
1933 xtype : 'GridEditor',
1940 '|xns' : 'Roo.grid',
1941 xtype : 'ColumnModel',
1943 header : 'Comments',
1944 renderer : function(v) { return String.format('{0}', v); },
1946 dataIndex : 'itemsrc_comments',
1953 '|xns' : 'Roo.grid',
1954 xtype : 'ColumnModel',
1957 renderer : function(v) { return String.format('{0}', v); },
1959 dataIndex : 'itemsrc_vend_uom'
1964 '|xns' : 'Roo.form',
1966 xtype : 'NumberField',
1967 decimalPrecision : 0,
1970 '|xns' : 'Roo.grid',
1971 xtype : 'GridEditor',
1978 '|xns' : 'Roo.grid',
1980 xtype : 'ColumnModel',
1983 renderer : function(v) { return String.format('{0}', v); },
1985 dataIndex : 'itemsrc_minordqty',
1994 '|xns' : 'Roo.form',
1996 xtype : 'NumberField',
1997 decimalPrecision : 0,
2000 '|xns' : 'Roo.grid',
2001 xtype : 'GridEditor',
2008 '|xns' : 'Roo.grid',
2010 xtype : 'ColumnModel',
2011 header : 'Lead time',
2013 renderer : function(v) { return String.format('{0}', v); },
2015 dataIndex : 'itemsrc_leadtime',
2022 '|xns' : 'Roo.grid',
2023 xtype : 'ColumnModel',
2026 renderer : function(v) { return String.format('{0}', v); },
2028 dataIndex : 'itemsrc_active'
2032 rowdblclick : function (_self, rowIndex, e)
2034 if (!_this.dialog) return;
2035 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
2036 _this.grid.footer.onClick('first');
2041 _this.itemsrcgrid = this;
2042 //_this.dialog = Pman.Dialog.FILL_IN
2045 afteredit : function (e)
2059 title : "Suppliers",
2060 xtype : 'GridPanel',
2061 fitContainer : true,
2063 tableName : 'itemsrc',
2065 activate : function() {
2066 _this.itemsrcpanel = this;
2067 if (_this.itemsrcgrid) {
2068 _this.itemsrcgrid.footer.onClick('first');
2081 '|xns' : 'Roo.data',
2082 url : baseURL + '/Roo/events.php',
2084 xtype : 'HttpProxy',
2088 '|xns' : 'Roo.data',
2091 xtype : 'JsonReader',
2094 'name': 'event_when',
2106 'name': 'person_id_name',
2115 totalProperty : 'total'
2117 '|xns' : 'Roo.data',
2120 sortInfo : { field : 'event_when', direction: 'DESC' },
2123 beforeload : function (_self, options)
2125 options.params = options.params || {};
2127 options.params.on_table = 'item';
2128 options.params.on_id = _this.form.findField('item_id').getValue();
2139 xtype : 'PagingToolbar',
2140 emptyMsg : "No Events found",
2142 displayMsg : "Displaying events{0} - {1} of {2}",
2145 '|xns' : 'Roo.grid',
2146 autoExpandColumn : 'remarks',
2152 '|xns' : 'Roo.grid',
2153 xtype : 'ColumnModel',
2156 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
2158 dataIndex : 'event_when'
2161 '|xns' : 'Roo.grid',
2162 xtype : 'ColumnModel',
2165 renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); },
2167 dataIndex : 'action'
2170 '|xns' : 'Roo.grid',
2171 xtype : 'ColumnModel',
2173 header : 'IP Address',
2174 renderer : function(v) { return String.format('{0}', v); },
2176 dataIndex : 'ipaddr'
2179 '|xns' : 'Roo.grid',
2180 xtype : 'ColumnModel',
2183 renderer : function(v) { return String.format('{0}', v); },
2185 dataIndex : 'person_id_name'
2188 '|xns' : 'Roo.grid',
2189 xtype : 'ColumnModel',
2192 renderer : function(v) { return String.format('{0}', v); },
2194 dataIndex : 'remarks'
2201 if (_this.hpanel.active) {
2202 this.footer.onClick('first');
2216 xtype : 'GridPanel',
2217 fitContainer : true,
2219 tableName : 'events',
2221 activate : function() {
2222 _this.hpanel = this;
2224 _this.hgrid.footer.onClick('first');