Commit ccba4bb7b3e718e234e6dbff694a475ad9f46437

Authored by 陈鑫涛
2 parents 887c32ff 823a145f

Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi into main

src/components/Common/CommonBillEvent.js
... ... @@ -4592,6 +4592,23 @@ export default (ChildComponent) => {
4592 4592 /* 各种金额,税额,价格计算 */
4593 4593 let models = name === 'materials' ? 'Materials' :
4594 4594 sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
  4595 +
  4596 + if( sModelsType?.includes('cashier/')) {
  4597 + tableDataRow.bSettleMoney = true;/* 收付款单 */
  4598 + if(sFieldName === 'dTotalMoney') {
  4599 + tableDataRow[`d${models}Money`] =tableDataRow.dTotalMoney;
  4600 + sFieldName = `d${models}Money`;
  4601 + } else if(sFieldName === 'dTotalForeignPrice') {
  4602 + tableDataRow[`d${models}ForeignPrice`] = tableDataRow.dTotalForeignPrice;
  4603 + sFieldName = `d${models}ForeignPrice`
  4604 + }
  4605 +
  4606 + }
  4607 + if( sModelsType === 'sales/adjust') {
  4608 + tableDataRow.dProductMoney = tableDataRow.dTotalMoney;
  4609 + sFieldName = 'dProductMoney';
  4610 + }
  4611 +
4595 4612 if (sModelsType.includes('purchase/') || sModelsType.includes('quotation/') || sModelsType.includes('manufacture/') || sModelsType.includes('materialsStock/')
4596 4613 || sModelsType.includes('outside/') || sModelsType.includes('semigoodsStock/') || sModelsType.includes('sales/materials') || sModelsType === 'sales/salesCheck') {
4597 4614 if (sModelsType.includes('sales/materials') || sModelsType === 'sales/salesCheck') {
... ... @@ -5022,7 +5039,18 @@ export default (ChildComponent) => {
5022 5039 tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'sTaxId', returnData.masterData, tableDataRow);
5023 5040 }
5024 5041 } else if (sFieldName === 'sCurrency' || sFieldName === 'dCurrencyRate' || sFieldName ==='sCurrencyName') {
5025   - tableDataRow = commonBusiness.getCalculateAllMoney(app, models, `dN${models}Money`, returnData.masterData, tableDataRow);
  5042 + let controlField =`d${models}ForeignPrice`;
  5043 + if(sModelsType?.includes('cashier/')) {
  5044 + tableDataRow.bSettleMoney = true;
  5045 + tableDataRow[`d${models}ForeignPrice`] = tableDataRow.dTotalForeignPrice;
  5046 + tableDataRow[`d${models}Money`] = tableDataRow.dTotalMoney;
  5047 +
  5048 + }
  5049 + if( sModelsType === 'sales/adjust') {
  5050 + tableDataRow.dProductMoney = tableDataRow.dTotalMoney;
  5051 + controlField = 'dProductMoney';
  5052 + }
  5053 + tableDataRow = commonBusiness.getCalculateAllMoney(app, models, controlField, returnData.masterData, tableDataRow);
5026 5054 tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType;
5027 5055 }
5028 5056 if ((sFieldName === 'sWareHouseId' || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName' ||
... ...
src/components/Common/CommonNewBillEvent.js
... ... @@ -3413,6 +3413,8 @@ export default (ChildComponent) => {
3413 3413 || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName' || sFieldName === 'tDeliverDate'
3414 3414 || sFieldName === 'sCurrency' || sFieldName === 'dCurrencyRate' || sFieldName === 'sCurrencyName') {
3415 3415 const slaveDataNew = [];
  3416 + const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
  3417 +
3416 3418 for (const item of slaveData) {
3417 3419 let tableDataRow = ((sFieldName === 'sWareHouseId' || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName') && (sModelsType.includes('materialsStock/productionmaterialsadjust'))) ?
3418 3420 { ...item } : { ...item, [sFieldName]: changeValue[sFieldName] };
... ... @@ -3422,7 +3424,6 @@ export default (ChildComponent) => {
3422 3424 tableDataRow.sTaxName = changeValue.sTaxName;
3423 3425 tableDataRow.dTaxRate = changeValue.dTaxRate;
3424 3426 tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType;
3425   - const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') || sModelsType.includes('semigoodsStock/') ? 'Product' : 'Materials';
3426 3427 let dMaterialsMoney = '';
3427 3428 if (sModelsType && sModelsType.includes('outside/')) { /* 工序发外 */
3428 3429 let sComputeId = '';
... ... @@ -3451,7 +3452,7 @@ export default (ChildComponent) => {
3451 3452 tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'sTaxId', returnData.masterData, tableDataRow);
3452 3453 }
3453 3454 } else if (sFieldName === 'sCurrency' || sFieldName === 'dCurrencyRate' || sFieldName === 'sCurrencyName') {
3454   - tableDataRow = commonBusiness.getCalculateAllMoney(app, models, `dN${models}Money`, returnData.masterData, tableDataRow);
  3455 + tableDataRow = commonBusiness.getCalculateAllMoney(app, models, `d${models}ForeignPrice`, returnData.masterData, tableDataRow);
3455 3456 tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType;
3456 3457 }
3457 3458 if ((sFieldName === 'sWareHouseId' || sFieldName === 'sWareHouseNo' || sFieldName === 'sWareHouseName') && (!sModelsType.includes('materialsStock/productionmaterialsadjust'))) {
... ...
src/components/Common/commonBusiness.js
... ... @@ -485,6 +485,17 @@ export function getCalculateByPrice(app, type, masterData, tableDataRow, sFieldN
485 485  
486 486 if (tableDataRow.bSalesMaterials) { /* 材料销售 */
487 487 type = 'Product';
  488 + } else if (tableDataRow.bSettleMoney) { /* 收付款单 */
  489 + if (sFieldName !== `d${type}TaxMoney`) {
  490 + tableDataRow[`d${type}TaxMoney`] = commonUtils.convertFixNum(dProductTaxMoney, dNetMoney);
  491 + }
  492 + if (sFieldName !== `d${type}ForeignMoney`) {
  493 + tableDataRow[`d${type}ForeignMoney`] = dProductForeignMoney; /* 外币金额 */
  494 + }
  495 + if (sFieldName !== `d${type}NoTaxMoney`) {
  496 + tableDataRow[`d${type}NoTaxMoney`] = commonUtils.convertFixNum(dProductNoTaxMoney, dNetMoney);
  497 + }
  498 + type = 'Total';
488 499 }
489 500 if (sFieldName !== `d${type}Money`) {
490 501 tableDataRow[`d${type}Money`] = commonUtils.convertFixNum(dProductMoney, dNetMoney);
... ... @@ -842,6 +853,17 @@ export function getCalculateMoneyNew(app, masterData, tableDataRow, type, sField
842 853  
843 854 if (tableDataRow.bSalesMaterials) { /* 材料销售 */
844 855 type = 'Product';
  856 + } else if (tableDataRow.bSettleMoney) { /* 收付款单 */
  857 + if (sFieldName !== `d${type}TaxMoney`) {
  858 + tableDataRow[`d${type}TaxMoney`] = commonUtils.convertFixNum(dProductTaxMoney, dNetMoney);
  859 + }
  860 + if (sFieldName !== `d${type}ForeignMoney`) {
  861 + tableDataRow[`d${type}ForeignMoney`] = dProductForeignMoney; /* 外币金额 */
  862 + }
  863 + if (sFieldName !== `d${type}NoTaxMoney`) {
  864 + tableDataRow[`d${type}NoTaxMoney`] = commonUtils.convertFixNum(dProductNoTaxMoney, dNetMoney);
  865 + }
  866 + type = 'Total';
845 867 }
846 868  
847 869 /* 数据赋值 */
... ...