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