Ext.define('saas.model.report.SaleProfit', { extend: 'saas.model.Base', fields: [ { name: 'id', type: 'int' }, { name: 'pi_date', type: 'date' }, { name: 'sa_custname', type: 'string' }, { name: 'sa_seller', type: 'string' }, { name: 'pd_inoutno', type: 'string' }, { name: 'pr_code', type: 'string' }, { name: 'pr_brand', type: 'string' }, { name: 'pr_detail', type: 'string' }, { name: 'pr_orispeccode', type: 'string' }, { name: 'pr_spec', type: 'string' }, { name: 'pd_outqty', type: 'float' }, { name: 'pr_unit', type: 'string' }, { name: 'pd_netprice', type: 'float' }, { name: 'pd_sendprice', type: 'float' }, { name: 'pd_nettotal', type: 'float' }, { name: 'pd_taxrate', type: 'int' }, { name: 'pd_ordertotal-pd_nettotal', type: 'float', convert: function(v, rec) { var t = (rec.get('pd_ordertotal') || 0.0) - (rec.get('pd_nettotal') || 0.0); return Number(saas.util.BaseUtil.numberFormat(t, 2, false)); }, depends: ['pd_ordertotal', 'pd_nettotal'] }, { name: 'pd_ordertotal', type: 'float' }, { name: 'pd_price', type: 'float' }, { name: 'pd_total', type: 'float' }, { name: 'pd_profit', type: 'float' }, { name: 'pd_profitpresent', type: 'float' }, { name: 'pd_remark', type: 'string' }, { name: 'pi_currency', type: 'string' }, { name: 'pi_rate', type: 'float' } ], });