传BIP逻辑修改2

This commit is contained in:
李贵强 2025-07-03 18:49:50 +08:00
parent 19d5ef28d2
commit d1ecace98e
1 changed files with 10 additions and 22 deletions

View File

@ -660,10 +660,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
BigDecimal commonTaxRate = null;
Long commonTaxRateId = null;
boolean hasDifferentTaxRates = false;
//本次核销不含税金额=含税金额本次核销金额÷ (1 + 税率)
BigDecimal entryNotTaxAmount;
//本次核销金额的税额=含税金额本次核销金额 - 本次核销不含税金额
//BigDecimal entryTaxAmount = BigDecimal.ZERO;
// 遍历发票
for (DynamicObject invoiceObj : invoiceEntry) {
@ -680,10 +677,6 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
if (invoice != null) {
String invoiceName = invoice.getString("name");
if (invoiceName != null && invoiceName.contains("专用")) {
taxAmount = taxAmount.add(hasWriteOffAmt);
// 发票登记-发票明细只有一行
DynamicObjectCollection invoiceDetails = invoiceBill.getDynamicObjectCollection("invoiceentry");
if (invoiceDetails != null && invoiceDetails.size() != 0) {
@ -693,11 +686,13 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
Long currentTaxRateId = (Long) entryTaxRate.getPkValue();
BigDecimal currentTaxRate = entryTaxRate.getBigDecimal("taxrate");
//本次核销不含税金额=含税金额本次核销金额÷ (1 + 税率)
entryNotTaxAmount=hasWriteOffAmt.divide(currentTaxRate.add(BigDecimal.ONE),2, RoundingMode.HALF_UP);
BigDecimal entryNotTaxAmount=hasWriteOffAmt.divide(currentTaxRate.add(BigDecimal.ONE),2, RoundingMode.HALF_UP);
// 专票不含税=本次核销不含税金额累加
// 本次核销不含税金额累加
notTaxAmount=notTaxAmount.add(entryNotTaxAmount);
//本次核销税额 = 申请核销-本次核销不含税
BigDecimal entryTaxAmount=hasWriteOffAmt.subtract(entryNotTaxAmount).setScale(2, RoundingMode.HALF_UP);
taxAmount = taxAmount.add(entryTaxAmount);
// 第一次遇到税率记录下来
if (commonTaxRateId == null) {
commonTaxRateId = currentTaxRateId;
@ -778,7 +773,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
}
}
else {
// 税额=本次核销税额累加只针对专票
// 税额=本次申请核销税额累加只针对专票
BigDecimal taxAmount = BigDecimal.ZERO;
//不含税金额(专普混合专票本次核销不含税金额累加+普票用本次核销金额进行累加)
BigDecimal notTaxAmount = BigDecimal.ZERO;
@ -786,10 +781,6 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
BigDecimal commonTaxRate = null;
Long commonTaxRateId = null;
boolean hasDifferentTaxRates = false;
//本次核销不含税金额=含税金额本次核销金额÷ (1 + 税率)
BigDecimal entryNotTaxAmount;
//本次核销金额的税额=含税金额本次核销金额 - 本次核销不含税金额
//BigDecimal entryTaxAmount = BigDecimal.ZERO;
// 遍历发票
for (DynamicObject invoiceObj : invoiceEntry) {
@ -800,16 +791,11 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
if (invoiceBill != null) {
//本次核销金额
BigDecimal hasWriteOffAmt = invoiceObj.getBigDecimal("inventry_haswriteoffamt");
// 判断发票登记-发票类型-名称
DynamicObject invoice = invoiceBill.getDynamicObject("invoice");
if (invoice != null) {
String invoiceName = invoice.getString("name");
if (invoiceName != null && invoiceName.contains("专用")) {
taxAmount = taxAmount.add(hasWriteOffAmt);
// 发票登记-发票明细只有一行
DynamicObjectCollection invoiceDetails = invoiceBill.getDynamicObjectCollection("invoiceentry");
if (invoiceDetails != null && invoiceDetails.size() != 0) {
@ -819,11 +805,13 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
Long currentTaxRateId = (Long) entryTaxRate.getPkValue();
BigDecimal currentTaxRate = entryTaxRate.getBigDecimal("taxrate");
//本次核销不含税金额=含税金额本次核销金额÷ (1 + 税率)
entryNotTaxAmount=hasWriteOffAmt.divide(currentTaxRate.add(BigDecimal.ONE),2, RoundingMode.HALF_UP);
BigDecimal entryNotTaxAmount=hasWriteOffAmt.divide(currentTaxRate.add(BigDecimal.ONE),2, RoundingMode.HALF_UP);
// 专票不含税=本次核销不含税金额累加
// 本次核销不含税金额累加
notTaxAmount=notTaxAmount.add(entryNotTaxAmount);
//本次核销税额 = 申请核销-本次核销不含税
BigDecimal entryTaxAmount=hasWriteOffAmt.subtract(entryNotTaxAmount).setScale(2, RoundingMode.HALF_UP);
taxAmount = taxAmount.add(entryTaxAmount);
// 第一次遇到税率记录下来
if (commonTaxRateId == null) {
commonTaxRateId = currentTaxRateId;