fix:
1.订舱通知单分摊金额本位币计算
This commit is contained in:
parent
c62ff30599
commit
399d28e075
@ -59,37 +59,6 @@ public class DeclareDocxToExportinvoiceConvert extends AbstractConvertPlugIn {
|
|||||||
yem_sumamt = yem_sumamt.add(str.getBigDecimal("yem_cusamount"));
|
yem_sumamt = yem_sumamt.add(str.getBigDecimal("yem_cusamount"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 1、出口报关单下推出口发票时,出口发票-报关商品页签分摊金额,计算逻辑:
|
|
||||||
* (1)分摊金额=金额/金额合计*((海运费结算币别+保费结算币别+佣金结算币别)
|
|
||||||
* (2)开票金额=金额-分摊金额;
|
|
||||||
* (3)开票单价=开票金额/数量;
|
|
||||||
* 2、分摊金额的合计值 与 海运费结算币别+保费结算币别+佣金结算币别 需一致,如果分摊产生的尾差,统一调整在报关商品分录的最后一行;
|
|
||||||
*/
|
|
||||||
BigDecimal yem_seabase = dataEntity.getBigDecimal("yem_seabase");//海运费(结算币别)
|
|
||||||
BigDecimal yem_insurefeecurrba = dataEntity.getBigDecimal("yem_insurefeecurrba");//保费(结算币别)
|
|
||||||
BigDecimal yem_commission = dataEntity.getBigDecimal("yem_commission");//佣金(结算币别)
|
|
||||||
BigDecimal sum = yem_seabase.add(yem_insurefeecurrba).add(yem_commission);
|
|
||||||
BigDecimal sumyem_shareamt = BigDecimal.ZERO;
|
|
||||||
// for (Iterator<DynamicObject> iterator = yemExportinvoiceC.iterator(); iterator.hasNext(); ) {
|
|
||||||
// DynamicObject yemExportinvoiceCs = iterator.next();
|
|
||||||
// BigDecimal yem_shareamt=yemExportinvoiceCs.getBigDecimal("yem_cusamount").divide(yem_sumamt,4).multiply(sum);
|
|
||||||
// yemExportinvoiceCs.set("yem_shareamt",yem_shareamt);//分摊金额
|
|
||||||
// sumyem_shareamt=sumyem_shareamt.add(yem_shareamt);
|
|
||||||
//
|
|
||||||
// BigDecimal yem_invoiceamt=yemExportinvoiceCs.getBigDecimal("yem_cusamount").subtract(yem_shareamt);
|
|
||||||
// yemExportinvoiceCs.set("yem_invoiceamt",yem_invoiceamt);//开票金额
|
|
||||||
//
|
|
||||||
// BigDecimal yem_invoiceprice=yem_invoiceamt.divide(yemExportinvoiceCs.getBigDecimal("yem_cusqty"));
|
|
||||||
// yemExportinvoiceCs.set("yem_invoiceprice",yem_invoiceprice);//开票单价
|
|
||||||
//
|
|
||||||
// if (!iterator.hasNext())
|
|
||||||
// {
|
|
||||||
// yemExportinvoiceCs.set("yem_shareamt", sum.subtract(sumyem_shareamt).add(yem_shareamt));//分摊金额
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
calculatePremium(dataEntity);
|
calculatePremium(dataEntity);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -209,11 +178,11 @@ public class DeclareDocxToExportinvoiceConvert extends AbstractConvertPlugIn {
|
|||||||
|
|
||||||
//报关单(海运费/金额)
|
//报关单(海运费/金额)
|
||||||
BigDecimal yem_count = dataEntity.getBigDecimal("yem_count");
|
BigDecimal yem_count = dataEntity.getBigDecimal("yem_count");
|
||||||
//销售金额合计值 1,295,997.50
|
//销售金额合计值
|
||||||
BigDecimal yem_localamountsum = BigDecimal.ZERO;
|
BigDecimal yem_localamountsum = BigDecimal.ZERO;
|
||||||
DynamicObjectCollection yem_exportinvoice_c = dataEntity.getDynamicObjectCollection("yem_exportinvoice_c");
|
DynamicObjectCollection yem_exportinvoice_c = dataEntity.getDynamicObjectCollection("yem_exportinvoice_c");
|
||||||
for (DynamicObject yem_exportinvoice : yem_exportinvoice_c) {
|
for (DynamicObject yem_exportinvoice : yem_exportinvoice_c) {
|
||||||
BigDecimal yem_localamount = yem_exportinvoice.getBigDecimal("yem_localamount");
|
BigDecimal yem_localamount = yem_exportinvoice.getBigDecimal("yem_cusamount");
|
||||||
yem_localamountsum = yem_localamountsum.add(yem_localamount);
|
yem_localamountsum = yem_localamountsum.add(yem_localamount);
|
||||||
}
|
}
|
||||||
//汇率
|
//汇率
|
||||||
@ -226,7 +195,7 @@ public class DeclareDocxToExportinvoiceConvert extends AbstractConvertPlugIn {
|
|||||||
BigDecimal yem_commissionba = dataEntity.getBigDecimal("yem_commissionba");
|
BigDecimal yem_commissionba = dataEntity.getBigDecimal("yem_commissionba");
|
||||||
BigDecimal ybz = yem_seatransfeebase.add(yem_insurefeebase).add(yem_commissionba);
|
BigDecimal ybz = yem_seatransfeebase.add(yem_insurefeebase).add(yem_commissionba);
|
||||||
for (DynamicObject exportinvoice : yem_exportinvoice_c) {
|
for (DynamicObject exportinvoice : yem_exportinvoice_c) {
|
||||||
BigDecimal yem_localamount = exportinvoice.getBigDecimal("yem_localamount");
|
BigDecimal yem_localamount = exportinvoice.getBigDecimal("yem_cusamount");
|
||||||
if (yem_localamount.compareTo(BigDecimal.ZERO) == 1) {
|
if (yem_localamount.compareTo(BigDecimal.ZERO) == 1) {
|
||||||
BigDecimal yem_localassessedamo = ybz.multiply(yem_localamount).divide(yem_localamountsum, 10, BigDecimal.ROUND_HALF_UP);
|
BigDecimal yem_localassessedamo = ybz.multiply(yem_localamount).divide(yem_localamountsum, 10, BigDecimal.ROUND_HALF_UP);
|
||||||
exportinvoice.set("yem_localassessedamo", yem_localassessedamo);
|
exportinvoice.set("yem_localassessedamo", yem_localassessedamo);
|
||||||
@ -234,7 +203,6 @@ public class DeclareDocxToExportinvoiceConvert extends AbstractConvertPlugIn {
|
|||||||
BigDecimal localamount = exportinvoice.getBigDecimal("yem_localamount"); // 金额(本位币)\
|
BigDecimal localamount = exportinvoice.getBigDecimal("yem_localamount"); // 金额(本位币)\
|
||||||
BigDecimal localinvoicedamo = localamount.subtract(yem_localassessedamo);
|
BigDecimal localinvoicedamo = localamount.subtract(yem_localassessedamo);
|
||||||
exportinvoice.set("yem_localinvoicedamo", localinvoicedamo);
|
exportinvoice.set("yem_localinvoicedamo", localinvoicedamo);
|
||||||
// yem_localinvoicingunit = yem_localinvoicedamo / yem_cusqty
|
|
||||||
// 开票单价(本位币) = 开票金额(本位币) / 数量
|
// 开票单价(本位币) = 开票金额(本位币) / 数量
|
||||||
BigDecimal cusqty = exportinvoice.getBigDecimal("yem_cusqty");
|
BigDecimal cusqty = exportinvoice.getBigDecimal("yem_cusqty");
|
||||||
exportinvoice.set("yem_localinvoicingunit", BigDecimalUtils.div(localinvoicedamo, cusqty, 2));
|
exportinvoice.set("yem_localinvoicingunit", BigDecimalUtils.div(localinvoicedamo, cusqty, 2));
|
||||||
|
Loading…
Reference in New Issue
Block a user