diff --git a/src/components/Common/CommonBillEvent.js b/src/components/Common/CommonBillEvent.js index 4d201cf..89bd8ce 100644 --- a/src/components/Common/CommonBillEvent.js +++ b/src/components/Common/CommonBillEvent.js @@ -4592,6 +4592,23 @@ export default (ChildComponent) => { /* 各种金额,税额,价格计算 */ let models = name === 'materials' ? 'Materials' : sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; + + if( sModelsType?.includes('cashier/')) { + tableDataRow.bSettleMoney = true;/* 收付款单 */ + if(sFieldName === 'dTotalMoney') { + tableDataRow[`d${models}Money`] =tableDataRow.dTotalMoney; + sFieldName = `d${models}Money`; + } else if(sFieldName === 'dTotalForeignPrice') { + tableDataRow[`d${models}ForeignPrice`] = tableDataRow.dTotalForeignPrice; + sFieldName = `d${models}ForeignPrice` + } + + } + if( sModelsType === 'sales/adjust') { + tableDataRow.dProductMoney = tableDataRow.dTotalMoney; + sFieldName = 'dProductMoney'; + } + if (sModelsType.includes('purchase/') || sModelsType.includes('quotation/') || sModelsType.includes('manufacture/') || sModelsType.includes('materialsStock/') || sModelsType.includes('outside/') || sModelsType.includes('semigoodsStock/') || sModelsType.includes('sales/materials') || sModelsType === 'sales/salesCheck') { if (sModelsType.includes('sales/materials') || sModelsType === 'sales/salesCheck') { @@ -5022,7 +5039,18 @@ export default (ChildComponent) => { tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'sTaxId', returnData.masterData, tableDataRow); } } else if (sFieldName === 'sCurrency' || sFieldName === 'dCurrencyRate' || sFieldName ==='sCurrencyName') { - tableDataRow = commonBusiness.getCalculateAllMoney(app, models, `dN${models}Money`, returnData.masterData, tableDataRow); + let controlField =`d${models}ForeignPrice`; + if(sModelsType?.includes('cashier/')) { + tableDataRow.bSettleMoney = true; + tableDataRow[`d${models}ForeignPrice`] = tableDataRow.dTotalForeignPrice; + tableDataRow[`d${models}Money`] = tableDataRow.dTotalMoney; + + } + if( sModelsType === 'sales/adjust') { + tableDataRow.dProductMoney = tableDataRow.dTotalMoney; + controlField = 'dProductMoney'; + } + tableDataRow = commonBusiness.getCalculateAllMoney(app, models, controlField, returnData.masterData, tableDataRow); tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; } if ((sFieldName === 'sWareHouseId' || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName' || diff --git a/src/components/Common/CommonNewBillEvent.js b/src/components/Common/CommonNewBillEvent.js index 31495da..0128c59 100644 --- a/src/components/Common/CommonNewBillEvent.js +++ b/src/components/Common/CommonNewBillEvent.js @@ -3413,6 +3413,8 @@ export default (ChildComponent) => { || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName' || sFieldName === 'tDeliverDate' || sFieldName === 'sCurrency' || sFieldName === 'dCurrencyRate' || sFieldName === 'sCurrencyName') { const slaveDataNew = []; + const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; + for (const item of slaveData) { let tableDataRow = ((sFieldName === 'sWareHouseId' || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName') && (sModelsType.includes('materialsStock/productionmaterialsadjust'))) ? { ...item } : { ...item, [sFieldName]: changeValue[sFieldName] }; @@ -3422,7 +3424,6 @@ export default (ChildComponent) => { tableDataRow.sTaxName = changeValue.sTaxName; tableDataRow.dTaxRate = changeValue.dTaxRate; tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; - const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') || sModelsType.includes('semigoodsStock/') ? 'Product' : 'Materials'; let dMaterialsMoney = ''; if (sModelsType && sModelsType.includes('outside/')) { /* 工序发外 */ let sComputeId = ''; @@ -3451,7 +3452,7 @@ export default (ChildComponent) => { tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'sTaxId', returnData.masterData, tableDataRow); } } else if (sFieldName === 'sCurrency' || sFieldName === 'dCurrencyRate' || sFieldName === 'sCurrencyName') { - tableDataRow = commonBusiness.getCalculateAllMoney(app, models, `dN${models}Money`, returnData.masterData, tableDataRow); + tableDataRow = commonBusiness.getCalculateAllMoney(app, models, `d${models}ForeignPrice`, returnData.masterData, tableDataRow); tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; } if ((sFieldName === 'sWareHouseId' || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName') && (!sModelsType.includes('materialsStock/productionmaterialsadjust'))) { diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index 55e58f6..f9ab8c7 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -485,6 +485,17 @@ export function getCalculateByPrice(app, type, masterData, tableDataRow, sFieldN if (tableDataRow.bSalesMaterials) { /* 材料销售 */ type = 'Product'; + } else if (tableDataRow.bSettleMoney) { /* 收付款单 */ + if (sFieldName !== `d${type}TaxMoney`) { + tableDataRow[`d${type}TaxMoney`] = commonUtils.convertFixNum(dProductTaxMoney, dNetMoney); + } + if (sFieldName !== `d${type}ForeignMoney`) { + tableDataRow[`d${type}ForeignMoney`] = dProductForeignMoney; /* 外币金额 */ + } + if (sFieldName !== `d${type}NoTaxMoney`) { + tableDataRow[`d${type}NoTaxMoney`] = commonUtils.convertFixNum(dProductNoTaxMoney, dNetMoney); + } + type = 'Total'; } if (sFieldName !== `d${type}Money`) { tableDataRow[`d${type}Money`] = commonUtils.convertFixNum(dProductMoney, dNetMoney); @@ -842,6 +853,17 @@ export function getCalculateMoneyNew(app, masterData, tableDataRow, type, sField if (tableDataRow.bSalesMaterials) { /* 材料销售 */ type = 'Product'; + } else if (tableDataRow.bSettleMoney) { /* 收付款单 */ + if (sFieldName !== `d${type}TaxMoney`) { + tableDataRow[`d${type}TaxMoney`] = commonUtils.convertFixNum(dProductTaxMoney, dNetMoney); + } + if (sFieldName !== `d${type}ForeignMoney`) { + tableDataRow[`d${type}ForeignMoney`] = dProductForeignMoney; /* 外币金额 */ + } + if (sFieldName !== `d${type}NoTaxMoney`) { + tableDataRow[`d${type}NoTaxMoney`] = commonUtils.convertFixNum(dProductNoTaxMoney, dNetMoney); + } + type = 'Total'; } /* 数据赋值 */