SaleProfit.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Ext.define('saas.model.report.SaleProfit', {
  2. extend: 'saas.model.Base',
  3. fields: [
  4. { name: 'id', type: 'int' },
  5. { name: 'pi_date', type: 'date' },
  6. { name: 'sa_custname', type: 'string' },
  7. { name: 'sa_seller', type: 'string' },
  8. { name: 'pd_inoutno', type: 'string' },
  9. { name: 'pr_code', type: 'string' },
  10. { name: 'pr_brand', type: 'string' },
  11. { name: 'pr_detail', type: 'string' },
  12. { name: 'pr_orispeccode', type: 'string' },
  13. { name: 'pr_spec', type: 'string' },
  14. { name: 'pd_outqty', type: 'float' },
  15. { name: 'pr_unit', type: 'string' },
  16. { name: 'pd_netprice', type: 'float' },
  17. { name: 'pd_sendprice', type: 'float' },
  18. { name: 'pd_nettotal', type: 'float' },
  19. { name: 'pd_taxrate', type: 'int' },
  20. { name: 'pd_ordertotal-pd_nettotal', type: 'float',
  21. convert: function(v, rec) {
  22. var t = (rec.get('pd_ordertotal') || 0.0) - (rec.get('pd_nettotal') || 0.0);
  23. return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
  24. },
  25. depends: ['pd_ordertotal', 'pd_nettotal']
  26. },
  27. { name: 'pd_ordertotal', type: 'float' },
  28. { name: 'pd_price', type: 'float' },
  29. { name: 'pd_total', type: 'float' },
  30. { name: 'pd_profit', type: 'float' },
  31. { name: 'pd_profitpresent', type: 'float' },
  32. { name: 'pd_remark', type: 'string' },
  33. { name: 'pi_currency', type: 'string' },
  34. { name: 'pi_rate', type: 'float' }
  35. ],
  36. });