|
|
@ -113,14 +113,11 @@ namespace ICSSoft.DataProject |
|
|
|
string connS = ""; |
|
|
|
string sql = ""; |
|
|
|
string iFatherIdTwo = ""; |
|
|
|
|
|
|
|
DataSet ds = null; |
|
|
|
decimal iTaxRate = 0; |
|
|
|
DateTime time = DateTime.Now; |
|
|
|
int num = 0; |
|
|
|
VouchKey key = new VouchKey(); |
|
|
|
//int iBaseCodeLen = Convert.ToInt32(dic["iBaseCodeLen"].ToString());
|
|
|
|
//int cVouchCodeBase = Convert.ToInt32(dic["cVouchCodeBase"].ToString());
|
|
|
|
List<ICSPOArrive> datas = new List<ICSPOArrive>(); |
|
|
|
if (Bills.Count <= 0) |
|
|
|
{ |
|
|
@ -269,9 +266,9 @@ namespace ICSSoft.DataProject |
|
|
|
#region 采购入库单表头
|
|
|
|
string BusType = "";//业务类型
|
|
|
|
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 |
|
|
|
LEFT JOIN PU_ArrivalVouch b ON a.cPOID=b.cpocode |
|
|
|
|
|
|
|
WHERE a.cPOID ='" + head.POCode + "'";
|
|
|
|
cmd.CommandText = sql; |
|
|
|
DataTable dtPOMain = DBHelper.SQlReturnData(sql, cmd); |
|
|
@ -304,8 +301,8 @@ namespace ICSSoft.DataProject |
|
|
|
WHCode = head.WHCode; |
|
|
|
} |
|
|
|
|
|
|
|
cSource = "采购到货单"; |
|
|
|
cCode = dtPOMain.Rows[0]["cCode"].ToString(); |
|
|
|
cSource = "普通采购"; |
|
|
|
cCode = dtPOMain.Rows[0]["cPOID"].ToString(); |
|
|
|
bredvouch = 0; |
|
|
|
|
|
|
|
|
|
|
@ -431,11 +428,9 @@ namespace ICSSoft.DataProject |
|
|
|
sql = @"SELECT a.id,a.cInvCode,a.iUnitPrice ,a.iMoney AS 原币无税金额 ,a.ivouchrowno,
|
|
|
|
a.iTax AS 原币税额 ,a.iSum AS 原币价税合计 ,a.iNatUnitPrice , |
|
|
|
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 |
|
|
|
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 + "'";
|
|
|
|
cmd.CommandText = sql; |
|
|
|
DataTable dtPODetails = DBHelper.SQlReturnData(sql, cmd); |
|
|
@ -472,12 +467,7 @@ namespace ICSSoft.DataProject |
|
|
|
if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["iTaxPrice"].ToString())) |
|
|
|
iTaxPrice = decimal.Parse(dtPODetails.Rows[0]["iTaxPrice"].ToString());//原币含税单价
|
|
|
|
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
|
|
|
|
( |
|
|
|
AutoID ,ID ,cInvCode ,iNum ,iQuantity ,cItemCode, |
|
|
|