SaleOutDetail.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
  21. },
  22. depends: ['pd_netprice', 'pd_taxrate']
  23. },
  24. { name: 'pd_nettotal', type: 'float', // 金额
  25. convert: function(v, rec) {
  26. return rec.get('pd_netprice') * rec.get('pd_outqty');
  27. },
  28. depends: ['pd_netprice', 'pd_outqty']
  29. },
  30. { name: 'pd_ordertotal', type: 'float', // 价税合计
  31. convert: function(v, rec) {
  32. return rec.get('pd_sendprice') * rec.get('pd_outqty');
  33. },
  34. depends: ['pd_sendprice', 'pd_outqty']
  35. },
  36. { name: 'pd_taxamount', type: 'float', // 税额
  37. convert: function(v, rec) {
  38. return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
  39. },
  40. depends: ['pd_ordertotal', 'pd_nettotal']
  41. },
  42. { name: 'pd_ordercode', type: 'string' }, // 销售单号
  43. { name: 'pd_orderdetno', type: 'string' }, // 销售序号
  44. { name: 'pd_remark', type: 'string' }, // 备注
  45. ],
  46. //一对一映射
  47. associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'productDTO'}]
  48. });