1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.XtupleSalesOrder = new Roo.XComponent({
10 'fdb35c1a9883acaa94378144a114dfe6' :"Cust. PO#",
11 'a8929eb5c1553d3f70497f862d25d0ce' :"Select Action",
12 '3bd9a9f36601eeb35d5afce4dcfbfce5' :"No cohead found",
13 '6f1bf85c9ebb3c7fa26251e1e335e032' :"Terms",
14 'd2fd3c49554ebcce7e57b85dfa682160' :"Displaying cohead{0} - {1} of {2}",
15 '72d6d7a1885885bb55a565fd1070581a' :"Import",
16 '36dc4ac22a9c9aa45d359e55937499da' :"as PDF",
17 '051f291b80c3336fc75368454ca2a8d2' :"Import HSBC csv file",
18 'f313afd5710eeea203821d3201cc27d8' :"Email to warehouse",
19 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
20 'd1228f5476d15142b1358ae4b5fa2454' :"Order #",
21 'bf2234cf486127ba73efe4b2986eed78' :"Customer Statement",
22 'bcc3c81377e8aef6878f3048ad3e1845' :"cohead",
23 'be99bd9be2f6204e18d9be098b1cec84' :"AR Aging",
24 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
25 'ce26601dac0dea138b7295f02b7620a7' :"Customer",
26 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
27 '3f7488c396d3d4e015d8886452db4110' :"Staff IC.",
28 '4351cfebe4b61d8aa5efa1d020710005' :"View",
29 'f38ab62162b94b4978679aeca58a270c' :"Select Order",
30 '8f3e1295a3a1d30b6ee5d8de6e0b8c0a' :"as Excel",
31 '13348442cc6a27032d2b4aa28b75a5d3' :"Search",
32 '26e09a1ee1517389c7b07f42df65561a' :"Ordered",
33 '8db91c5e3376bc85414ebca9c53fb53f' :"MYOPEN",
34 '904062c33353866aa5234f35ed29e114' :"Download Results",
35 '959462c653dede23e7152b97b45a8aa5' :"Clear Unpaid Orders",
36 '3e208ad5d41ca414bb432adbb7d39c33' :"View type",
37 '4d02be4779719ea23232946e4a34aa82' :"Magento Upload",
38 '74002cb040b036511b8d031da591364a' :"Ship to",
39 '5da618e8e4b89c66fe86e32cdafde142' :"From",
40 'ebe043e4c90950fe50c8a95d96af10f5' :"Quick Stock Check",
41 '54ca6e7fdb43298ae82cd9cb04e77f9b' :"#order",
42 'c91c7b93c28cd18741b71f727ee81ee3' :"Reports",
43 '96b0141273eabab320119c467cdcaf17' :"Total",
44 '99360e60ce244a99256c131555f20d4e' :"Sales Orders",
45 '1c5b744a085a30924e4436c89a79027e' :"Complete and Close",
46 'a2fdeac60e3c5b6c51a92e027fb9d533' :"Target Delivery",
47 '5fb63579fc981698f97d55bfecb213ea' :"Copy",
48 'b155bf2beaeeb2018389eded7c74b56f' :"Customer History",
49 'b0ca9fe87723f63f290ec66b891ec9ee' :"Import Waybill Delivery",
50 '2d899459cc25ea99ea2573d592860ec8' :"Customer#",
51 'fce6d3795b41b54dc0dab82df50517c1' :"Select custinfo",
52 'e12167aa0a7698e6ebc92b4ce3909b53' :"To",
53 'd720bb04db44a8269a09bea3b90352f4' :"Summary Excel",
54 'f4c6f851b00d5518bf888815de279aba' :"Notes"
57 part : ["Xtuple", "SalesOrder" ],
58 order : '001-Pman.Tab.XtupleSalesOrder',
60 parent : 'Pman.Tab.XtupleSales',
61 name : "unnamed module",
70 title : _this._strings['99360e60ce244a99256c131555f20d4e'] /* Sales Orders */,
73 xtype : 'NestedLayoutPanel',
75 activate : function (_self)
77 this.setTitle('Sales Orders (' + Pman.Login.authUser.dbname +')');
83 xtype : 'BorderLayout',
87 xtype : 'LayoutRegion'
91 title : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
95 xtype : 'LayoutRegion'
100 builderCfg : '{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
104 tableName : 'cohead',
105 title : _this._strings['bcc3c81377e8aef6878f3048ad3e1845'] /* cohead */,
110 activate : function() {
113 _this.grid.footer.onClick('first');
118 autoExpandColumn : 'cohead_cust_id_cust_name',
128 _this.dialog = Pman.Dialog.XtupleSalesOrder;
130 if (_this.panel.active) {
131 this.footer.onClick('first');
134 rowdblclick : function (_self, rowIndex, e)
136 if (!_this.dialog) return;
137 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
138 _this.grid.footer.onClick('refresh');
139 Pman.Tab.XtupleSales.grid.footer.onClick('first');
145 displayMsg : _this._strings['d2fd3c49554ebcce7e57b85dfa682160'] /* Displaying cohead{0} - {1} of {2} */,
146 emptyMsg : _this._strings['3bd9a9f36601eeb35d5afce4dcfbfce5'] /* No cohead found */,
150 xtype : 'PagingToolbar',
153 cls : 'x-btn-text-icon',
154 icon : rootURL + '/Pman/templates/images/spreadsheet.gif',
155 text : _this._strings['904062c33353866aa5234f35ed29e114'] /* Download Results */,
157 '|xns' : 'Roo.Toolbar',
180 text : _this._strings['ebe043e4c90950fe50c8a95d96af10f5'] /* Quick Stock Check */,
182 '|xns' : 'Roo.Toolbar',
185 click : function (_self, e)
187 Pman.Dialog.XtupleInvHistory.show({
195 text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
197 '|xns' : 'Roo.Toolbar',
205 text : _this._strings['4d02be4779719ea23232946e4a34aa82'] /* Magento Upload */,
210 click : function (_self, e)
212 Pman.Dialog.Image.show(
214 _url : baseURL+'/Xtuple/Import/Magento',
219 Roo.MessageBox.alert("Notice", data);
220 _this.grid.footer.onClick('first');
228 text : _this._strings['051f291b80c3336fc75368454ca2a8d2'] /* Import HSBC csv file */,
233 click : function (_self, e)
235 Pman.Dialog.XtupleUploadHSBC.show( {} , function(res) {
236 Pman.Dialog.Image.show({
238 _url : baseURL + '/Xtuple/Import/HSBC?' + Roo.urlEncode(res)
240 Roo.MessageBox.alert('Success', data);
241 _this.grid.footer.onClick('first');
248 text : _this._strings['b0ca9fe87723f63f290ec66b891ec9ee'] /* Import Waybill Delivery */,
253 click : function (_self, e)
255 Pman.Dialog.Image.show(
257 _url : baseURL+'/Xtuple/Import/WayBill',
262 Roo.MessageBox.alert("Notice", data);
263 _this.grid.footer.onClick('first');
273 cls : 'x-btn-text-icon',
274 icon : rootURL + '/Pman/templates/images/spreadsheet.gif',
275 text : _this._strings['c91c7b93c28cd18741b71f727ee81ee3'] /* Reports */,
277 '|xns' : 'Roo.Toolbar',
285 text : _this._strings['be99bd9be2f6204e18d9be098b1cec84'] /* AR Aging */,
295 text : _this._strings['36dc4ac22a9c9aa45d359e55937499da'] /* as PDF */,
300 click : function (_self, e)
302 var from = _this.form.findField('_fromdate').getValue();
303 var to = _this.form.findField('_todate').getValue();
306 Roo.Msg.alert('Error', 'Please select a date range for the report');
312 filename : 'ARAging-' + to.format('Y-m-d'),
313 'param[0]': "startDate:string='" + from.format('Y-m-d') + "'",
314 'param[1]': "relDate:string='" + to.format('Y-m-d') + "'",
315 'param[2]': "useDocDate:number=1"
317 var cust_id = _this.form.findField('cohead_cust_id').getValue();
318 if (cust_id * 1 > 0) {
319 params['param[3]'] = 'cust_id:number=' + cust_id;
323 url : baseURL + '/Xtuple/Print',
327 Roo.MessageBox.alert("Notice", "Report will download shortly");
332 text : _this._strings['8f3e1295a3a1d30b6ee5d8de6e0b8c0a'] /* as Excel */,
337 click : function (_self, e)
339 var from = _this.form.findField('_fromdate').getValue();
340 var to = _this.form.findField('_todate').getValue();
345 '_group' : 'arAging',
349 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,
350 'relDate:text' : to ? to.format('Y-m-d') : '2100-01-01',
354 'useDocDate:text' : 'TRUE',
360 var cust_id = _this.form.findField('cohead_cust_id').getValue();
361 if (cust_id * 1 > 0) {
362 params['cust_id:number'] = cust_id;
365 new Pman.Download({
\r
366 url : baseURL + '/Roo/Metasql',
\r
370 Roo.MessageBox.alert("Notice", "Report will download shortly");
\r
376 text : _this._strings['d720bb04db44a8269a09bea3b90352f4'] /* Summary Excel */,
381 click : function (_self, e)
383 var from = _this.form.findField('_fromdate').getValue();
384 var to = _this.form.findField('_todate').getValue();
389 '_group' : 'arAging',
395 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,
396 'relDate:text' : to ? to.format('Y-m-d') : '2100-01-01',
399 'useDocDate:text' : 'TRUE',
404 var cust_id = _this.form.findField('cohead_cust_id').getValue();
405 if (cust_id * 1 > 0) {
406 params['cust_id:number'] = cust_id;
409 new Pman.Download({
\r
410 url : baseURL + '/Roo/Metasql',
\r
414 Roo.MessageBox.alert("Notice", "Report will download shortly");
\r
423 text : _this._strings['b155bf2beaeeb2018389eded7c74b56f'] /* Customer History */,
433 text : _this._strings['36dc4ac22a9c9aa45d359e55937499da'] /* as PDF */,
438 click : function (_self, e)
440 var cust_id = _this.form.findField('cohead_cust_id').getValue();
441 if (cust_id * 1 < 1) {
442 Roo.Msg.alert('Error', 'Please select a customer');
446 var from = _this.form.findField('_fromdate').getValue();
447 var to = _this.form.findField('_todate').getValue();
450 Roo.Msg.alert('Error', 'Please select a date range for the report');
455 template: 'customer_ar_history',
456 filename : 'customer_ar_history-' + to.format('Y-m-d'),
457 'param[0]': "startDate:string='" + from.format('Y-m-d') + "'",
458 'param[1]': "endDate:string='" + to.format('Y-m-d') + "'",
459 'param[2]': "cust_id:number=" + cust_id
463 url : baseURL + '/Xtuple/Print',
467 Roo.MessageBox.alert("Notice", "Report will download shortly");
472 text : _this._strings['8f3e1295a3a1d30b6ee5d8de6e0b8c0a'] /* as Excel */,
477 click : function (_self, e)
479 var cust_id = _this.form.findField('cohead_cust_id').getValue();
480 if (cust_id * 1 < 1) {
481 Roo.Msg.alert('Error', 'Please select a customer');
485 var from = _this.form.findField('_fromdate').getValue();
486 var to = _this.form.findField('_todate').getValue();
491 '_group' : 'customerHistory',
495 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,
496 'endDate:text' : to ? to.format('Y-m-d') : '2100-01-01',
498 'cust_id:number' : cust_id,
504 new Pman.Download({
\r
505 url : baseURL + '/Roo/Metasql',
\r
509 Roo.MessageBox.alert("Notice", "Report will download shortly");
517 text : _this._strings['bf2234cf486127ba73efe4b2986eed78'] /* Customer Statement */,
527 text : _this._strings['36dc4ac22a9c9aa45d359e55937499da'] /* as PDF */,
532 click : function (_self, e)
534 var cust_id = _this.form.findField('cohead_cust_id').getValue();
535 if (cust_id * 1 < 1) {
536 Roo.Msg.alert('Error', 'Please select a customer');
540 var from = _this.form.findField('_fromdate').getValue();
541 var to = _this.form.findField('_todate').getValue();
546 template: 'customer_ar_statement',
547 filename : 'customer_ar_statement-' +(to ? to.format('Y-m-d') : '2100-01-01'),
548 'param[0]': "startDate:string='" + (from ? from.format('Y-m-d') : '2000-01-01') + "'",
549 'param[1]': "asofdate:string='" + (to ? to.format('Y-m-d') : '2100-01-01')+ "'",
550 'param[2]': "cust_id:number=" + cust_id
554 url : baseURL + '/Xtuple/Print',
558 Roo.MessageBox.alert("Notice", "Report will download shortly");
563 text : _this._strings['8f3e1295a3a1d30b6ee5d8de6e0b8c0a'] /* as Excel */,
568 click : function (_self, e)
570 var cust_id = _this.form.findField('cohead_cust_id').getValue();
571 if (cust_id * 1 < 1) {
572 Roo.Msg.alert('Error', 'Please select a customer');
576 var from = _this.form.findField('_fromdate').getValue();
577 var to = _this.form.findField('_todate').getValue();
580 // Roo.Msg.alert('Error', 'Please select a date range for the report');
585 '_group' : 'customerStatement',
588 'startDate:text' : from ? from.format('Y-m-d') : '2000-01-01' ,
589 'asofdate:text' : to ? to.format('Y-m-d') : '2100-01-01',
590 'cust_id:number' : cust_id,
596 new Pman.Download({
\r
597 url : baseURL + '/Roo/Metasql',
\r
601 Roo.MessageBox.alert("Notice", "Report will download shortly");
612 cls : 'x-btn-text-icon',
613 icon : Roo.rootURL + 'images/default/dd/email.gif',
614 text : _this._strings['f313afd5710eeea203821d3201cc27d8'] /* Email to warehouse */,
616 '|xns' : 'Roo.Toolbar',
619 click : function (_self, e)
621 var sels = _this.grid.getSelectionModel().getSelections();
624 Roo.MessageBox.alert("Error", "Select an order");
628 for (var i =0; i < sels.length; i++) {
631 if(s.data.cohead_qtyuninvoiced * 1 > 0){
632 Roo.MessageBox.alert("Error", "Order has not been invoiced! - " + s.data.cohead_number);
636 if(s.data.aropen_unpaid * 1 > 0){
637 Roo.MessageBox.alert("Error", "Order has not been paid! - " + s.data.cohead_number);
640 ids.push(s.data.cohead_id);
643 new Pman.Download({
\r
644 url : baseURL + '/Xtuple/Reports/SalesOrderBookingDetail',
\r
646 cohead_id : ids.join(',')
651 Roo.MessageBox.alert("Notice", "Report will download shortly");
656 cls : 'x-btn-text-icon',
657 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
658 text : _this._strings['1c5b744a085a30924e4436c89a79027e'] /* Complete and Close */,
660 '|xns' : 'Roo.Toolbar',
665 var s = _this.grid.getSelectionModel().getSelected();
667 Roo.MessageBox.alert("Error", "Select an order to close");
671 if(s.data.cohead_status == 'C'){
672 Roo.MessageBox.alert("Error", "This order has been closed");
676 Roo.MessageBox.confirm("Confirm", "Are you sure?",
682 url: baseURL + '/Roo/cohead',
685 cohead_id : s.data.cohead_id,
691 Roo.MessageBox.alert("Notice", "DONE");
692 _this.grid.footer.onClick('first');
703 cls : 'x-btn-text-icon',
704 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
705 text : _this._strings['959462c653dede23e7152b97b45a8aa5'] /* Clear Unpaid Orders */,
707 '|xns' : 'Roo.Toolbar',
714 url: baseURL + '/Roo/cohead',
722 Roo.MessageBox.alert("Notice", "DONE");
723 _this.grid.footer.onClick('first');
732 '|xns' : 'Roo.Toolbar',
736 cls : 'x-btn-text-icon',
737 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
738 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
740 '|xns' : 'Roo.Toolbar',
745 // check if the login in user have more than 25 open orders..
746 // if yes, warning...
748 url : baseURL + '/Roo/cohead.php',
752 _count_order : 1 // make the search faster!
754 success : function(res) {
755 if(res.data[0].order_totals * 1 > 25){
756 Roo.MessageBox.alert("Warning", "Can you please close old orders before creating new ones");
761 Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() {
762 _this.grid.footer.onClick('first');
768 cls : 'x-btn-text-icon',
769 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
770 text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
772 '|xns' : 'Roo.Toolbar',
777 var s = _this.grid.getSelectionModel().getSelected();
779 Roo.MessageBox.alert("Error", "Select an order to copy");
784 Pman.Dialog.XtupleSalesOrderCopy.show( { _copy_cohead_id : s.data.cohead_id } , function(data) {
786 // get the id from the data, then
788 _this.grid.footer.onClick('first');
789 Pman.Tab.XtupleSales.grid.footer.onClick('first');
790 // get the id from the data, then start editing it..
792 _this.dialog.show(data, function() {
793 _this.grid.footer.onClick('refresh');
794 Pman.Tab.XtupleSales.grid.footer.onClick('first');
804 builderCfg : '{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
806 sortInfo : { field : 'cohead_orderdate', direction: 'DESC' },
811 beforeload : function (_self, options)
815 vl = _this.form.getFieldValues();
823 if (!(new String(vl[x])).length) {
826 options.params[x] = vl[x];
830 if (options.params['query[cohead_number]'].length) {
831 options.params.viewtype = 'REALALL';
839 url : baseURL + '/Roo/cohead.php',
845 builderCfg : '{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#order\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\"],\"table\":\"cohead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
848 'name': 'cohead_number',
852 'name': 'cohead_cust_id_cust_name',
856 'name': 'cohead_custponumber',
860 'name': 'cohead_type'
863 'name': 'cohead_orderdate',
867 'name': 'cohead_shipto_id_shipto_name',
871 'name': 'cohead_terms_id_terms_descrip',
875 'name': 'cohead_curr_id_curr_name',
881 totalProperty : 'total',
889 builderCfg : '{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}',
890 dataIndex : 'cohead_orderdate',
891 header : _this._strings['26e09a1ee1517389c7b07f42df65561a'] /* Ordered */,
892 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
897 xtype : 'ColumnModel'
900 dataIndex : 'cohead_targetdate',
901 header : _this._strings['a2fdeac60e3c5b6c51a92e027fb9d533'] /* Target Delivery */,
903 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
908 xtype : 'ColumnModel'
911 builderCfg : '{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}',
912 dataIndex : 'cohead_salesrep_id_salesrep_name',
913 header : _this._strings['3f7488c396d3d4e015d8886452db4110'] /* Staff IC. */,
914 renderer : function(v,x,r) {
916 if (r.data.cohead_display_salesrep_id) {
917 return String.format('{0} ({1})', v, r.data.cohead_display_salesrep_id_salesrep_name);
919 return String.format('{0}', v );
927 xtype : 'ColumnModel'
930 dataIndex : 'cohead_number',
931 header : _this._strings['54ca6e7fdb43298ae82cd9cb04e77f9b'] /* #order */,
932 renderer : function(v,x,r) {
935 // we want to show more detail about status..
936 // like payment status / delivery etc...
940 // S = shipped (or partial shipped)
941 // P = paid (or partial paid)
942 // online payment failed? >> on terms?
945 invoiced : '<span class="dragon-so-complete" qtip="Invoiced">I</span>',
946 invoiced_not : '<span class="dragon-so-complete-not" qtip="Not Invoiced">I</span>',
947 stock_not : '<span class="dragon-so-complete-not" qtip="Stock not reserved or shipped">S</span>',
948 stock_reserved : '<span class="dragon-so-complete-part" qtip="Stock Reserved / Not shipped">R</span>',
949 stock_shipped : '<span class="dragon-so-complete" qtip="Shipped">S</span>',
950 paid : '<span class="dragon-so-complete" qtip="Paid">P</span>',
951 paid_not : '<span class="dragon-so-complete-not" qtip="Not Paid">P</span>'
958 if (r.data.cohead_qtyunshipped > 0) {
960 tg += (r.data.shipitem_qty*1 > 0) ? tags.stock_reserved :tags.stock_not;
963 tg += tags.stock_shipped;
966 tg += (r.data.cohead_qtyuninvoiced > 0) ? tags.invoiced_not : tags.invoiced;
967 // ?? partially invoiced??
970 if (r.data.cohead_qtyuninvoiced*1 < 1) {
971 tg += (r.data.aropen_unpaid*1 > 0) ? tags.paid_not : tags.paid;
978 if (r.data.cohead_status == 'C') {
979 return tg + ' ' + String.format('<i qtip="closed">{0}</i>', v);
981 if (r.data.cohead_status == 'X') {
982 return tg + ' ' + String.format('<s qtip="void">{0}</s>', v) ;
984 return tg + ' ' + String.format('{0}', v);
990 xtype : 'ColumnModel'
993 builderCfg : '{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}',
994 dataIndex : 'cohead_cust_id_cust_number',
995 header : _this._strings['2d899459cc25ea99ea2573d592860ec8'] /* Customer# */,
996 renderer : function(v) { return String.format('{0}', v); },
1000 '|xns' : 'Roo.grid',
1001 xtype : 'ColumnModel'
1004 builderCfg : '{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}',
1005 dataIndex : 'cohead_cust_id_cust_name',
1006 header : _this._strings['ce26601dac0dea138b7295f02b7620a7'] /* Customer */,
1007 renderer : function(v) { return String.format('{0}', v); },
1011 '|xns' : 'Roo.grid',
1012 xtype : 'ColumnModel'
1015 builderCfg : '{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust. PO#\"}',
1016 dataIndex : 'cohead_custponumber',
1017 header : _this._strings['fdb35c1a9883acaa94378144a114dfe6'] /* Cust. PO# */,
1018 renderer : function(v) { return String.format('{0}', v); },
1021 '|xns' : 'Roo.grid',
1022 xtype : 'ColumnModel'
1025 builderCfg : '{\"table\":\"cohead\",\"column\":\"cohead_type\",\"columnshort\":\"cohead_type\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Type\"}',
1026 dataIndex : 'cohead_type',
1027 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1028 renderer : function(v) { return String.format('{0}', v); },
1031 '|xns' : 'Roo.grid',
1032 xtype : 'ColumnModel'
1035 dataIndex : 'cohead_src_locations',
1036 header : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
1037 renderer : function(v) { return String.format('{0}', v); },
1040 '|xns' : 'Roo.grid',
1041 xtype : 'ColumnModel'
1044 builderCfg : '{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\"}',
1045 dataIndex : 'cohead_shiptoaddress1',
1046 header : _this._strings['74002cb040b036511b8d031da591364a'] /* Ship to */,
1047 renderer : function(v) { return String.format('{0}', v); },
1050 '|xns' : 'Roo.grid',
1051 xtype : 'ColumnModel'
1054 builderCfg : '{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\"}',
1055 dataIndex : 'cohead_terms_id_terms_descrip',
1056 header : _this._strings['6f1bf85c9ebb3c7fa26251e1e335e032'] /* Terms */,
1057 renderer : function(v) { return String.format('{0}', v); },
1060 '|xns' : 'Roo.grid',
1061 xtype : 'ColumnModel'
1064 dataIndex : 'cohead_ordercomments',
1065 header : _this._strings['f4c6f851b00d5518bf888815de279aba'] /* Notes */,
1067 renderer : function(v) { return String.format('{0}', v); },
1070 '|xns' : 'Roo.grid',
1071 xtype : 'ColumnModel'
1075 dataIndex : 'cohead_total',
1076 header : _this._strings['96b0141273eabab320119c467cdcaf17'] /* Total */,
1077 renderer : function(v,x,r) {
1078 var ret = String.format('{0} {1}',
1079 r.data.cohead_curr_id_curr_name, v ? parseFloat(v).toFixed(3) : '---'
1082 if (parseInt(r.data.cohead_qtyordered) != 0 &&
1083 parseInt(r.data.cohead_unshipped) == 0 &&
1084 parseInt(r.data.cohead_qtyunshipped) == 0 &&
1085 parseInt(r.data.cohead_qtyuninvoiced) == 0 &&
1086 parseInt(r.data.cohead_unshipped) == 0 &&
1087 parseInt(r.data.cohead_uninvoiced) == 0
1092 return String.format('<b style="color:red" ' +
1093 'qtip="Products: {3} ({4}) <BR/>Unshipped: {1} ({5})<BR>Uninvoiced: {2} ({6})">{0}</b>',
1095 r.data.cohead_unshipped, r.data.cohead_uninvoiced, r.data.cohead_subtotal,
1096 r.data.cohead_qtyordered, r.data.cohead_qtyunshipped, r.data.cohead_qtyuninvoiced
1102 '|xns' : 'Roo.grid',
1103 xtype : 'ColumnModel'
1113 xtype : 'ContentPanel',
1121 '|xns' : 'Roo.Toolbar',
1126 icon : rootURL + '/Pman/templates/images/search.gif',
1128 '|xns' : 'Roo.Toolbar',
1131 click : function (_self, e)
1133 _this.grid.footer.onClick('first');
1139 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
1141 '|xns' : 'Roo.Toolbar',
1144 click : function (_self, e)
1146 _this.form.reset('');
1149 _this.grid.footer.onClick('first');
1159 style : 'margin:5px;',
1161 '|xns' : 'Roo.form',
1164 rendered : function (form)
1172 displayField : 'value',
1174 emptyText : _this._strings['3e208ad5d41ca414bb432adbb7d39c33'] /* View type */,
1175 fieldLabel : _this._strings['4351cfebe4b61d8aa5efa1d020710005'] /* View */,
1176 forceSelection : true,
1178 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1182 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
1183 queryParam : 'query[action]',
1184 selectOnFocus : true,
1185 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
1186 triggerAction : 'all',
1188 value : _this._strings['8db91c5e3376bc85414ebca9c53fb53f'] /* MYOPEN */,
1192 '|xns' : 'Roo.form',
1195 render : function (_self)
1197 _this.viewtypeSel = _self;
1199 select : function (combo, record, index)
1201 _this.grid.footer.onClick('first');
1206 [ 'MYOPEN', 'My Open orders' ],
1207 [ 'MYCLOSED', 'My Closed orders' ],
1208 [ 'MYALL', 'My orders (all)' ],
1209 [ 'MYVOID', 'My Voided orders' ],
1210 [ 'OPEN', 'All Open orders' ],
1211 [ 'NOTSHIPPED', 'All Un-shipped orders' ],
1212 [ 'NOTPAID', 'All Un-paid orders' ],
1213 [ 'PAIDNOTSHIPPED', 'All paid / not shipped orders' ],
1214 [ 'CLOSED', 'All Closed orders' ],
1216 [ 'ALL', 'All orders' ],
1217 [ 'VOID', 'Voided orders' ],
1218 [ 'INCOMPLETE', 'Incomplete orders' ],
1219 [ 'DRAFTSHIP', 'Have Un-confirmed Shipments' ],
1220 // [ 'SHIPPOSTBUG', 'Bugs with Posted transactions' ],
1221 // [ 'SHIPQTYBUG', 'Bugs with Shipment Qty' ] ,
1222 [ 'FIFOBUG', 'Problems with FIFO' ]
1225 fields : [ 'key', 'value' ],
1228 '|xns' : 'Roo.data',
1229 xtype : 'SimpleStore'
1234 displayField : 'cohead_number',
1236 emptyText : _this._strings['f38ab62162b94b4978679aeca58a270c'] /* Select Order */,
1237 fieldLabel : _this._strings['d1228f5476d15142b1358ae4b5fa2454'] /* Order # */,
1238 forceSelection : false,
1240 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1242 name : 'query[cohead_number]',
1244 qtip : _this._strings['f38ab62162b94b4978679aeca58a270c'] /* Select Order */,
1245 queryParam : 'query[cohead_number]',
1246 selectOnFocus : true,
1247 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{cohead_number}</b> </div>',
1248 triggerAction : 'all',
1250 valueField : 'cohead_number',
1253 '|xns' : 'Roo.form',
1256 beforequery : function (combo, query, forceAll, cancel, e)
1259 if( _this.rsearch) {
1260 _this.rsearch =false;
1265 select : function (combo, record, index)
1267 (function() { _this.grid.footer.onClick('first'); }).defer(100);
1269 specialkey : function (_self, e)
1271 //Roo.log(e.getKey());
1272 if (e.getKey() == 13) {
1273 (function() { _this.grid.footer.onClick('first'); }).defer(100);
1275 _this.rsearch = true;
1282 sortInfo : { direction : 'ASC', field: 'cohead_number' },
1284 '|xns' : 'Roo.data',
1287 beforeload : function (_self, o){
1288 o.params = o.params || {};
1289 o.params['_columns'] = 'cohead_number';
1295 url : baseURL + '/Roo/cohead.php',
1297 '|xns' : 'Roo.data',
1301 fields : ["cohead_number"],
1302 id : 'cohead_number',
1304 totalProperty : 'total',
1306 '|xns' : 'Roo.data',
1307 xtype : 'JsonReader'
1313 displayField : 'cust_name',
1315 emptyText : _this._strings['fce6d3795b41b54dc0dab82df50517c1'] /* Select custinfo */,
1316 fieldLabel : _this._strings['ce26601dac0dea138b7295f02b7620a7'] /* Customer */,
1317 forceSelection : true,
1318 hiddenName : 'cohead_cust_id',
1320 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1322 name : 'cohead_cust_id_cust_name',
1324 qtip : _this._strings['fce6d3795b41b54dc0dab82df50517c1'] /* Select custinfo */,
1325 queryParam : 'query[cust_name]',
1326 selectOnFocus : true,
1327 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> ({cust_number})</div>',
1328 triggerAction : 'all',
1330 valueField : 'cust_id',
1333 '|xns' : 'Roo.form',
1336 select : function (combo, record, index)
1338 (function() { _this.grid.footer.onClick('first'); }).defer(100);
1343 sortInfo : { direction : 'ASC', field: 'cust_name' },
1345 '|xns' : 'Roo.data',
1348 beforeload : function (_self, o){
1349 o.params = o.params || {};
1355 url : baseURL + '/Roo/custinfo.php',
1357 '|xns' : 'Roo.data',
1361 fields : [{"name":"cust_id","type":"int"},"cust_name"],
1364 totalProperty : 'total',
1366 '|xns' : 'Roo.data',
1367 xtype : 'JsonReader'
1372 fieldLabel : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
1377 '|xns' : 'Roo.form',
1378 xtype : 'DateField',
1380 select : function (combo, date)
1382 _this.grid.footer.onClick('first');
1387 fieldLabel : _this._strings['e12167aa0a7698e6ebc92b4ce3909b53'] /* To */,
1392 '|xns' : 'Roo.form',
1393 xtype : 'DateField',
1395 select : function (combo, date)
1397 _this.grid.footer.onClick('first');