fix:
1.销售出库单提交,客户有信保逾期或者欠条没核销不能提交,获取到逾期金额和欠条金额
This commit is contained in:
parent
3f03c787b3
commit
6af58fd314
@ -36,6 +36,7 @@ public class DeliverNoticeSubmitValidator extends AbstractValidator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后一笔出库的时候,判断出库金额是否和合同金额相等
|
* 最后一笔出库的时候,判断出库金额是否和合同金额相等
|
||||||
|
*
|
||||||
* @param dataEntitie
|
* @param dataEntitie
|
||||||
*/
|
*/
|
||||||
private void checkAmountAligned(ExtendedDataEntity dataEntitie) {
|
private void checkAmountAligned(ExtendedDataEntity dataEntitie) {
|
||||||
@ -147,10 +148,10 @@ public class DeliverNoticeSubmitValidator extends AbstractValidator {
|
|||||||
/**
|
/**
|
||||||
* 校验当前客户是否有信保逾期
|
* 校验当前客户是否有信保逾期
|
||||||
* 信保限额申请单分录的应收款日期1小于当前时间并且有欠款金额
|
* 信保限额申请单分录的应收款日期1小于当前时间并且有欠款金额
|
||||||
|
*
|
||||||
* @param entry
|
* @param entry
|
||||||
*/
|
*/
|
||||||
private void creditInsuranceOverdueVerification(ExtendedDataEntity entry)
|
private void creditInsuranceOverdueVerification(ExtendedDataEntity entry) {
|
||||||
{
|
|
||||||
DynamicObject dataEntity = entry.getDataEntity();
|
DynamicObject dataEntity = entry.getDataEntity();
|
||||||
dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), dataEntity.getDynamicObjectType().getName());
|
dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), dataEntity.getDynamicObjectType().getName());
|
||||||
DynamicObject customer = dataEntity.getDynamicObject("yem_customer");
|
DynamicObject customer = dataEntity.getDynamicObject("yem_customer");
|
||||||
@ -161,9 +162,11 @@ public class DeliverNoticeSubmitValidator extends AbstractValidator {
|
|||||||
DynamicObject method = TotalUtil.getSettlementMethod(shippingdetails);
|
DynamicObject method = TotalUtil.getSettlementMethod(shippingdetails);
|
||||||
DynamicObject company = dataEntity.getDynamicObject("yem_company.yem_erporg");
|
DynamicObject company = dataEntity.getDynamicObject("yem_company.yem_erporg");
|
||||||
String swiftCode = TotalUtil.getSwiftCode(shippingdetails);
|
String swiftCode = TotalUtil.getSwiftCode(shippingdetails);
|
||||||
|
BigDecimal yemArrearsamtapply = shippingdetails.getBigDecimal("yem_arrearsamtapply");
|
||||||
DynamicObject creditLine = TotalUtil.getCsrCreditLine(customer, method, company, swiftCode);
|
DynamicObject creditLine = TotalUtil.getCsrCreditLine(customer, method, company, swiftCode);
|
||||||
if (creditLine == null) return;
|
if (creditLine == null) return;
|
||||||
DynamicObjectCollection collection = creditLine.getDynamicObjectCollection("yem_im_info");
|
DynamicObjectCollection collection = creditLine.getDynamicObjectCollection("yem_im_info");
|
||||||
|
BigDecimal amountoweds = BigDecimal.ZERO;
|
||||||
for (DynamicObject dynamicObject : collection) {
|
for (DynamicObject dynamicObject : collection) {
|
||||||
// 应收款日期1
|
// 应收款日期1
|
||||||
Date paydate = dynamicObject.getDate("yem_paydate1");
|
Date paydate = dynamicObject.getDate("yem_paydate1");
|
||||||
@ -171,9 +174,22 @@ public class DeliverNoticeSubmitValidator extends AbstractValidator {
|
|||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
if (paydate == null) continue;
|
if (paydate == null) continue;
|
||||||
if (amountowed.compareTo(BigDecimal.ZERO) > 0 && paydate.before(now)) {
|
if (amountowed.compareTo(BigDecimal.ZERO) > 0 && paydate.before(now)) {
|
||||||
this.addErrorMessage(entry, String.format("客户 %s 信保逾期,请确认!", customer.getString("name")));
|
amountoweds = amountowed.add(amountoweds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String string = "";
|
||||||
|
if (amountoweds.compareTo(BigDecimal.ZERO) > 0 || yemArrearsamtapply.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
string = "客户" + customer.getString("name") + "信保逾期,";
|
||||||
|
}
|
||||||
|
if (amountoweds.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
string = string + "欠款金额:" + amountoweds;
|
||||||
|
} else if (yemArrearsamtapply.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
string = string + "欠条金额:" + yemArrearsamtapply;
|
||||||
|
}
|
||||||
|
if (!string.isEmpty()) {
|
||||||
|
string = string+",请确认!";
|
||||||
|
}
|
||||||
|
this.addErrorMessage(entry ,string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -256,10 +272,10 @@ public class DeliverNoticeSubmitValidator extends AbstractValidator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 1、销售出库对应的合同(非本次发运明细单)--欠条是否有核销掉
|
* 1、销售出库对应的合同(非本次发运明细单)--欠条是否有核销掉
|
||||||
|
*
|
||||||
* @param dataEntities
|
* @param dataEntities
|
||||||
*/
|
*/
|
||||||
private void hasArrearsValidator(ExtendedDataEntity dataEntities)
|
private void hasArrearsValidator(ExtendedDataEntity dataEntities) {
|
||||||
{
|
|
||||||
// 销售出库单
|
// 销售出库单
|
||||||
DynamicObject dataEntity = dataEntities.getDataEntity();
|
DynamicObject dataEntity = dataEntities.getDataEntity();
|
||||||
long shipDetailId = dataEntity.getLong("yem_sourcebillid");
|
long shipDetailId = dataEntity.getLong("yem_sourcebillid");
|
||||||
@ -304,6 +320,7 @@ public class DeliverNoticeSubmitValidator extends AbstractValidator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 销售出库提交时,如果有已审核的发货特殊申请,不需要校验是否信保预期,是否由未核销掉的欠条,否则需要核销;
|
* 销售出库提交时,如果有已审核的发货特殊申请,不需要校验是否信保预期,是否由未核销掉的欠条,否则需要核销;
|
||||||
|
*
|
||||||
* @param dataEntitie
|
* @param dataEntitie
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user