Browse Source

采购入库-源头订单修改

master
DESKTOP-DIHMM3I\22375 2 years ago
parent
commit
82c1a604a4
  1. 22
      ICSSoft.ERP.WebAPI/ICSSoft.DataProject/PurchaseReceiveDoc.cs

22
ICSSoft.ERP.WebAPI/ICSSoft.DataProject/PurchaseReceiveDoc.cs

@ -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;
@ -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,

Loading…
Cancel
Save