|
|
@ -31,6 +31,67 @@ namespace ICSSoft.DataProject |
|
|
|
/// <param name="WorkPoint"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void SalesShipmentDoc(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd, Dictionary<string, string> language) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
|
|
|
|
//string chekksql = @"select c.EATTRIBUTE1 FROM ICSSDN a
|
|
|
|
// INNER JOIN ICSInventory c on a.InvCode=c.InvCode and a.WorkPoint=c.WorkPoint
|
|
|
|
// WHERE a.Sequence='{2}' AND a.SDNCode='{0}' AND a.WorkPoint='{1}' and c.AmountEnable='1'";
|
|
|
|
//chekksql = string.Format(chekksql, TransCode, WorkPoint, TransSequence);
|
|
|
|
//DataTable dta = DBHelper.SQlReturnData(chekksql, cmd);
|
|
|
|
//if (dta.Rows.Count > 0)
|
|
|
|
//{
|
|
|
|
// Quantity = (decimal.Parse(Quantity) * decimal.Parse(dta.Rows[0]["EATTRIBUTE1"].ToString())).ToString();
|
|
|
|
//}
|
|
|
|
string sql = @"DECLARE @Status VARCHAR(10)
|
|
|
|
SELECT @Status=a.Status FROM ICSSDN a |
|
|
|
WHERE a.SDNCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}' AND a.Type='1' |
|
|
|
|
|
|
|
IF (@Status IS NULL) |
|
|
|
BEGIN |
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo139") + @"',16,1); |
|
|
|
RETURN |
|
|
|
END |
|
|
|
ELSE IF (@Status!='2') |
|
|
|
BEGIN |
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo140") + @"',16,1); |
|
|
|
RETURN |
|
|
|
END |
|
|
|
UPDATE a SET SDNQuantity=ISNULL(SDNQuantity,0)+'{2}' |
|
|
|
FROM ICSSDN a |
|
|
|
WHERE a.SDNCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}' AND a.Type='1' |
|
|
|
|
|
|
|
IF EXISTS(SELECT a.ID FROM ICSSDN a |
|
|
|
WHERE a.SDNCode='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Type='1' AND a.Quantity<a.SDNQuantity) |
|
|
|
BEGIN |
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo091") + @"',16,1); |
|
|
|
RETURN |
|
|
|
END";
|
|
|
|
|
|
|
|
sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence); |
|
|
|
|
|
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd)) |
|
|
|
{ |
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo141"));//"销售领料单更新失败!");
|
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 销售出库
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="TransCode"></param>
|
|
|
|
/// <param name="TransSequence"></param>
|
|
|
|
/// <param name="Quantity"></param>
|
|
|
|
/// <param name="WorkPoint"></param>
|
|
|
|
/// <param name="cmd"></param>
|
|
|
|
public static void AMSalesShipmentDoc(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd, Dictionary<string, string> language) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
@ -38,7 +99,7 @@ namespace ICSSoft.DataProject |
|
|
|
string chekksql = @"select c.EATTRIBUTE1 FROM ICSSDN a
|
|
|
|
INNER JOIN ICSInventory c on a.InvCode=c.InvCode and a.WorkPoint=c.WorkPoint |
|
|
|
WHERE a.Sequence='{2}' AND a.SDNCode='{0}' AND a.WorkPoint='{1}' and c.AmountEnable='1'";
|
|
|
|
chekksql = string.Format(chekksql, TransCode, WorkPoint, TransSequence); |
|
|
|
chekksql = string.Format(chekksql, TransCode, WorkPoint, TransSequence); |
|
|
|
DataTable dta = DBHelper.SQlReturnData(chekksql, cmd); |
|
|
|
if (dta.Rows.Count > 0) |
|
|
|
{ |
|
|
|