|
@ -113,14 +113,11 @@ namespace ICSSoft.DataProject |
|
|
string connS = ""; |
|
|
string connS = ""; |
|
|
string sql = ""; |
|
|
string sql = ""; |
|
|
string iFatherIdTwo = ""; |
|
|
string iFatherIdTwo = ""; |
|
|
|
|
|
|
|
|
DataSet ds = null; |
|
|
DataSet ds = null; |
|
|
decimal iTaxRate = 0; |
|
|
decimal iTaxRate = 0; |
|
|
DateTime time = DateTime.Now; |
|
|
DateTime time = DateTime.Now; |
|
|
int num = 0; |
|
|
int num = 0; |
|
|
VouchKey key = new VouchKey(); |
|
|
VouchKey key = new VouchKey(); |
|
|
//int iBaseCodeLen = Convert.ToInt32(dic["iBaseCodeLen"].ToString());
|
|
|
|
|
|
//int cVouchCodeBase = Convert.ToInt32(dic["cVouchCodeBase"].ToString());
|
|
|
|
|
|
List<ICSPOArrive> datas = new List<ICSPOArrive>(); |
|
|
List<ICSPOArrive> datas = new List<ICSPOArrive>(); |
|
|
if (Bills.Count <= 0) |
|
|
if (Bills.Count <= 0) |
|
|
{ |
|
|
{ |
|
@ -269,9 +266,9 @@ namespace ICSSoft.DataProject |
|
|
#region 采购入库单表头
|
|
|
#region 采购入库单表头
|
|
|
string BusType = "";//业务类型
|
|
|
string BusType = "";//业务类型
|
|
|
sql = @"select a.POID,a.cPOID,a.cVenCode,a.cDepCode,a.cexch_name,a.iTaxRate,a.cMaker,
|
|
|
sql = @"select a.POID,a.cPOID,a.cVenCode,a.cDepCode,a.cexch_name,a.iTaxRate,a.cMaker,
|
|
|
a.nflat,a.cPersonCode,a.cptcode ,b.ID,b.cCode,a.cBusType |
|
|
|
|
|
|
|
|
a.nflat,a.cPersonCode,a.cptcode,a.cBusType |
|
|
FROM dbo.PO_Pomain a |
|
|
FROM dbo.PO_Pomain a |
|
|
LEFT JOIN PU_ArrivalVouch b ON a.cPOID=b.cpocode |
|
|
|
|
|
|
|
|
|
|
|
WHERE a.cPOID ='" + head.POCode + "'";
|
|
|
WHERE a.cPOID ='" + head.POCode + "'";
|
|
|
cmd.CommandText = sql; |
|
|
cmd.CommandText = sql; |
|
|
DataTable dtPOMain = DBHelper.SQlReturnData(sql, cmd); |
|
|
DataTable dtPOMain = DBHelper.SQlReturnData(sql, cmd); |
|
@ -304,8 +301,8 @@ namespace ICSSoft.DataProject |
|
|
WHCode = head.WHCode; |
|
|
WHCode = head.WHCode; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cSource = "采购到货单"; |
|
|
|
|
|
cCode = dtPOMain.Rows[0]["cCode"].ToString(); |
|
|
|
|
|
|
|
|
cSource = "普通采购"; |
|
|
|
|
|
cCode = dtPOMain.Rows[0]["cPOID"].ToString(); |
|
|
bredvouch = 0; |
|
|
bredvouch = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -328,7 +325,7 @@ namespace ICSSoft.DataProject |
|
|
DataTable dtDisCheck1 = DBHelper.SQlReturnData(sql, cmd); |
|
|
DataTable dtDisCheck1 = DBHelper.SQlReturnData(sql, cmd); |
|
|
if (dtDisCheck1 != null && dtDisCheck1.Rows.Count > 0) |
|
|
if (dtDisCheck1 != null && dtDisCheck1.Rows.Count > 0) |
|
|
{ |
|
|
{ |
|
|
foreach (DataRow item in dtDisCheck1.Rows) |
|
|
|
|
|
|
|
|
foreach (DataRow item in dtDisCheck1.Rows) |
|
|
{ |
|
|
{ |
|
|
if (item["iLZYJ"].ToString() == "10" & (item["iLZFS"].ToString() == "0" | item["iLZFS"].ToString() == "1")) |
|
|
if (item["iLZYJ"].ToString() == "10" & (item["iLZFS"].ToString() == "0" | item["iLZFS"].ToString() == "1")) |
|
|
{ |
|
|
{ |
|
@ -431,11 +428,9 @@ namespace ICSSoft.DataProject |
|
|
sql = @"SELECT a.id,a.cInvCode,a.iUnitPrice ,a.iMoney AS 原币无税金额 ,a.ivouchrowno,
|
|
|
sql = @"SELECT a.id,a.cInvCode,a.iUnitPrice ,a.iMoney AS 原币无税金额 ,a.ivouchrowno,
|
|
|
a.iTax AS 原币税额 ,a.iSum AS 原币价税合计 ,a.iNatUnitPrice , |
|
|
a.iTax AS 原币税额 ,a.iSum AS 原币价税合计 ,a.iNatUnitPrice , |
|
|
a.iNatMoney AS 本币无税金额 ,a.iNatTax AS 本币税额 ,a.iNatSum AS 本币价税合计 , |
|
|
a.iNatMoney AS 本币无税金额 ,a.iNatTax AS 本币税额 ,a.iNatSum AS 本币价税合计 , |
|
|
a.iTaxPrice ,a.freceivedqty AS 合格品入库数量 ,a.iPerTaxRate,c.Autoid,d.cCode,d.dDate |
|
|
|
|
|
|
|
|
a.iTaxPrice ,a.freceivedqty AS 合格品入库数量 ,a.iPerTaxRate |
|
|
FROM dbo.PO_Podetails a |
|
|
FROM dbo.PO_Podetails a |
|
|
INNER JOIN dbo.PO_Pomain b ON a.POID=b.POID |
|
|
INNER JOIN dbo.PO_Pomain b ON a.POID=b.POID |
|
|
LEFT JOIN dbo.PU_ArrivalVouchs c ON a.ID=c.iPOsID |
|
|
|
|
|
LEFT JOIN dbo.PU_ArrivalVouch d ON c.ID=d.ID |
|
|
|
|
|
WHERE b.cPOID ='" + head.POCode + "'";
|
|
|
WHERE b.cPOID ='" + head.POCode + "'";
|
|
|
cmd.CommandText = sql; |
|
|
cmd.CommandText = sql; |
|
|
DataTable dtPODetails = DBHelper.SQlReturnData(sql, cmd); |
|
|
DataTable dtPODetails = DBHelper.SQlReturnData(sql, cmd); |
|
@ -472,12 +467,7 @@ namespace ICSSoft.DataProject |
|
|
if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["iTaxPrice"].ToString())) |
|
|
if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["iTaxPrice"].ToString())) |
|
|
iTaxPrice = decimal.Parse(dtPODetails.Rows[0]["iTaxPrice"].ToString());//原币含税单价
|
|
|
iTaxPrice = decimal.Parse(dtPODetails.Rows[0]["iTaxPrice"].ToString());//原币含税单价
|
|
|
iTaxRate = Convert.ToDecimal(dtPODetails.Rows[0]["iPerTaxRate"]); |
|
|
iTaxRate = Convert.ToDecimal(dtPODetails.Rows[0]["iPerTaxRate"]); |
|
|
if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["Autoid"].ToString()))//采购退货单字体标识
|
|
|
|
|
|
id = dtPODetails.Rows[0]["Autoid"].ToString(); |
|
|
|
|
|
if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["cCode"].ToString()))//采购退货单号
|
|
|
|
|
|
code = dtPODetails.Rows[0]["cCode"].ToString(); |
|
|
|
|
|
if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["dDate"].ToString()))//采购退货单日期
|
|
|
|
|
|
dates = dtPODetails.Rows[0]["dDate"].ToString(); |
|
|
|
|
|
|
|
|
|
|
|
sql = @"INSERT INTO dbo.rdrecords01
|
|
|
sql = @"INSERT INTO dbo.rdrecords01
|
|
|
( |
|
|
( |
|
|
AutoID ,ID ,cInvCode ,iNum ,iQuantity ,cItemCode, |
|
|
AutoID ,ID ,cInvCode ,iNum ,iQuantity ,cItemCode, |
|
|