Pman.Tab.XtupleCustomer.bjs
[Pman.Xtuple] / Pman.Tab.XtupleCustomer.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Tab.XtupleCustomer = new Roo.XComponent({
6     part     :  ["Xtuple","Customer"],
7     order    : '700-Pman.Tab.XtupleCustomer',
8     region   : 'center',
9     parent   : 'Pman.Tab.XtupleSales',
10     name     : "unnamed module",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         var _this = this;
16         var MODULE = this;
17         return {
18             xtype: 'GridPanel',
19             xns: Roo,
20             listeners : {
21                 activate : function() {
22                     _this.panel = this;
23                     if (_this.grid) {
24                         _this.grid.footer.onClick('first');
25                     }
26                 }
27             },
28             background : true,
29             fitContainer : true,
30             fitToframe : true,
31             region : 'center',
32             tableName : 'custinfo',
33             title : "Customers",
34             grid : {
35                 xtype: 'Grid',
36                 xns: Roo.grid,
37                 listeners : {
38                     render : function() 
39                     {
40                         _this.grid = this; 
41                         _this.dialog = Pman.Dialog.XtupleCustomer;
42                         if (_this.panel.active) {
43                            this.footer.onClick('first');
44                         }
45                     },
46                     rowdblclick : function (_self, rowIndex, e)
47                     {
48                         if (!_this.dialog) return;
49                         _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
50                             _this.grid.footer.onClick('refresh');
51                         }); 
52                     }
53                 },
54                 autoExpandColumn : 'cust_name',
55                 loadMask : true,
56                 dataSource : {
57                     xtype: 'Store',
58                     xns: Roo.data,
59                     listeners : {
60                         beforeload : function (_self, o)
61                         {
62                             if (!_this.officeCombo) {
63                                 return false;
64                             }
65                             
66                             o.params = o.params || {};
67                             o.params['search[cust_name]'] = _this.searchBox.getValue();
68                             if (!_this.activeBtn.pressed) {
69                                 o.params.cust_active = 1;
70                             } 
71                             var dt = _this.dateSearch.getValue(); 
72                             if (dt) {
73                                 o.params['search[orders_since]'] = dt.format('Y-m-d');
74                             }
75                             dt = _this.dateSearchNo.getValue(); 
76                             if (dt) {
77                                 o.params['search[no_orders_since]'] = dt.format('Y-m-d');
78                             }
79                             
80                             o.params['search[with_orders_since]'] = 1; //
81                             o.params['search[with_balance]'] = 1;
82                             o.params['search[with_address]'] = 1;
83                             o.params['_with_char'] = 1;    
84                             o.params['_with_group_data'] = 1;
85                             o.params['search[_country]'] = _this.country.getValue();
86                             o.params._get = 1; // for download
87                             
88                             o.params['cust_char_internalcompany'] = _this.officeCombo.getValue();
89                         }
90                     },
91                     remoteSort : true,
92                     sortInfo : { field : 'cust_name', direction: 'ASC' },
93                     proxy : {
94                         xtype: 'HttpProxy',
95                         xns: Roo.data,
96                         method : 'GET',
97                         url : baseURL + '/Roo/custinfo.php'
98                     },
99                     reader : {
100                         xtype: 'JsonReader',
101                         xns: Roo.data,
102                         totalProperty : 'total',
103                         root : 'data',
104                         id : 'id',
105                         fields : [
106                             {
107                                 'name': 'cust_active',
108                                 'type': 'boolean'
109                             },
110                             {
111                                 'name': 'cust_custtype_id_custtype_descrip',
112                                 'type': 'string'
113                             },
114                             {
115                                 'name': 'cust_salesrep_id_salesrep_name',
116                                 'type': 'string'
117                             },
118                             {
119                                 'name': 'cust_name',
120                                 'type': 'string'
121                             }
122                         ]
123                     }
124                 },
125                 footer : {
126                     xtype: 'PagingToolbar',
127                     xns: Roo,
128                     pageSize : 25,
129                     displayInfo : true,
130                     displayMsg : "Displaying custinfo{0} - {1} of {2}",
131                     emptyMsg : "No custinfo found",
132                     items : [
133                         {
134                             xtype: 'Button',
135                             xns: Roo.Toolbar,
136                             text : "Upload/Download",
137                             menu : {
138                                 xtype: 'Menu',
139                                 xns: Roo.menu,
140                                 items : [
141                                     {
142                                         xtype: 'Item',
143                                         xns: Roo.menu,
144                                         listeners : {
145                                             click : function (_self, e)
146                                             {
147                                                 
148                                                 if (!Pman.hasPerm('Xtuple.CustomerDownload','S')) {
149                                                     Roo.MessageBox.alert("Error", "Permission Denied");
150                                                     return;
151                                                 }
152                                                 _this.grid.ds.proxy.conn.method = 'POST';
153                                                 new Pman.Download({
154                                                     grid : _this.grid
155                                                 });
156                                                 
157                                             }
158                                         },
159                                         text : "Download Customers"
160                                     },
161                                     {
162                                         xtype: 'Item',
163                                         xns: Roo.menu,
164                                         listeners : {
165                                             click : function (_self, e)
166                                             {
167                                                 
168                                                 if (!Pman.hasPerm('Admin.Admin_Tab','S')) {
169                                                     Roo.MessageBox.alert("Error", "Permission Denied");
170                                                     return;
171                                                 }
172                                                 
173                                                 var c = _this.country.getValue();
174                                                 if(!c.length){
175                                                     Roo.MessageBox.alert("Error", "Please select a country");
176                                                     return;
177                                                 }
178                                                 
179                                                 new Pman.Download({
180                                                     url : baseURL + '/Roo/custinfo',
181                                                     method : 'GET',
182                                                     params : {
183                                                         _my_json : 1,
184                                                         limit : 9999,
185                                                         'search[_country]' : c,
186                                                         'search[with_address]' : 1
187                                                     }
188                                                     
189                                                 });
190                                             }
191                                         },
192                                         text : "Download Customers As Json"
193                                     },
194                                     {
195                                         xtype: 'Item',
196                                         xns: Roo.menu,
197                                         listeners : {
198                                             click : function (_self, e)
199                                             {
200                                                 
201                                                 if (!Pman.hasPerm('Admin.Admin_Tab','S')) {
202                                                     Roo.MessageBox.alert("Error", "Permission Denied");
203                                                     return;
204                                                 }
205                                                
206                                                Pman.Dialog.Image.show(
207                                                    {
208                                                         _url : baseURL+'/Xtuple/Import/Customers' 
209                                                     
210                                                    },
211                                                    function (data) {
212                                                         _this.grid.footer.onClick('first');
213                                                         Roo.MessageBox.alert("Notice", "DONE");
214                                             //            Roo.MessageBox.alert("Notice", msg.join("\n"));
215                                             
216                                                    }
217                                                );
218                                                 
219                                             }
220                                         },
221                                         text : "Upload Customers"
222                                     },
223                                     {
224                                         xtype: 'Item',
225                                         xns: Roo.menu,
226                                         listeners : {
227                                             click : function (_self, e)
228                                             {
229                                                 
230                                                 if (!Pman.hasPerm('Admin.Admin_Tab','S')) {
231                                                     Roo.MessageBox.alert("Error", "Permission Denied");
232                                                     return;
233                                                 }
234                                                
235                                                Pman.Dialog.Image.show(
236                                                    {
237                                                         _url : baseURL+'/Xtuple/Import/MyCustomers' 
238                                                     
239                                                    },
240                                                    function (data) {
241                                                         _this.grid.footer.onClick('first');
242                                                         Roo.MessageBox.alert("Notice", "DONE");
243                                             //            Roo.MessageBox.alert("Notice", msg.join("\n"));
244                                             
245                                                    }
246                                                );
247                                                 
248                                             }
249                                         },
250                                         text : "Upload Customers Json File"
251                                     },
252                                     {
253                                         xtype: 'Item',
254                                         xns: Roo.menu,
255                                         listeners : {
256                                             click : function (_self, e)
257                                             {
258                                                 
259                                                 if (!Pman.hasPerm('Admin.Admin_Tab','S')) {
260                                                     Roo.MessageBox.alert("Error", "Permission Denied");
261                                                     return;
262                                                 }
263                                                
264                                                Pman.Dialog.Image.show(
265                                                    {
266                                                         _url : baseURL+'/Xtuple/Import/AUPostAccounts' 
267                                                     
268                                                    },
269                                                    function (data) {
270                                                         _this.grid.footer.onClick('first');
271                                                         Roo.MessageBox.alert("Notice", data);
272                                             
273                                                    }
274                                                );
275                                                 
276                                             }
277                                         },
278                                         text : "Upload AU Post Accounts"
279                                     }
280                                 ]
281                             }
282                         }
283                     ]
284                 },
285                 toolbar : {
286                     xtype: 'Toolbar',
287                     xns: Roo,
288                     items : [
289                         {
290                             xtype: 'TextItem',
291                             xns: Roo.Toolbar,
292                             text : "Search : "
293                         },
294                         {
295                             xtype: 'TextField',
296                             xns: Roo.form,
297                             listeners : {
298                                 render : function (_self)
299                                 {
300                                     _this.searchBox = _self;
301                                 },
302                                 specialkey : function (_self, e)
303                                 {
304                                     _this.grid.footer.onClick('first');
305                                 }
306                             }
307                         },
308                         {
309                             xtype: 'Button',
310                             xns: Roo.Toolbar,
311                             listeners : {
312                                 click : function (_self, e)
313                                 {
314                                 _this.grid.footer.onClick('first');
315                                 }
316                             },
317                             cls : 'x-btn-icon',
318                             icon : rootURL + '/Pman/templates/images/search.gif'
319                         },
320                         {
321                             xtype: 'Button',
322                             xns: Roo.Toolbar,
323                             listeners : {
324                                 click : function (_self, e)
325                                 {
326                                     _this.searchBox.setValue('');
327                                     
328                                     
329                                     _this.grid.footer.onClick('first');
330                                 }
331                             },
332                             cls : 'x-btn-icon',
333                             icon : rootURL + '/Pman/templates/images/edit-clear.gif'
334                         },
335                         {
336                             xtype: 'ComboBox',
337                             xns: Roo.form,
338                             listeners : {
339                                 render : function (_self)
340                                 {
341                                   _this.officeCombo  = _self;
342                                 },
343                                 select : function (combo, record, index)
344                                 {
345                                 
346                                     _this.grid.footer.onClick('first');
347                                 }
348                             },
349                             allowBlank : true,
350                             displayField : 'office',
351                             editable : false,
352                             fieldLabel : 'Office',
353                             hiddenName : 'office',
354                             listWidth : 200,
355                             mode : 'local',
356                             name : 'office',
357                             tpl : '<div class="x-grid-cell-text x-btn button"><b>{office}</b> </div>',
358                             triggerAction : 'all',
359                             valueField : 'office',
360                             width : 75,
361                             store : {
362                                 xtype: 'SimpleStore',
363                                 xns: Roo.data,
364                                 data : [ 
365                                     [ ''] ,
366                                     [ 'hk' ],
367                                     [ 'sg' ],
368                                     [ 'my' ],
369                                     [ 'cn' ],
370                                     [ 'au' ]
371                                 ],
372                                 fields : ['office']
373                             }
374                         },
375                         {
376                             xtype: 'ComboBox',
377                             xns: Roo.form,
378                             listeners : {
379                                 render : function (_self)
380                                 {
381                                     _this.country = _self;
382                                 },
383                                 select : function (combo, record, index)
384                                 {
385                                     _this.grid.footer.onClick('first');
386                                 }
387                             },
388                             allowBlank : true,
389                             alwaysQuery : true,
390                             displayField : 'addr_country',
391                             editable : true,
392                             emptyText : "Select Country",
393                             fieldLabel : 'Country',
394                             forceSelection : true,
395                             hiddenName : 'addr_country',
396                             listWidth : 300,
397                             loadingText : "Searching...",
398                             minChars : 2,
399                             name : 'addr_country',
400                             pageSize : 20,
401                             qtip : "Select Country",
402                             queryParam : 'query[addr_country]',
403                             selectOnFocus : true,
404                             tpl : '<div class="x-grid-cell-text x-btn button"><b>{addr_country}</b> </div>',
405                             triggerAction : 'all',
406                             typeAhead : true,
407                             valueField : 'addr_country',
408                             width : 150,
409                             store : {
410                                 xtype: 'Store',
411                                 xns: Roo.data,
412                                 listeners : {
413                                     beforeload : function (_self, o){
414                                         o.params = o.params || {};
415                                         o.params._distinct = 'addr_country';
416                                         o.params._columns ='addr_country';
417                                     }
418                                 },
419                                 remoteSort : true,
420                                 sortInfo : { direction : 'ASC', field: 'addr_country' },
421                                 proxy : {
422                                     xtype: 'HttpProxy',
423                                     xns: Roo.data,
424                                     method : 'GET',
425                                     url : baseURL + '/Roo/Addr.php'
426                                 },
427                                 reader : {
428                                     xtype: 'JsonReader',
429                                     xns: Roo.data,
430                                     id : 'addr_id',
431                                     root : 'data',
432                                     totalProperty : 'total',
433                                     fields : [{"name":"addr_id","type":"int"},{"name":"addr_country","type":"string"}]
434                                 }
435                             }
436                         },
437                         {
438                             xtype: 'Button',
439                             xns: Roo.Toolbar,
440                             listeners : {
441                                 toggle : function (_self, pressed)
442                                 {
443                                     _this.grid.footer.onClick('first');
444                                 },
445                                 render : function (_self)
446                                 {
447                                     _this.activeBtn = _self;
448                                 }
449                             },
450                             enableToggle : true,
451                             pressed : false,
452                             text : "Show / Hide Inactive"
453                         },
454                         {
455                             xtype: 'TextItem',
456                             xns: Roo.Toolbar,
457                             text : "Has orders since"
458                         },
459                         {
460                             xtype: 'DateField',
461                             xns: Roo.form,
462                             listeners : {
463                                 render : function (_self)
464                                 {
465                                     _this.dateSearch = _self
466                                 },
467                                 select : function (combo, date)
468                                 {
469                                     _this.grid.footer.onClick('first');
470                                 },
471                                 specialkey : function (_self, e)
472                                 {
473                                    _this.grid.footer.onClick('first');
474                                 }
475                             },
476                             format : 'Y-m-d'
477                         },
478                         {
479                             xtype: 'TextItem',
480                             xns: Roo.Toolbar,
481                             text : "No orders since"
482                         },
483                         {
484                             xtype: 'DateField',
485                             xns: Roo.form,
486                             listeners : {
487                                 render : function (_self)
488                                 {
489                                     _this.dateSearchNo = _self
490                                 },
491                                 select : function (combo, date)
492                                 {
493                                    _this.grid.footer.onClick('first');
494                                 },
495                                 specialkey : function (_self, e)
496                                 {
497                                    _this.grid.footer.onClick('first');
498                                 }
499                             },
500                             format : 'Y-m-d'
501                         },
502                         {
503                             xtype: 'Fill',
504                             xns: Roo.Toolbar
505                         },
506                         {
507                             xtype: 'Button',
508                             xns: Roo.Toolbar,
509                             listeners : {
510                                 click : function()
511                                 {
512                                     if (!_this.dialog) return;
513                                     _this.dialog.show( { id : 0 } , function() {
514                                         _this.grid.footer.onClick('first');
515                                    }); 
516                                 }
517                             },
518                             cls : 'x-btn-text-icon',
519                             text : "Add",
520                             icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
521                         },
522                         {
523                             xtype: 'Button',
524                             xns: Roo.Toolbar,
525                             listeners : {
526                                 click : function()
527                                 {
528                                     var s = _this.grid.getSelectionModel().getSelections();
529                                     if (!s.length || (s.length > 1))  {
530                                         Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
531                                         return;
532                                     }
533                                     if (!_this.dialog) return;
534                                     _this.dialog.show(s[0].data, function() {
535                                         _this.grid.footer.onClick('first');
536                                     }); 
537                                     
538                                 }
539                             },
540                             cls : 'x-btn-text-icon',
541                             text : "Edit",
542                             icon : Roo.rootURL + 'images/default/tree/leaf.gif'
543                         }
544                     ]
545                 },
546                 colModel : [
547                     {
548                         xtype: 'ColumnModel',
549                         xns: Roo.grid,
550                         dataIndex : 'cust_active',
551                         header : 'Active',
552                         width : 50,
553                         renderer : function(v) { return String.format('{0}', v? 'Y' : 'N'); }
554                     },
555                     {
556                         xtype: 'ColumnModel',
557                         xns: Roo.grid,
558                         dataIndex : 'last_order',
559                         header : 'Last Order',
560                         width : 80,
561                         renderer : function(v) { 
562                             if (!v) { 
563                                 return '-none-';
564                             }
565                             var vv = Date.parseDate(v, 'Y-m-d');
566                             return String.format('{0}',  vv.format('d/M/Y') ); 
567                         }
568                     },
569                     {
570                         xtype: 'ColumnModel',
571                         xns: Roo.grid,
572                         dataIndex : 'cust_taxzone_id_taxzone_descrip',
573                         header : 'Tax Status',
574                         sortable : true,
575                         width : 100,
576                         renderer : function(v) { return String.format('{0}', v); }
577                     },
578                     {
579                         xtype: 'ColumnModel',
580                         xns: Roo.grid,
581                         dataIndex : 'cust_terms_id_terms_descrip',
582                         header : 'Terms',
583                         sortable : true,
584                         width : 100,
585                         renderer : function(v) { return String.format('{0}', v); }
586                     },
587                     {
588                         xtype: 'ColumnModel',
589                         xns: Roo.grid,
590                         dataIndex : 'cust_salesrep_id_salesrep_name',
591                         header : 'Sales Rep',
592                         sortable : true,
593                         width : 100,
594                         renderer : function(v) { return String.format('{0}', v); }
595                     },
596                     {
597                         xtype: 'ColumnModel',
598                         xns: Roo.grid,
599                         dataIndex : 'ipshead_id_name',
600                         header : 'Curr/Price List',
601                         sortable : true,
602                         width : 80,
603                         renderer : function(v,x,r) { 
604                             if (!v.length) {
605                                  return String.format('{0}<br/><span style="color:red">No price list</span>', 
606                                 r.data.cust_curr_id_curr_name  );
607                              }    
608                         
609                             return  String.format('{0}<br/>{1}', 
610                                 r.data.cust_curr_id_curr_name,
611                                v ); 
612                            }
613                     },
614                     {
615                         xtype: 'ColumnModel',
616                         xns: Roo.grid,
617                         dataIndex : 'cust_number',
618                         header : 'Ref No.',
619                         sortable : true,
620                         width : 80,
621                         renderer : function(v) { return String.format('{0}', v); }
622                     },
623                     {
624                         xtype: 'ColumnModel',
625                         xns: Roo.grid,
626                         dataIndex : 'cust_name',
627                         header : 'Name',
628                         sortable : true,
629                         width : 200,
630                         renderer : function(v,x,r) {
631                             if (!r.data.cust_char_internalcompany.length) {
632                                  return String.format('{0}', v); 
633                              }
634                             return String.format('<span style="color:red">[Internal company : {0}] {1}</span>',
635                                 r.data.cust_char_internalcompany,  v); 
636                          }
637                     },
638                     {
639                         xtype: 'ColumnModel',
640                         xns: Roo.grid,
641                         dataIndex : 'cust_bill_info',
642                         header : 'Billing Address',
643                         sortable : true,
644                         width : 200,
645                         renderer : function(v,x,r) 
646                         { 
647                             if(!v.length){
648                                 var add = [];\r
649                                 Roo.each([ 'line1', 'line2', 'line3', 'city', 'state', 'country'], function (k) {\r
650                                     if (!r.data['cntct_addr_' + k].length) {\r
651                                         return;\r
652                                     }\r
653                                     add.push(String.format("{0}", r.data['cntct_addr_' + k]));\r
654                                 \r
655                                 });
656                                 return add.join('<BR/>');
657                             }
658                             
659                             var v = v.split("\r\n").join("<br/>");
660                             return v; 
661                         }
662                     },
663                     {
664                         xtype: 'ColumnModel',
665                         xns: Roo.grid,
666                         dataIndex : 'cust_ship_info',
667                         header : 'Shipping Address',
668                         sortable : true,
669                         width : 200,
670                         renderer : function(v,x,r) 
671                         { 
672                             if(!v.length){
673                                 var add = [];\r
674                                 Roo.each([ 'line1', 'line2', 'line3', 'city', 'state', 'country'], function (k) {\r
675                                     if (!r.data['cntct_addr_' + k].length) {\r
676                                         return;\r
677                                     }\r
678                                     add.push(String.format("{0}", r.data['cntct_addr_' + k]));\r
679                                 \r
680                                 });
681                                 return add.join('<BR/>');
682                             }
683                             
684                             var v = v.split("\r\n").join("<br/>");
685                             return v; 
686                         }
687                     },
688                     {
689                         xtype: 'ColumnModel',
690                         xns: Roo.grid,
691                         dataIndex : 'cust_cntct_id_cntct_first_name',
692                         header : 'Contact',
693                         sortable : true,
694                         width : 150,
695                         renderer : function(v,x,r) 
696                         { 
697                             return String.format(
698                                 'Name: {0}<br/>' + 
699                                 'Phone: {1}<br/>' + 
700                                 'Email: <a href="mailto:{2}">{2}</a>',
701                             
702                                 r.data.cust_cntct_id_cntct_first_name,
703                                 r.data.cust_cntct_id_cntct_phone,
704                                 r.data.cust_cntct_id_cntct_email
705                             );
706                         }
707                     },
708                     {
709                         xtype: 'ColumnModel',
710                         xns: Roo.grid,
711                         dataIndex : 'cust_char_au_post_accno',
712                         header : 'AU Post#',
713                         hidden : true,
714                         sortable : true,
715                         width : 150,
716                         renderer : function(v,x,r) 
717                         { 
718                             return String.format('{0}', v);
719                         }
720                     },
721                     {
722                         xtype: 'ColumnModel',
723                         xns: Roo.grid,
724                         dataIndex : 'cust_cntct_id_cntct_phone',
725                         header : 'Contact Number',
726                         hidden : true,
727                         sortable : true,
728                         width : 150,
729                         renderer : function(v,x,r) 
730                         { 
731                             return String.format('{0}',v);
732                         }
733                     },
734                     {
735                         xtype: 'ColumnModel',
736                         xns: Roo.grid,
737                         dataIndex : 'cust_cntct_id_cntct_email',
738                         header : 'Email',
739                         hidden : true,
740                         sortable : true,
741                         width : 150,
742                         renderer : function(v,x,r) 
743                         { 
744                             return String.format('<a href="mailto:{0}">{0}</a>', v);
745                         }
746                     },
747                     {
748                         xtype: 'ColumnModel',
749                         xns: Roo.grid,
750                         align : 'right',
751                         dataIndex : 'cntct_addr_city',
752                         header : 'City',
753                         hidden : true,
754                         sortable : true,
755                         width : 75,
756                         renderer : function(v) { return String.format('{0}', v ? v : ''); }
757                     },
758                     {
759                         xtype: 'ColumnModel',
760                         xns: Roo.grid,
761                         align : 'right',
762                         dataIndex : 'cntct_addr_state',
763                         header : 'State',
764                         hidden : true,
765                         sortable : true,
766                         width : 75,
767                         renderer : function(v) { return String.format('{0}', v ? v : ''); }
768                     },
769                     {
770                         xtype: 'ColumnModel',
771                         xns: Roo.grid,
772                         align : 'right',
773                         dataIndex : 'cntct_addr_country',
774                         header : 'Country',
775                         sortable : true,
776                         width : 75,
777                         renderer : function(v) { return String.format('{0}', v ? v : ''); }
778                     },
779                     {
780                         xtype: 'ColumnModel',
781                         xns: Roo.grid,
782                         dataIndex : 'cust_curr_id_curr_name',
783                         header : 'Currency',
784                         sortable : true,
785                         width : 50,
786                         renderer : function(v) { return String.format('{0}', v); }
787                     },
788                     {
789                         xtype: 'ColumnModel',
790                         xns: Roo.grid,
791                         align : 'right',
792                         dataIndex : 'balance',
793                         header : 'Balance',
794                         width : 75,
795                         renderer : function(v,x,r) { 
796                         
797                              
798                             return String.format('{0}{1}', r.data.cust_curr_id_curr_symbol, Roo.util.Format.number(v,2)); 
799                         }
800                     }
801                 ]
802             }
803         };
804     }
805 });