SaleOutDetail.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Ext.define('saas.model.sale.SaleOutDetail', {
  2. extend: 'saas.model.Base',
  3. fields: [
  4. { name: 'id', type: 'int' },
  5. { name: 'pd_prodid', type: 'int' }, // 物料id
  6. { name: 'pd_prodcode', type: 'string' }, // 物料编号
  7. { name: 'pr_brand', type: 'string' }, // 品牌
  8. { name: 'pr_detail', type: 'string' }, // 名称
  9. { name: 'pr_orispeccode', type: 'string' }, // 型号
  10. { name: 'pr_spec', type: 'string' }, // 规格
  11. { name: 'pd_outqty', type: 'int' }, // 出货数量
  12. { name: 'pr_unit', type: 'string' }, // 单位
  13. { name: 'pd_whid', type: 'int' }, // 仓库id
  14. { name: 'pd_whcode', type: 'float' }, // 仓库编号
  15. { name: 'pd_whname', type: 'string' }, // 仓库
  16. { name: 'pd_taxrate', type: 'float' }, // 税率
  17. { name: 'pd_netprice', type: 'float' }, // 单价
  18. { name: 'pd_sendprice', type: 'float', // 含税单价
  19. convert: function(v, rec) {
  20. var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
  21. return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
  22. },
  23. depends: ['pd_netprice', 'pd_taxrate']
  24. },
  25. { name: 'pd_nettotal', type: 'float', // 金额
  26. convert: function(v, rec) {
  27. var t = rec.get('pd_netprice') * rec.get('pd_outqty');
  28. return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
  29. },
  30. depends: ['pd_netprice', 'pd_outqty']
  31. },
  32. { name: 'pd_ordertotal', type: 'float', // 价税合计
  33. convert: function(v, rec) {
  34. var t = rec.get('pd_sendprice') * rec.get('pd_outqty');
  35. return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
  36. },
  37. depends: ['pd_sendprice', 'pd_outqty']
  38. },
  39. { name: 'pd_taxamount', type: 'float', // 税额
  40. convert: function(v, rec) {
  41. var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
  42. return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
  43. },
  44. depends: ['pd_ordertotal', 'pd_nettotal']
  45. },
  46. { name: 'pd_ordercode', type: 'string' }, // 销售单号
  47. { name: 'pd_orderdetno', type: 'string' }, // 销售序号
  48. { name: 'pd_remark', type: 'string' }, // 备注
  49. ],
  50. //一对一映射
  51. associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
  52. });