first upload
[Pman.Xtuple] / Pman.Tab.XtupleCreditMemos.bjs
1 {
2     "id": "roo-file-313",
3     "name": "Pman.Tab.XtupleCreditMemos",
4     "parent": "Pman.Tab.XtupleSales",
5     "title": "Pman.Tab.XtupleCreditMemos",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCreditMemos.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "cmhead",
17             "title": "Credit Memos",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    var s = this.dataSource.getAt(rowIndex);\n    Pman.Dialog.XtupleCreditMemo.show({\n        cmhead_id : s.data.cmhead_id\n    },function() {\n        _this.grid.footer.onClick('first');\n    \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"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "cmhead_cust_id_cust_name",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "beforeload": "function (_self, o)\n{\n    if ( _this.customer &&  _this.customer.getValue() ) {\n       o.params.cmhead_cust_id = _this.customer.getValue();\n    }\n    if (_this.cmnumber && _this.cmnumber.getValue() ) {\n       o.params.cmhead_id =  _this.cmnumber.getValue();\n    }\n    if (_this.status) { \n        o.params['query[status]'] = _this.status.getValue();\n    }\n    \n    o.params._with_aropen = 1;\n}"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'cmhead_id', direction: 'DESC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/cmhead.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|fields": "[\n    {\n        'name': 'cmhead_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_number',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_posted',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_invcnumber',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_custponumber',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_cust_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_docdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cmhead_shipto_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_shipto_name',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_address1',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_address2',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_address3',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_city',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_state',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_zipcode',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_salesrep_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_freight',\n        'type': 'float'\n    },\n    {\n        'name': 'cmhead_misc',\n        'type': 'float'\n    },\n    {\n        'name': 'cmhead_comments',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_printed',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_billtoname',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_billtoaddress1',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_billtoaddress2',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_billtoaddress3',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_billtocity',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_billtostate',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_billtozip',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_hold',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_commission',\n        'type': 'float'\n    },\n    {\n        'name': 'cmhead_misc_accnt_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_misc_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_rsncode_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_freighttaxtype_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_gldistdate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'cmhead_billtocountry',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_shipto_country',\n        'type': 'string'\n    },\n    {\n        'name': 'cmhead_rahead_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_taxzone_id',\n        'type': 'int'\n    },\n    {\n        'name': 'cmhead_prj_id',\n        'type': 'int'\n    }\n]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "xtype": "PagingToolbar",
63                             "pageSize": 25,
64                             "displayInfo": true,
65                             "displayMsg": "Displaying cmhead{0} - {1} of {2}",
66                             "emptyMsg": "No cmhead found",
67                             "|xns": "Roo"
68                         },
69                         {
70                             "*prop": "toolbar",
71                             "xtype": "Toolbar",
72                             "|xns": "Roo",
73                             "items": [
74                                 {
75                                     "listeners": {
76                                         "render": "function (_self)\n{\n    _this.cmnumber = _self;\n}",
77                                         "select": "function (combo, record, index)\n{\n    Roo.log('select');\n    _this.grid.footer.onClick('first');\n}"
78                                     },
79                                     "allowBlank": true,
80                                     "displayField": "cmhead_number",
81                                     "editable": true,
82                                     "emptyText": "Order",
83                                     "fieldLabel": "ordernumber",
84                                     "forceSelection": true,
85                                     "hiddenName": "cmhead_id",
86                                     "listWidth": 400,
87                                     "loadingText": "Searching...",
88                                     "minChars": 2,
89                                     "name": "cmhead_number",
90                                     "pageSize": 20,
91                                     "qtip": "Select invchead",
92                                     "queryParam": "query[cmhead_number]",
93                                     "selectOnFocus": true,
94                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cmhead_number}</b> </div>",
95                                     "triggerAction": "all",
96                                     "typeAhead": false,
97                                     "valueField": "cmhead_id",
98                                     "width": 150,
99                                     "xtype": "ComboBox",
100                                     "|xns": "Roo.form",
101                                     "items": [
102                                         {
103                                             "listeners": {
104                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
105                                             },
106                                             "*prop": "store",
107                                             "remoteSort": true,
108                                             "xtype": "Store",
109                                             "|sortInfo": "{ direction : 'ASC', field: 'cmhead_number' }",
110                                             "|xns": "Roo.data",
111                                             "items": [
112                                                 {
113                                                     "*prop": "proxy",
114                                                     "method": "GET",
115                                                     "xtype": "HttpProxy",
116                                                     "|url": "baseURL + '/Roo/cmhead.php'",
117                                                     "|xns": "Roo.data"
118                                                 },
119                                                 {
120                                                     "*prop": "reader",
121                                                     "id": "cmhead_id",
122                                                     "root": "data",
123                                                     "totalProperty": "total",
124                                                     "xtype": "JsonReader",
125                                                     "|fields": "[{\"name\":\"cmhead_id\",\"type\":\"int\"},\"cmhead_number\"]",
126                                                     "|xns": "Roo.data"
127                                                 }
128                                             ]
129                                         }
130                                     ]
131                                 },
132                                 {
133                                     "listeners": {
134                                         "render": "function (_self)\n{\n    _this.customer = _self;\n}",
135                                         "select": "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
136                                     },
137                                     "allowBlank": true,
138                                     "displayField": "cust_name",
139                                     "editable": true,
140                                     "emptyText": "Select Customer",
141                                     "fieldLabel": "cust_name",
142                                     "forceSelection": true,
143                                     "hiddenName": "cust_id",
144                                     "listWidth": 400,
145                                     "loadingText": "Searching...",
146                                     "minChars": 2,
147                                     "name": "cust_name",
148                                     "pageSize": 20,
149                                     "qtip": "Select custinfo",
150                                     "queryParam": "query[cust_name]",
151                                     "selectOnFocus": true,
152                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> </div>",
153                                     "triggerAction": "all",
154                                     "typeAhead": false,
155                                     "valueField": "cust_id",
156                                     "width": 200,
157                                     "xtype": "ComboBox",
158                                     "|xns": "Roo.form",
159                                     "items": [
160                                         {
161                                             "*prop": "store",
162                                             "|xns": "Roo.data",
163                                             "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
164                                             "xtype": "Store",
165                                             "remoteSort": true,
166                                             "listeners": {
167                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
168                                             },
169                                             "items": [
170                                                 {
171                                                     "*prop": "proxy",
172                                                     "xtype": "HttpProxy",
173                                                     "method": "GET",
174                                                     "|xns": "Roo.data",
175                                                     "|url": "baseURL + '/Roo/custinfo.php'"
176                                                 },
177                                                 {
178                                                     "*prop": "reader",
179                                                     "xtype": "JsonReader",
180                                                     "|xns": "Roo.data",
181                                                     "id": "cust_id",
182                                                     "root": "data",
183                                                     "totalProperty": "total",
184                                                     "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
185                                                 }
186                                             ]
187                                         }
188                                     ]
189                                 },
190                                 {
191                                     "listeners": {
192                                         "render": "function (_self)\n{\n  _this.status = _self;\n}",
193                                         "select": "function (combo, record, index)\n{\n    Roo.log('select');\n    _this.grid.footer.onClick('first');\n}"
194                                     },
195                                     "allowBlank": false,
196                                     "displayField": "fname",
197                                     "editable": false,
198                                     "fieldLabel": "Status",
199                                     "hiddenName": "cm_status",
200                                     "listWidth": 200,
201                                     "mode": "local",
202                                     "name": "cm_status_name",
203                                     "triggerAction": "all",
204                                     "value": "NOTCLOSED",
205                                     "valueField": "ftype",
206                                     "width": 150,
207                                     "xtype": "ComboBox",
208                                     "|xns": "Roo.form",
209                                     "items": [
210                                         {
211                                             "*prop": "store",
212                                             "xtype": "SimpleStore",
213                                             "|data": "[ \n    [ 'NOTCLOSED', \"Not Closed\"],\n    [ 'CLOSED' , \"Closed\"],\n    [ 'UNPOSTED', \"Unposted only\"] ,\n    [ 'UNUSED', \"Posted and not used\"] ,\n    [ 'VOIDED', \"Voided\"] \n]\n",
214                                             "|fields": "[  'ftype', 'fname']",
215                                             "|xns": "Roo.data"
216                                         }
217                                     ]
218                                 },
219                                 {
220                                     "|xns": "Roo.Toolbar",
221                                     "xtype": "Fill"
222                                 },
223                                 {
224                                     "cls": "x-btn-text-icon",
225                                     "text": "Add",
226                                     "xtype": "Button",
227                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
228                                     "|xns": "Roo.Toolbar",
229                                     "items": [
230                                         {
231                                             "|xns": "Roo.menu",
232                                             "xtype": "Menu",
233                                             "*prop": "menu",
234                                             "items": [
235                                                 {
236                                                     "listeners": {
237                                                         "click": "function (_self, e)\n{\n   Pman.Dialog.XtupleCreditMemoNew.show( {} , function() {\n        _this.grid.footer.onClick('first');\n   }); \n\n}"
238                                                     },
239                                                     "cls": "x-btn-text-icon",
240                                                     "text": "New Credit Memo",
241                                                     "xtype": "Item",
242                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
243                                                     "|xns": "Roo.menu"
244                                                 },
245                                                 {
246                                                     "|xns": "Roo.menu",
247                                                     "xtype": "Separator"
248                                                 },
249                                                 {
250                                                     "listeners": {
251                                                         "click": "function (_self, e)\n{\n   var s = _this.grid.getSelectionModel().getSelections();\n\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }    \n    if(s[0].data.checkhead_total == 0){\n        Roo.MessageBox.alert(\"Error\", \"you cannot create the miscellaneous check for the credit memo coz the total amount remaining is 0! \");\n        return;\n    }\n    if(!s[0].data.cmhead_posted){\n        Roo.MessageBox.alert(\"Error\", \"This credit memo  has not been posted!\");\n        return;\n    }\n    var data = {\n        'checkhead_recip_id' : s[0].data.cmhead_cust_id,\n        'checkhead_recip_type' : 'C',\n        'checkhead_checkdate' : new Date(),\n        'checkhead_amount' : s[0].data.checkhead_total,\n        'remaining_total' : s[0].data.checkhead_total,\n        'checkhead_curr_id' : s[0].data.cmhead_curr_id,\n        'checkhead_curr_id_curr_name' : s[0].data.cmhead_curr_id_curr_name,\n        'checkhead_misc' : true,\n        'aropen_id' : s[0].data.cmhead_aropen_id_aropen_id,\n    \t'cmhead_number' : s[0].data.cmhead_number,\n\t'cust_name' : s[0].data.cmhead_cust_id_cust_name,\n\t'_create_and_post' : 1\n\n    };\n    \n    \n    Pman.Dialog.XtupleMiscellaneousCheck.show( data , function() {\n        _this.grid.footer.onClick('first');\n   }); \n\n}"
252                                                     },
253                                                     "cls": "x-btn-text-icon",
254                                                     "text": "New Miscellaneous Check",
255                                                     "xtype": "Item",
256                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
257                                                     "|xns": "Roo.menu"
258                                                 }
259                                             ]
260                                         }
261                                     ]
262                                 },
263                                 {
264                                     "|xns": "Roo.Toolbar",
265                                     "xtype": "Separator"
266                                 },
267                                 {
268                                     "listeners": {
269                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n\n    var postit = function()\n    {\n        new Pman.Request(\n        {\n            url : baseURL + '/Roo/Cmhead',\n            mask: 'Voiding',\n            method : 'POST',\n            params : {\n                cmhead_id : s[0].data.cmhead_id,\n                _void : 1\n            },\n            success : function()\n            {\n                _this.grid.footer.onClick('refresh');\n            } \n        });\n    \n    };\n\n\n    Roo.MessageBox.confirm(\n        \"Confirm\",\n        \"Are you sure to void this credit memo?\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            postit();\n        }\n    );\n    \n}\n"
270                                     },
271                                     "cls": "x-btn-text-icon",
272                                     "text": "Void Credit Memo",
273                                     "xtype": "Button",
274                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
275                                     "|xns": "Roo.Toolbar"
276                                 },
277                                 {
278                                     "|xns": "Roo.Toolbar",
279                                     "xtype": "Separator"
280                                 },
281                                 {
282                                     "listeners": {
283                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (s[0].data.cmhead_posted ) { \n        Roo.MessageBox.alert(\"Error\", \n            \"You can not delete posted credit memo's - you have to create an invoice to reverse them\");\n        return;\n    }\n    \n    \n\n    var postit = function()\n    {\n        new Pman.Request(\n        {\n            url : baseURL + '/Roo/Cmhead',\n            mask: 'Deleting',\n            method : 'POST',\n            params : {\n                _delete  : s[0].data.cmhead_id \n            },\n            success : function()\n            {\n                _this.grid.footer.onClick('refresh');\n            } \n        });\n    \n    };\n\n\n    Roo.MessageBox.confirm(\n        \"Confirm Deletion\",\n        \"You will have to make sure this credit memo has no line items associated before deleting it. \",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            postit();\n        }\n    );\n    \n}\n"
284                                     },
285                                     "cls": "x-btn-text-icon",
286                                     "text": "Delete Credit Memo",
287                                     "xtype": "Button",
288                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
289                                     "|xns": "Roo.Toolbar"
290                                 },
291                                 {
292                                     "|xns": "Roo.Toolbar",
293                                     "xtype": "Separator"
294                                 },
295                                 {
296                                     "listeners": {
297                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n\n    var postit = function()\n    {\n        new Pman.Request(\n        {\n            url : baseURL + '/Roo/Cmhead',\n            mask: 'Posting',\n            method : 'POST',\n            params : {\n                cmhead_id : s[0].data.cmhead_id,\n                _post : 1\n            },\n            success : function()\n            {\n                _this.grid.footer.onClick('refresh');\n            } \n        });\n    \n    };\n\n\n    Roo.MessageBox.confirm(\n        \"Confirm Posting\",\n        \"Are you sure that is complete, <B>Voiding a Credit memo invoices creating a sales order and invoice</B>, so make sure this is correct before posting\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            postit();\n        }\n    ); \n    \n}\n"
298                                     },
299                                     "cls": "x-btn-text-icon",
300                                     "text": "POST",
301                                     "xtype": "Button",
302                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
303                                     "|xns": "Roo.Toolbar"
304                                 },
305                                 {
306                                     "|xns": "Roo.Toolbar",
307                                     "xtype": "Separator"
308                                 },
309                                 {
310                                     "listeners": {
311                                         "click": "function ()\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n      if (!s || !s.data.cmhead_id) {\n        Roo.MessageBox.alert(\"Error\", \"Select a credit memo\");\n        return\n      }\n      \n      var ext = baseURL.split('/').pop().replace(/\\.php/, '');\n      new Pman.Download({\n        url : baseURL + '/Xtuple/Print',\n        params :  {\n            template: 'creditmemo-' + ext,\n            filename : 'creditmemo-' + s.data.cmhead_id,\n            'param[0]':   \"cmhead_id:string='\" + s.data.cmhead_id + \"'\"\n           \n        },\n        method : 'GET'\n     });\n     Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n            \n            \n   \n}"
312                                     },
313                                     "cls": "x-btn-text-icon",
314                                     "text": "Print",
315                                     "xtype": "Button",
316                                     "|icon": "rootURL + '/Pman/templates/images/pdf.gif'",
317                                     "|xns": "Roo.Toolbar"
318                                 },
319                                 {
320                                     "|xns": "Roo.Toolbar",
321                                     "xtype": "Separator"
322                                 },
323                                 {
324                                     "cls": "x-btn-text-icon",
325                                     "text": "Tools",
326                                     "xtype": "Button",
327                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
328                                     "|xns": "Roo.Toolbar",
329                                     "items": [
330                                         {
331                                             "|xns": "Roo.menu",
332                                             "xtype": "Menu",
333                                             "*prop": "menu",
334                                             "items": [
335                                                 {
336                                                     "|xns": "Roo.menu",
337                                                     "xtype": "Separator"
338                                                 },
339                                                 {
340                                                     "listeners": {
341                                                         "click": "function (_self, e)\n{\n   Roo.MessageBox.confirm(\n        \"Confirm\",\n        \"It is going to fill in all the blank return stock. Are you sure?\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            new Pman.Request(\n            {\n                url : baseURL + '/Roo/Cmhead',\n                mask: 'Processing',\n                method : 'POST',\n                params : {\n                    _fix_stock : 1\n                },\n                success : function()\n                {\n                    Roo.MessageBox.alert('Notice','Fixed');\n                    _this.grid.footer.onClick('refresh');\n                } \n            });\n        }\n    ); \n}"
342                                                     },
343                                                     "cls": "x-btn-text-icon",
344                                                     "text": "Fix Blank Return Stock",
345                                                     "xtype": "Item",
346                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
347                                                     "|xns": "Roo.menu"
348                                                 }
349                                             ]
350                                         }
351                                     ]
352                                 }
353                             ]
354                         },
355                         {
356                             "*prop": "colModel[]",
357                             "dataIndex": "cmhead_number",
358                             "header": "Ref #",
359                             "sortable": true,
360                             "width": 150,
361                             "xtype": "ColumnModel",
362                             "|renderer": "function(v) { return String.format('{0}', v); }",
363                             "|xns": "Roo.grid"
364                         },
365                         {
366                             "*prop": "colModel[]",
367                             "dataIndex": "cmhead_docdate",
368                             "header": "Date",
369                             "sortable": true,
370                             "width": 100,
371                             "xtype": "ColumnModel",
372                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
373                             "|xns": "Roo.grid"
374                         },
375                         {
376                             "*prop": "colModel[]",
377                             "dataIndex": "cmhead_salesrep_id_salesrep_name",
378                             "header": "Sales Rep",
379                             "sortable": true,
380                             "width": 100,
381                             "xtype": "ColumnModel",
382                             "|renderer": "function(v) { return String.format('{0}', v  ); }",
383                             "|xns": "Roo.grid"
384                         },
385                         {
386                             "*prop": "colModel[]",
387                             ".builderCfg": "{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Customer\"}",
388                             "dataIndex": "cmhead_cust_id_cust_name",
389                             "header": "Customer",
390                             "width": 200,
391                             "xtype": "ColumnModel",
392                             "|renderer": "function(v) { return String.format('{0}', v); }",
393                             "|xns": "Roo.grid"
394                         },
395                         {
396                             "*prop": "colModel[]",
397                             "align": "right",
398                             "dataIndex": "cmhead_curr_id_curr_symbol",
399                             "header": "Currency",
400                             "width": 70,
401                             "xtype": "ColumnModel",
402                             "|renderer": "function(v)\n{\n    return String.format('{0}', v ? v : '??');\n}",
403                             "|xns": "Roo.grid"
404                         },
405                         {
406                             "*prop": "colModel[]",
407                             "align": "right",
408                             "dataIndex": "cmhead_value",
409                             "header": "Value",
410                             "width": 100,
411                             "xtype": "ColumnModel",
412                             "|renderer": "function(v)\n{\n    return Roo.util.Format.usMoney(v);\n}",
413                             "|xns": "Roo.grid"
414                         },
415                         {
416                             "*prop": "colModel[]",
417                             "align": "right",
418                             "dataIndex": "cmhead_unpaid",
419                             "header": "Open Value",
420                             "width": 100,
421                             "xtype": "ColumnModel",
422                             "|renderer": "function(v,x,r)\n{\n    if (!r.data.cmhead_posted) {\n        return '';\n    }\n    return Roo.util.Format.usMoney(v);\n}",
423                             "|xns": "Roo.grid"
424                         },
425                         {
426                             "*prop": "colModel[]",
427                             "dataIndex": "cmhead_posted",
428                             "header": "Posted",
429                             "width": 75,
430                             "xtype": "ColumnModel",
431                             "|renderer": "function(v) { return String.format('{0}', v ? 'Yes':''); }",
432                             "|xns": "Roo.grid"
433                         }
434                     ]
435                 }
436             ]
437         }
438     ],
439     "permname": "",
440     "modOrder": "200"
441 }