wip:出口报关明细报表,海运费(结算币别)
This commit is contained in:
parent
a65e1d2a52
commit
aaa6982cda
@ -103,6 +103,9 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
selectfields.add("yem_reightamtbase yem_reightamtbase");//海运费(本位币)
|
selectfields.add("yem_reightamtbase yem_reightamtbase");//海运费(本位币)
|
||||||
selectfields.add("yem_premiumamtbase yem_premiumamtbase");//保费(本位币)
|
selectfields.add("yem_premiumamtbase yem_premiumamtbase");//保费(本位币)
|
||||||
|
|
||||||
|
selectfields.add("yem_reightamtend yem_reightamtend");//海运费(结算币别)
|
||||||
|
selectfields.add("yem_premiumamtcy yem_premiumamtcy");//保费(结算币别)
|
||||||
|
|
||||||
|
|
||||||
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_declaredocx", String.join(",", selectfields), qFilter.toArray());
|
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_declaredocx", String.join(",", selectfields), qFilter.toArray());
|
||||||
|
|
||||||
@ -110,7 +113,9 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
// 2、海运费(美元)=海运费(本位币)/美元汇率;
|
// 2、海运费(美元)=海运费(本位币)/美元汇率;
|
||||||
"yem_reightamtbase / yem_usdrate usd_sea_amt, " +
|
"yem_reightamtbase / yem_usdrate usd_sea_amt, " +
|
||||||
// 3、运保费(美元)=运保费(本位币)/美元汇率;
|
// 3、运保费(美元)=运保费(本位币)/美元汇率;
|
||||||
"yem_premiumamtbase / yem_usdrate usd_pmamt_amt");
|
"yem_premiumamtbase / yem_usdrate usd_pmamt_amt, " +
|
||||||
|
// 美元汇率(百)
|
||||||
|
"yem_usdrate * 100 yem_usdratehund");
|
||||||
|
|
||||||
DataSet aggPort = aggBaseDataPort(qFilter);
|
DataSet aggPort = aggBaseDataPort(qFilter);
|
||||||
|
|
||||||
@ -134,6 +139,7 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
dataSet = dataSet.addField("0.0", "yem_usdseaamt");//美元海运费
|
dataSet = dataSet.addField("0.0", "yem_usdseaamt");//美元海运费
|
||||||
dataSet = dataSet.addField("0.0", "yem_basepremiumamt");//原币保险费
|
dataSet = dataSet.addField("0.0", "yem_basepremiumamt");//原币保险费
|
||||||
dataSet = dataSet.addField("0.0", "yem_usdpremiumamt");//美元保险费
|
dataSet = dataSet.addField("0.0", "yem_usdpremiumamt");//美元保险费
|
||||||
|
dataSet = dataSet.addField("0.0", "tmp_reightamtend");//海运费(结算币别)
|
||||||
dataSet = RptUtil.zeroNullNums(dataSet);
|
dataSet = RptUtil.zeroNullNums(dataSet);
|
||||||
DynamicObjectCollection collection = ORM.create().toPlainDynamicObjectCollection(dataSet.copy());
|
DynamicObjectCollection collection = ORM.create().toPlainDynamicObjectCollection(dataSet.copy());
|
||||||
Map<String, List<DynamicObject>> map = new LinkedHashMap<>();
|
Map<String, List<DynamicObject>> map = new LinkedHashMap<>();
|
||||||
@ -165,12 +171,15 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
BigDecimal share_usdseaamt = BigDecimal.ZERO;//美元海运费分摊
|
BigDecimal share_usdseaamt = BigDecimal.ZERO;//美元海运费分摊
|
||||||
BigDecimal share_basepremiumamt = BigDecimal.ZERO;//原币保险费分摊
|
BigDecimal share_basepremiumamt = BigDecimal.ZERO;//原币保险费分摊
|
||||||
BigDecimal share_usdpremiumamt = BigDecimal.ZERO;//美元保险费分摊
|
BigDecimal share_usdpremiumamt = BigDecimal.ZERO;//美元保险费分摊
|
||||||
|
BigDecimal share_tmp_reightamtend = BigDecimal.ZERO;//海运费(结算币别)分摊
|
||||||
for (DynamicObject d : value) {
|
for (DynamicObject d : value) {
|
||||||
BigDecimal amount = d.getBigDecimal("yem_amount");//金额
|
BigDecimal amount = d.getBigDecimal("yem_amount");//金额
|
||||||
BigDecimal seausdamtsum = d.getBigDecimal("yem_seausdamtsum");//海运费USD总价
|
BigDecimal seausdamtsum = d.getBigDecimal("yem_seausdamtsum");//海运费USD总价
|
||||||
BigDecimal usdSeaAmt = d.getBigDecimal("usd_sea_amt");//海运费(美元)
|
BigDecimal usdSeaAmt = d.getBigDecimal("usd_sea_amt");//海运费(美元)
|
||||||
BigDecimal premiumamt = d.getBigDecimal("yem_premiumamt");//原币保险费
|
BigDecimal premiumamt = d.getBigDecimal("yem_premiumamt");//原币保险费
|
||||||
BigDecimal usdPmamtAmt = d.getBigDecimal("usd_pmamt_amt");//美元保险费
|
BigDecimal usdPmamtAmt = d.getBigDecimal("usd_pmamt_amt");//美元保险费
|
||||||
|
BigDecimal reightamtend = d.getBigDecimal("yem_reightamtend");//海运费(结算币别)
|
||||||
|
|
||||||
|
|
||||||
BigDecimal rate = BigDecimalUtils.div(amount, sumAmt, 10);
|
BigDecimal rate = BigDecimalUtils.div(amount, sumAmt, 10);
|
||||||
|
|
||||||
@ -190,25 +199,30 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
BigDecimal usdpremiumamt = rate.multiply(usdPmamtAmt);
|
BigDecimal usdpremiumamt = rate.multiply(usdPmamtAmt);
|
||||||
usdpremiumamt = usdpremiumamt.setScale(2, RoundingMode.HALF_UP);
|
usdpremiumamt = usdpremiumamt.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
|
//海运费(结算币别)
|
||||||
|
BigDecimal tmp_reightamtend = rate.multiply(reightamtend);
|
||||||
|
tmp_reightamtend = tmp_reightamtend.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
|
//保费(结算币别)
|
||||||
|
|
||||||
if (isLastRow(d, value)) {
|
if (isLastRow(d, value)) {
|
||||||
d.set("yem_baseseaamt", seausdamtsum.subtract(share_baseseaamt));//原币海运费
|
d.set("yem_baseseaamt", seausdamtsum.subtract(share_baseseaamt));//原币海运费
|
||||||
d.set("yem_usdseaamt", usdSeaAmt.subtract(share_usdseaamt));//美元海运费
|
d.set("yem_usdseaamt", usdSeaAmt.subtract(share_usdseaamt));//美元海运费
|
||||||
d.set("yem_basepremiumamt", premiumamt.subtract(share_basepremiumamt));//原币保险费
|
d.set("yem_basepremiumamt", premiumamt.subtract(share_basepremiumamt));//原币保险费
|
||||||
d.set("yem_usdpremiumamt", usdpremiumamt.subtract(share_usdpremiumamt));//美元保险费
|
d.set("yem_usdpremiumamt", usdpremiumamt.subtract(share_usdpremiumamt));//美元保险费
|
||||||
|
d.set("tmp_reightamtend", tmp_reightamtend.subtract(share_tmp_reightamtend));//海运费(结算币别)
|
||||||
} else {
|
} else {
|
||||||
share_baseseaamt = share_baseseaamt.add(baseseaamt);
|
share_baseseaamt = share_baseseaamt.add(baseseaamt);
|
||||||
share_usdseaamt = share_usdseaamt.add(usdseaamt);
|
share_usdseaamt = share_usdseaamt.add(usdseaamt);
|
||||||
share_basepremiumamt = share_basepremiumamt.add(basepremiumamt);
|
share_basepremiumamt = share_basepremiumamt.add(basepremiumamt);
|
||||||
|
share_tmp_reightamtend = share_tmp_reightamtend.add(tmp_reightamtend);
|
||||||
d.set("yem_baseseaamt", baseseaamt);//原币海运费
|
d.set("yem_baseseaamt", baseseaamt);//原币海运费
|
||||||
d.set("yem_usdseaamt", usdseaamt);//美元海运费
|
d.set("yem_usdseaamt", usdseaamt);//美元海运费
|
||||||
d.set("yem_basepremiumamt", basepremiumamt);//原币保险费
|
d.set("yem_basepremiumamt", basepremiumamt);//原币保险费
|
||||||
d.set("yem_usdpremiumamt", usdpremiumamt);//美元保险费
|
d.set("yem_usdpremiumamt", usdpremiumamt);//美元保险费
|
||||||
|
d.set("tmp_reightamtend", tmp_reightamtend);//海运费(结算币别)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dc.add(d);
|
dc.add(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -410,7 +424,11 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
selectfields.add("billno exportinvoice_billno");
|
selectfields.add("billno exportinvoice_billno");
|
||||||
selectfields.add("yem_exportinvoice_c.yem_customsdeclaration yem_unit");
|
selectfields.add("yem_exportinvoice_c.yem_customsdeclaration yem_unit");
|
||||||
selectfields.add("yem_exportinvoice_c.yem_sourcebillentryid ddd_id_ei_entry_fk");
|
selectfields.add("yem_exportinvoice_c.yem_sourcebillentryid ddd_id_ei_entry_fk");
|
||||||
|
selectfields.add("yem_exrate yem_baserate");//原币汇率
|
||||||
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_exportinvoice", String.join(",", selectfields), qFilter.toArray());
|
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_exportinvoice", String.join(",", selectfields), qFilter.toArray());
|
||||||
|
dataSet = dataSet.select(String.join(",", RptUtil.getDataSetFiledAlias(dataSet)) + "," +
|
||||||
|
//原币汇率(百)
|
||||||
|
"yem_baserate * 100 yem_baserathund");
|
||||||
return dataSet;
|
return dataSet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user