This commit is contained in:
余宇波 2025-07-28 20:22:12 +08:00
parent f33377f904
commit 70826d04c0
2 changed files with 13 additions and 3 deletions

View File

@ -93,6 +93,11 @@ namespace Pilot_KD_Parino.Sal_Order
break;
//this.View.ShowMessage("没有上查关联的跨组织的采购订单");
}
else if ( dt.Count > 1 )
{
throw new KDBusinessException("", "一张销售单下推多张采购订单,不能用自动跨组织推单功能:" + tablename);
}
else
{
@ -110,6 +115,11 @@ namespace Pilot_KD_Parino.Sal_Order
{
throw new KDBusinessException("", "没有上查关联的跨组织的采购订单:" + tablename);
}
else if (dt.Count > 1)
{
throw new KDBusinessException("", "一张销售单下推多张采购订单,不能用自动跨组织推单功能:" + tablename);
}
else
{
xiaoFid = tempFid;

View File

@ -80,7 +80,7 @@ namespace Pilot_KD_Parino.Sal_Order
getSourceSql = $@"/*dialect*/SELECT FSTABLENAME,FSBILLID,FENTRYID FROM T_PUR_ReqEntry_LK
WHERE FSBILLID = {tempFid} and FSTABLENAME='T_SAL_ORDERENTRY' ";
dt = DBServiceHelper.ExecuteDynamicObject(this.Context, getSourceSql);
if (dt == null || dt.Count == 0)
if (dt == null || dt.Count == 0 || dt.Count>1)
{
//throw new KDBusinessException("", "没有找到跨组织的采购申请单:" + getSourceSql);
return;
@ -98,7 +98,7 @@ namespace Pilot_KD_Parino.Sal_Order
getSourceSql = $@"/*dialect*/SELECT FSTABLENAME,FSBILLID,FENTRYID FROM t_PUR_POOrderEntry_LK
WHERE FSBILLID = {tempFid} and FSTABLENAME='T_PUR_ReqEntry' ";
dt = DBServiceHelper.ExecuteDynamicObject(this.Context, getSourceSql);
if (dt == null || dt.Count == 0)
if (dt == null || dt.Count == 0 || dt.Count > 1)
{
//throw new KDBusinessException("", "没有找到跨组织的采购订单:" + getSourceSql);
return;
@ -115,7 +115,7 @@ namespace Pilot_KD_Parino.Sal_Order
getSourceSql = $@"/*dialect*/SELECT FSTABLENAME,FSBILLID,FENTRYID FROM T_SAL_ORDERENTRY_LK
WHERE FSBILLID = {tempFid} and FSTABLENAME='t_PUR_POOrderEntry' ";
dt = DBServiceHelper.ExecuteDynamicObject(this.Context, getSourceSql);
if (dt == null || dt.Count == 0)
if (dt == null || dt.Count == 0 || dt.Count > 1)
{
//throw new KDBusinessException("", "没有找到跨组织的销售订单:" + getSourceSql);
return;