This commit is contained in:
liangjunyu
2025-07-24 17:55:32 +08:00
parent 5b4803dc2a
commit cddce3f0b6

View File

@@ -36,6 +36,7 @@ def OnPreparePropertys(e):
e.FieldKeys.Add("FBillAllAmount");
e.FieldKeys.Add("F_SFYFH");
e.FieldKeys.Add("FSaleOrgId");
e.FieldKeys.Add("FDocumentStatus");
def BeforeDoSaveExecute(e):
# if this.FormOperation.OperationId == 8:
@@ -82,12 +83,13 @@ WHERE t0.FID IN ({0})
if res != None and res.Count > 0:
# raise Exception(JsonUtil.Serialize(res))
item = res[0]
currAmount = entity["SAL_DELIVERYNOTICEFIN"][0]["BillAllAmount"]
# raise Exception(str(currAmount))
isYFHFlag = item["累计核销金额"] < item["款到发货应收金额"]
isYFHFlag1 = isYFHFlag == True and (item["收款计划条数"] == 1)
isYFHFlag2 = isYFHFlag == True and (True if isYFHFlag1 else ((item["累计核销金额"] - item["累计已发货金额"]) < currAmount))
entity["F_SFYFH"] = '' if isYFHFlag2 == True else ''
if entity["SAL_DELIVERYNOTICEFIN"] != None and entity["SAL_DELIVERYNOTICEFIN"].Count > 0:
currAmount = entity["SAL_DELIVERYNOTICEFIN"][0]["BillAllAmount"]
# raise Exception(str(currAmount))
isYFHFlag = item["累计核销金额"] < item["款到发货应收金额"]
isYFHFlag1 = isYFHFlag == True and (item["收款计划条数"] == 1)
isYFHFlag2 = isYFHFlag == True and (True if isYFHFlag1 else ((item["累计核销金额"] - item["累计已发货金额"]) < currAmount))
entity["F_SFYFH"] = '' if isYFHFlag2 == True else ''
return;