123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- Ext.define('make.model.make.MakeInDetail', {
- extend: 'saas.model.Base',
- fields: [
- { name: 'id', type: 'int' }, // id
- { name: 'pd_prodid', type: 'int' }, // 物料id
- { name: 'pd_prodcode', type: 'string' }, // 物料编号
- { name: 'pr_brand', type: 'string' }, // 厂家/品牌
- { name: 'pr_detail', type: 'string' }, // 名称
- { name: 'pr_orispeccode', type: 'string' }, // 型号
- { name: 'pr_spec', type: 'string' }, // 规格
- { name: 'pd_inqty', type: 'float' }, // 数量
- { name: 'pr_unit', type: 'string' }, // 单位
- { name: 'pd_netprice', type: 'float'}, // 单价
- { name: 'pd_orderprice', type: 'float', // 含税单价
- convert: function(v, rec) {
- var t = rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
- return Number(saas.util.BaseUtil.numberFormat(t, 4, false));
- },
- depends: ['pd_netprice', 'pd_taxrate']
- },
- { name: 'pd_nettotal', type: 'float', // 金额
- convert: function(v, rec) {
- var t = rec.get('pd_netprice') * rec.get('pd_inqty');
- return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
- },
- depends: ['pd_netprice', 'pd_inqty']
- },
- { name: 'pd_taxrate', type: 'float' }, // 税率
- { name: 'pd_taxamount', type: 'float', // 税额
- convert: function(v, rec) {
- var t = rec.get('pd_ordertotal') - rec.get('pd_nettotal');
- return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
- },
- depends: ['pd_ordertotal', 'pd_nettotal']
- },
- { name: 'pd_ordertotal', type: 'float', // 价税合计
- convert: function(v, rec) {
- var t = rec.get('pd_orderprice') * rec.get('pd_inqty');
- return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
- },
- depends: ['pd_orderprice', 'pd_inqty']
- },
- { name: 'pd_whid', type: 'int' }, // 仓库id
- { name: 'pd_whcode', type: 'string' }, // 仓库编号
- { name: 'pd_whname', type: 'string' }, // 仓库
- { name: 'pd_orderid', type: 'int' }, // 采购单明细id
- { name: 'pd_ordercode', type: 'string' }, // 采购单号
- { name: 'pd_orderdetno', type: 'int' }, // 采购序号
- { name: 'pd_remark', type: 'string' }, // 备注
- { name: 'pd_text1', type: 'string' },
- { name: 'pd_text2', type: 'string' },
- { name: 'pd_text3', type: 'string' },
- { name: 'pd_text4', type: 'string' },
- { name: 'pd_text5', type: 'string' },
- { name: 'pd_mmid', type: 'int' },
- { name: 'pd_maid', type: 'int' }
- ],
- //一对一映射
- associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
- });
|