|
@@ -84,18 +84,27 @@ public class InvoiceDetailServiceImpl extends MPJBaseServiceImpl<InvoiceDetailMa
|
|
|
rows.add(row);
|
|
rows.add(row);
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- // 新版航信发票:无发票行明细,一张发票汇为一行,金额统一为元
|
|
|
|
|
|
|
+ // 新版航信发票:无发票行明细,根据含税总金额反算各项(税率固定13%)
|
|
|
var row = new HashMap<>(baseInfo);
|
|
var row = new HashMap<>(baseInfo);
|
|
|
- row.put("goods_name", "");
|
|
|
|
|
- row.put("quantity", "");
|
|
|
|
|
- row.put("amount", invoiceDetail.getAmount() != null
|
|
|
|
|
- ? NumberUtil.decimalFormat("#.##", invoiceDetail.getAmount() / 100.0) : "");
|
|
|
|
|
- row.put("tax_amount", invoiceDetail.getTaxAmount() != null
|
|
|
|
|
- ? NumberUtil.decimalFormat("#.##", invoiceDetail.getTaxAmount() / 100.0) : "");
|
|
|
|
|
- row.put("tax_rate", "");
|
|
|
|
|
- // 航信发票额外导出含税总金额,方便财务对账
|
|
|
|
|
- row.put("total_amount_has_tax", invoiceDetail.getTotalAmount() != null
|
|
|
|
|
- ? NumberUtil.decimalFormat("#.##", invoiceDetail.getTotalAmount() / 100.0) : "");
|
|
|
|
|
|
|
+ var totalAmount = invoiceDetail.getTotalAmount();
|
|
|
|
|
+ if (totalAmount != null && totalAmount > 0) {
|
|
|
|
|
+ double totalYuan = totalAmount / 100.0;
|
|
|
|
|
+ double amountYuan = totalYuan / 1.13;
|
|
|
|
|
+ double taxYuan = totalYuan - amountYuan;
|
|
|
|
|
+ row.put("goods_name", "充电费用");
|
|
|
|
|
+ row.put("quantity", 1);
|
|
|
|
|
+ row.put("amount", NumberUtil.decimalFormat("#.##", amountYuan));
|
|
|
|
|
+ row.put("tax_amount", NumberUtil.decimalFormat("#.##", taxYuan));
|
|
|
|
|
+ row.put("tax_rate", "13%");
|
|
|
|
|
+ row.put("total_amount_has_tax", NumberUtil.decimalFormat("#.##", totalYuan));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.put("goods_name", "");
|
|
|
|
|
+ row.put("quantity", "");
|
|
|
|
|
+ row.put("amount", "");
|
|
|
|
|
+ row.put("tax_amount", "");
|
|
|
|
|
+ row.put("tax_rate", "");
|
|
|
|
|
+ row.put("total_amount_has_tax", "");
|
|
|
|
|
+ }
|
|
|
rows.add(row);
|
|
rows.add(row);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|