1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.XtupleApAging = new Roo.XComponent({
6 part : ["Xtuple","ApAging"],
7 order : '400-Pman.Tab.XtupleApAging',
9 parent : 'Pman.Tab.XtupleAccountsTab',
10 name : "unnamed module",
18 xtype: 'NestedLayoutPanel',
24 title : "Accounts Payable",
26 xtype: 'BorderLayout',
33 activate : function() {
36 _this.grid.footer.onClick('first');
53 //_this.dialog = Pman.Dialog.FILL_IN
54 if (_this.panel.active) {
55 this.footer.onClick('first');
59 autoExpandColumn : 'araging_cust_name',
65 beforeload : function (_self, o)
67 o.params = o.params || {};
71 var dt = _this.relDate.getValue();
76 'relDate:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),
77 'useDocDate:text' : false
80 var vend = _this.vendSel.getValue();
82 params['vend_id:number'] = vend;
87 Roo.apply(o.params,params);
96 url : baseURL + '/Roo/Metasql.php'
103 totalProperty : 'total',
106 'name': 'apaging_doctype',
120 render : function (_self)
122 _this.vendSel = _self;
124 select : function (combo, record, index)
126 _this.grid.footer.onClick('first');
130 displayField : 'vend_name',
132 emptyText : "Select Vendor",
133 fieldLabel : 'cust_name',
134 forceSelection : true,
135 hiddenName : 'vend_id',
137 loadingText : "Searching...",
141 qtip : "Select Vendor",
142 queryParam : 'vend_name:text',
143 selectOnFocus : true,
144 tpl : '<div class="x-grid-cell-text x-btn button"><b>{vend_name}</b> </div>',
145 triggerAction : 'all',
147 valueField : 'vend_id',
153 beforeload : function (_self, o){
154 o.params = o.params || {};
156 if (!_this.relDate) {
159 var dt = _this.relDate.getValue();
161 o.params['_group'] = 'apAging';
162 o.params['_name'] = 'vendors';
163 o.params['relDate:text'] = typeof(dt) == 'string' ? dt : dt.format('Y-m-d');
164 o.params['useDocDate:text'] = false
168 sortInfo : { direction : 'ASC', field: 'cust_name' },
173 url : baseURL + '/Roo/metasql.php'
180 totalProperty : 'total',
181 fields : [{"name":"vend_id","type":"int"},"vend_name"]
194 render : function (_self)
\r
196 _this.relDate = _self;
\r
197 _self.setValue( new Date() );
\r
199 select : function (combo, date)
201 _this.grid.footer.onClick('first');
219 var sel = _this.invgrid.getSelectionModel().getSelected();
221 Roo.MessageBox.alert("Error", "Select a invoice");
224 // check current status of shipment..
227 // cobmisc_id : sel.data.cobmisc_id,
230 if (sel.data.cobmisc_id * 1) {
231 params.cobmisc_id = sel.data.cobmisc_id * 1 ;
233 if (sel.data.cobmisc_invchead_id_invchead_id * 1) {
234 params.invchead_id = sel.data.cobmisc_invchead_id_invchead_id * 1;
237 Roo.MessageBox.confirm("Are you sure", "Are you sure you want to VOID that invoice?",
244 url : baseURL + '/Roo/cobmisc',
247 success : function() {
248 _this.invgrid.ds.load({});
259 cls : 'x-btn-text-icon',
260 text : "Void / Unpost",
261 icon : rootURL + '/Pman/templates/images/trash.gif'
266 xtype: 'PagingToolbar',
269 displayMsg : "Displaying araging{0} - {1} of {2}",
270 emptyMsg : "Nothing found",
275 xtype: 'ColumnModel',
277 dataIndex : 'apaging_docdate',
280 renderer : function(v) {
281 var d = Date.parseDate(v, 'Y-m-d');
283 return String.format('{0}', d.format('d/M/Y'));
287 xtype: 'ColumnModel',
289 dataIndex : 'apaging_vend_name',
292 renderer : function(v) { return String.format('{0}', v); }
295 xtype: 'ColumnModel',
297 dataIndex : 'apaging_doctype',
300 renderer : function(v) {
305 return "Credit Memo";
309 return "Cash Receipt";
313 return String.format('{0}', v);
318 xtype: 'ColumnModel',
320 dataIndex : 'apaging_docnumber',
321 header : 'Docnumber',
323 renderer : function(v) {
325 return String.format('{0}', v);
330 xtype: 'ColumnModel',
332 dataIndex : 'apaging_curr_symbol',
335 renderer : function(v) {
337 return String.format('{0}', v);
342 xtype: 'ColumnModel',
345 dataIndex : 'apaging_apopen_amount',
348 renderer : function(v) {
350 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
351 Roo.util.Format.usMoney(v));
355 xtype: 'ColumnModel',
358 dataIndex : 'apaging_cur_val',
361 renderer : function(v) {
363 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
364 Roo.util.Format.usMoney(v));
368 xtype: 'ColumnModel',
371 dataIndex : 'apaging_sixty_val',
374 renderer : function(v) {
376 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
377 Roo.util.Format.usMoney(v));
381 xtype: 'ColumnModel',
384 dataIndex : 'apaging_ninety_val',
387 renderer : function(v) {
389 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
390 Roo.util.Format.usMoney(v));
394 xtype: 'ColumnModel',
397 dataIndex : 'apaging_plus_val',
398 header : 'Over 90 days',
400 renderer : function(v) {
402 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
403 Roo.util.Format.usMoney(v));
407 xtype: 'ColumnModel',
410 dataIndex : 'apaging_total_val',
413 renderer : function(v) {
415 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
416 Roo.util.Format.usMoney(v));
420 xtype: 'ColumnModel',
423 dataIndex : 'apaging_base_total',
424 header : 'Total (BASE)',
426 renderer : function(v) {
428 return String.format(v*1 < 0 ? '<span style="color:red">{0}</span>' : '{0}',
429 Roo.util.Format.usMoney(v));
437 xtype: 'LayoutRegion',