|
|
|
@ -37,12 +37,12 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
{
|
|
|
|
|
#region 发票列表
|
|
|
|
|
|
|
|
|
|
static public List<ChInvoice_HangXin> GetDataList(int start, int limit, string strCondition, string userid="", string usercode="", string orgcode="", string sort = null)
|
|
|
|
|
static public List<ChInvoice_HangXin> GetDataList(int start, int limit, string strCondition, string userid = "", string usercode = "", string orgcode = "", string sort = null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var rangstr = GetRangDAListStr("", userid, usercode, orgcode);
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(rangstr) &&!string.IsNullOrWhiteSpace(userid+ usercode+ orgcode))
|
|
|
|
|
if (!string.IsNullOrEmpty(rangstr) && !string.IsNullOrWhiteSpace(userid + usercode + orgcode))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(strCondition))
|
|
|
|
|
{
|
|
|
|
@ -216,7 +216,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
static public ChInvoice_HangXin GetData(string condition, string userid = "", string usercode = "", string orgcode = "")
|
|
|
|
|
{
|
|
|
|
|
var list = GetDataList(0,1,condition,userid,usercode,orgcode,"");
|
|
|
|
|
var list = GetDataList(0, 1, condition, userid, usercode, orgcode, "");
|
|
|
|
|
if (list.Count > 0)
|
|
|
|
|
return list[0];
|
|
|
|
|
|
|
|
|
@ -270,7 +270,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
else
|
|
|
|
|
data.EXCHANGERATE = 0;
|
|
|
|
|
data.APPLICANT = Convert.ToString(reader["APPLICANT"]);
|
|
|
|
|
// data.APPLICANTNAME = Convert.ToString(reader["APPLICANTNAME"]);
|
|
|
|
|
// data.APPLICANTNAME = Convert.ToString(reader["APPLICANTNAME"]);
|
|
|
|
|
if (reader["APPLYTIME"] != DBNull.Value)
|
|
|
|
|
data.APPLYTIME = Convert.ToDateTime(reader["APPLYTIME"]);
|
|
|
|
|
|
|
|
|
@ -306,7 +306,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
data.SALECORP = Convert.ToString(reader["SALECORP"]);//分公司代码
|
|
|
|
|
data.ACCOUNT = Convert.ToString(reader["ACCOUNT"]);//分公司代码
|
|
|
|
|
data.BANK = Convert.ToString(reader["BANK"]);//分公司代码
|
|
|
|
|
data.DZSTATUS= Convert.ToString(reader["DZSTATUS"]);
|
|
|
|
|
data.DZSTATUS = Convert.ToString(reader["DZSTATUS"]);
|
|
|
|
|
|
|
|
|
|
data.CUSTTEL = Convert.ToString(reader["CUSTTEL"]);
|
|
|
|
|
data.CUSTADDR = Convert.ToString(reader["CUSTADDR"]);
|
|
|
|
@ -378,11 +378,12 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
{
|
|
|
|
|
strSql.Append(" where " + strCondition);
|
|
|
|
|
}
|
|
|
|
|
var result= DetailSetData(strSql);
|
|
|
|
|
var result = DetailSetData(strSql);
|
|
|
|
|
|
|
|
|
|
//增加三个税收属性相关的字段
|
|
|
|
|
var PIDList = "";
|
|
|
|
|
if (result.Count > 0) {
|
|
|
|
|
if (result.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var detail in result)
|
|
|
|
|
{
|
|
|
|
|
if (PIDList.IndexOf(detail.PID) > 0) continue;
|
|
|
|
@ -393,7 +394,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
if (PIDList != "")
|
|
|
|
|
{
|
|
|
|
|
var CodeGoodInvList = MsCodeGoodInvDAL.GetDataList(" gid in (SELECT GOODSNAME FROM ch_fee_invoicedetail where PID in( '" + PIDList + "' )) ");
|
|
|
|
|
if (CodeGoodInvList.Count > 0) {
|
|
|
|
|
if (CodeGoodInvList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var detail in result)
|
|
|
|
|
{
|
|
|
|
|
foreach (var CodeGoodInv in CodeGoodInvList)
|
|
|
|
@ -425,7 +427,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
{
|
|
|
|
|
strSql.Append(" where " + strCondition);
|
|
|
|
|
}
|
|
|
|
|
return DetailSetData(strSql,db,tran);
|
|
|
|
|
return DetailSetData(strSql, db, tran);
|
|
|
|
|
}
|
|
|
|
|
static public ChInvoiceDetail GetDetailData(string condition)
|
|
|
|
|
{
|
|
|
|
@ -452,7 +454,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
data.SERIALNO = Convert.ToInt16(reader["SerialNo"]);
|
|
|
|
|
data.GOODSNAME = Convert.ToString(reader["GOODSNAME"]);
|
|
|
|
|
data.GOODSNAMEREF = Convert.ToString(reader["GOODSNAMEREF"]);
|
|
|
|
|
if (data.GOODSNAMEREF == "" || data.GOODSNAMEREF ==null) data.GOODSNAMEREF = data.GOODSNAME;
|
|
|
|
|
if (data.GOODSNAMEREF == "" || data.GOODSNAMEREF == null) data.GOODSNAMEREF = data.GOODSNAME;
|
|
|
|
|
data.SPEC = Convert.ToString(reader["SPEC"]);
|
|
|
|
|
data.UNIT = Convert.ToString(reader["UNIT"]);
|
|
|
|
|
data.PKGS = Convert.ToDecimal(reader["PKGS"]);
|
|
|
|
@ -461,7 +463,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
data.AMOUNT = Math.Round(Convert.ToDecimal(reader["AMOUNT"]), 2, MidpointRounding.AwayFromZero);
|
|
|
|
|
data.TAXRATE = Convert.ToDecimal(reader["TAXRATE"]);
|
|
|
|
|
data.TAX = Convert.ToDecimal(reader["TAX"]);
|
|
|
|
|
data.REMARK= Convert.ToString(reader["Remark"]);
|
|
|
|
|
data.REMARK = Convert.ToString(reader["Remark"]);
|
|
|
|
|
data.GOODCODE = Convert.ToString(reader["GOODCODE"]);
|
|
|
|
|
#endregion
|
|
|
|
|
headList.Add(data);
|
|
|
|
@ -473,7 +475,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
private static List<ChInvoiceDetail> DetailSetData(StringBuilder strSql, Database db, DbTransaction tran)
|
|
|
|
|
{
|
|
|
|
|
var headList = new List<ChInvoiceDetail>();
|
|
|
|
|
using (IDataReader reader = db.ExecuteReader(tran,CommandType.Text, strSql.ToString()))
|
|
|
|
|
using (IDataReader reader = db.ExecuteReader(tran, CommandType.Text, strSql.ToString()))
|
|
|
|
|
{
|
|
|
|
|
while (reader.Read())
|
|
|
|
|
{
|
|
|
|
@ -506,7 +508,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<ChInvoiceNo> GetInvoiceNo (string companyid,string userid)
|
|
|
|
|
public static List<ChInvoiceNo> GetInvoiceNo(string companyid, string userid)
|
|
|
|
|
{
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
strSql.Append("select b.INVOICECODE+i.INVOICENUM INVOICENUM from ch_fee_invoiceitems i left join ch_fee_invoicebooks b on (i.BOOKID=b.GID)");
|
|
|
|
@ -534,7 +536,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
#region 发票费用明细
|
|
|
|
|
|
|
|
|
|
static public List<Chfee_do_detail> GetBodyList(string strCondition,string sort="")
|
|
|
|
|
static public List<Chfee_do_detail> GetBodyList(string strCondition, string sort = "")
|
|
|
|
|
{
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
strSql.Append(" SELECT c.GID,c.BSNO,c.FEEID,c.FEENAME,c.CURRENCY,c.AMOUNT,c.DOAMOUNT,c.ORIGCURRENCY,c.ORIGAMOUNT,ISNULL(c.ORIGSTLAMOUNT,0) AS ORIGSTLAMOUNT,c.EXCHANGERATE ");
|
|
|
|
@ -1450,7 +1452,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
return headList;
|
|
|
|
|
}
|
|
|
|
|
#region 费用列表明细
|
|
|
|
|
static public List<ChFeeDetail> GetFeeDetailList(string strCondition, string userid, string usercode, string orgcode,string sort=null)
|
|
|
|
|
static public List<ChFeeDetail> GetFeeDetailList(string strCondition, string userid, string usercode, string orgcode, string sort = null)
|
|
|
|
|
{
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
|
|
|
|
@ -1761,7 +1763,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
decimal amtttl = 0;
|
|
|
|
|
decimal acctaxrate =0;
|
|
|
|
|
decimal acctaxrate = 0;
|
|
|
|
|
decimal doamount = 0;
|
|
|
|
|
decimal StlAmount = 0;
|
|
|
|
|
|
|
|
|
@ -1887,9 +1889,10 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isList&& amtttl!=0) {
|
|
|
|
|
if (!isList && amtttl != 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var dataList =GetDetailList(" PID='"+GID+"'");
|
|
|
|
|
var dataList = GetDetailList(" PID='" + GID + "'");
|
|
|
|
|
if (dataList.Count != 0)
|
|
|
|
|
{
|
|
|
|
|
var invlist = dataList[0];
|
|
|
|
@ -1897,13 +1900,14 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@GID", DbType.String, invlist.GID);
|
|
|
|
|
if (acctaxrate == 0)
|
|
|
|
|
{
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@AMOUNT", DbType.Decimal, Math.Round(invlist.AMOUNT+amtttl,2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAXPRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl)/invlist.PKGS,2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@PRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS,2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@AMOUNT", DbType.Decimal, Math.Round(invlist.AMOUNT + amtttl, 2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAXPRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS, 2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@PRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS, 2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAXRATE", DbType.Decimal, 0);
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAX", DbType.Decimal,0);
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAX", DbType.Decimal, 0);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
amtttl = amtttl + (invlist.TAXPRICE * invlist.PKGS);
|
|
|
|
|
|
|
|
|
@ -1927,7 +1931,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.ExecuteNonQuery(cmdUpdateInv, tran);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cmdInsertInv.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@GID", DbType.String, Guid.NewGuid().ToString());
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PID", DbType.String, GID);
|
|
|
|
@ -1935,7 +1940,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
if (defGOOD.GOODNAME == "")
|
|
|
|
|
{
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@GOODSNAME", DbType.String, "代理运杂费");
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@UNIT", DbType.String,"票");
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@UNIT", DbType.String, "票");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1945,18 +1950,18 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@SPEC", DbType.String, defGOOD.SPEC);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PKGS", DbType.Decimal, 1);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAXPRICE", DbType.Decimal, Math.Round(amtttl,2));
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAXPRICE", DbType.Decimal, Math.Round(amtttl, 2));
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAXRATE", DbType.Decimal, acctaxrate);
|
|
|
|
|
if (acctaxrate == 0)
|
|
|
|
|
{
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PRICE", DbType.Decimal, Math.Round(amtttl,2));
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@AMOUNT", DbType.Decimal, Math.Round(amtttl,2));
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PRICE", DbType.Decimal, Math.Round(amtttl, 2));
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@AMOUNT", DbType.Decimal, Math.Round(amtttl, 2));
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAX", DbType.Decimal, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var tax = Math.Round(amtttl / (1 + acctaxrate / 100) * (acctaxrate / 100), 2);
|
|
|
|
|
var amount = amtttl-tax;
|
|
|
|
|
var amount = amtttl - tax;
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PRICE", DbType.Decimal, amount);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@AMOUNT", DbType.Decimal, amount);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAX", DbType.Decimal, tax);
|
|
|
|
@ -2004,7 +2009,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DBResult AddBill(ChInvoice_HangXin headData, string feesql, List<ChFeeExrate> exratelist, string companyid, bool isList, string GID,string userid, bool custgroup = false)
|
|
|
|
|
public static DBResult AddBill(ChInvoice_HangXin headData, string feesql, List<ChFeeExrate> exratelist, string companyid, bool isList, string GID, string userid, bool custgroup = false)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
var defGOOD = MsCodeGoodInvDAL.GetData(" ISDEF='1' and (DEFCURR='' or DEFCURR='" + headData.RECVCURR + "') ");
|
|
|
|
@ -2038,7 +2043,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
if (!custgroup)
|
|
|
|
|
feesql = feesql + " AND CUSTOMERNAME='" + headData.CUSTOMERNAME + "'";
|
|
|
|
|
var feelist = GetFeeDetailList(feesql,userid,"",companyid);
|
|
|
|
|
var feelist = GetFeeDetailList(feesql, userid, "", companyid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cmdInsert =
|
|
|
|
@ -2107,7 +2112,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!ischaoe) {
|
|
|
|
|
if (!ischaoe)
|
|
|
|
|
{
|
|
|
|
|
cmdInsert.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdInsert, "@GID", DbType.String, Guid.NewGuid().ToString());
|
|
|
|
|
db.AddInParameter(cmdInsert, "@BILLNO", DbType.String, headData.BILLNO);
|
|
|
|
@ -2133,7 +2139,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
amtttl = amtttl - enumValue.StlAmount;
|
|
|
|
|
else
|
|
|
|
|
amtttl = amtttl + enumValue.StlAmount;
|
|
|
|
|
enumValue.ExChangerate =1;
|
|
|
|
|
enumValue.ExChangerate = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -2222,7 +2228,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAX", DbType.Decimal, tax);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var UExrate = GetExrate(enumValue.Currency, exratelist);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAXPRICE", DbType.Decimal, Math.Round(enumValue.StlAmount * UExrate, 2));
|
|
|
|
@ -2264,7 +2271,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
amtttl = amtttl + Math.Round(invfeesum.amount * invfeesum.exchange, 2, MidpointRounding.AwayFromZero);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isList&& amtttl!=0)
|
|
|
|
|
if (!isList && amtttl != 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var dataList = GetDetailList(" PID='" + GID + "'");
|
|
|
|
@ -2275,9 +2282,9 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@GID", DbType.String, invlist.GID);
|
|
|
|
|
if (acctaxrate == 0)
|
|
|
|
|
{
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@AMOUNT", DbType.Decimal, Math.Round(invlist.AMOUNT + amtttl,2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAXPRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS,2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@PRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS,2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@AMOUNT", DbType.Decimal, Math.Round(invlist.AMOUNT + amtttl, 2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAXPRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS, 2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@PRICE", DbType.Decimal, Math.Round((invlist.AMOUNT + amtttl) / invlist.PKGS, 2));
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAXRATE", DbType.Decimal, 0);
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@TAX", DbType.Decimal, 0);
|
|
|
|
|
}
|
|
|
|
@ -2320,7 +2327,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@GOODSNAME", DbType.String, defGOOD.GID);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@UNIT", DbType.String, defGOOD.UNIT);
|
|
|
|
|
}
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@SPEC", DbType.String,defGOOD.SPEC);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@SPEC", DbType.String, defGOOD.SPEC);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PKGS", DbType.Decimal, 1);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAXPRICE", DbType.Decimal, amtttl);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAXRATE", DbType.Decimal, acctaxrate);
|
|
|
|
@ -2334,13 +2341,13 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
{
|
|
|
|
|
var tax = Math.Round(amtttl / (1 + acctaxrate / 100) * (acctaxrate / 100), 2);
|
|
|
|
|
var amount = amtttl - tax;
|
|
|
|
|
// var amount = Math.Round(amtttl / (1 + acctaxrate / 100),2);
|
|
|
|
|
// var amount = Math.Round(amtttl / (1 + acctaxrate / 100),2);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@PRICE", DbType.Decimal, amount);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@AMOUNT", DbType.Decimal, amount);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@TAX", DbType.Decimal, tax);
|
|
|
|
|
}
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@Remark", DbType.String, "");
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@GOODCODE", DbType.String,defGOOD.GOODCODE);
|
|
|
|
|
db.AddInParameter(cmdInsertInv, "@GOODCODE", DbType.String, defGOOD.GOODCODE);
|
|
|
|
|
db.ExecuteNonQuery(cmdInsertInv, tran);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -2380,11 +2387,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DBResult updateFeeTax(string billno,decimal taxrate)
|
|
|
|
|
public static DBResult updateFeeTax(string billno, decimal taxrate)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
|
var dataList = ChinvoiceDAL.GetBodyList("BILLNO='"+billno+"'");
|
|
|
|
|
var dataList = ChinvoiceDAL.GetBodyList("BILLNO='" + billno + "'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Database db = DatabaseFactory.CreateDatabase();
|
|
|
|
@ -2544,7 +2551,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int p_update_Amount(string billno,string GID)
|
|
|
|
|
public static int p_update_Amount(string billno, string GID)
|
|
|
|
|
{
|
|
|
|
|
Database db = DatabaseFactory.CreateDatabase();
|
|
|
|
|
|
|
|
|
@ -2638,15 +2645,15 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdUpdateInv, "@BILLNO", DbType.String, billno);
|
|
|
|
|
foreach (var enumValue in bodyList)
|
|
|
|
|
{
|
|
|
|
|
currency =enumValue.CURRENCY;
|
|
|
|
|
rate =enumValue.RATE;
|
|
|
|
|
custrateno =enumValue.CUSTRATENO;
|
|
|
|
|
currency = enumValue.CURRENCY;
|
|
|
|
|
rate = enumValue.RATE;
|
|
|
|
|
custrateno = enumValue.CUSTRATENO;
|
|
|
|
|
custaddrtel = enumValue.CUSTADDRTEL;
|
|
|
|
|
custbank = enumValue.CUSTBANK;
|
|
|
|
|
INVOICECATEGORY = enumValue.INVOICECATEGORY;
|
|
|
|
|
ACTUALCUSTOMERNAME = enumValue.ACTUALCUSTOMERNAME;
|
|
|
|
|
INVOICECUSTNAME = enumValue.INVOICECUSTNAME;
|
|
|
|
|
REMARK = REMARK+' '+enumValue.REMARK;
|
|
|
|
|
REMARK = REMARK + ' ' + enumValue.REMARK;
|
|
|
|
|
|
|
|
|
|
cmdInsert.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdInsert, "@BILLNO", DbType.String, billno);
|
|
|
|
@ -2655,22 +2662,24 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
cmdUpdate.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdUpdate, "@AppBILLNO", DbType.String, enumValue.BILLNO);
|
|
|
|
|
db.AddInParameter(cmdUpdate, "@INVOICENUM", DbType.String,invoiceno);
|
|
|
|
|
db.AddInParameter(cmdUpdate, "@INVOICENUM", DbType.String, invoiceno);
|
|
|
|
|
db.ExecuteNonQuery(cmdUpdate, tran);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var invdetaillist = GetDetailList("PID='"+enumValue.GID+"'",db,tran);
|
|
|
|
|
var invdetaillist = GetDetailList("PID='" + enumValue.GID + "'", db, tran);
|
|
|
|
|
if (invdetaillist != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var enumInvDetail in invdetaillist)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
bool ishave = false;
|
|
|
|
|
if (invdetailDataList != null) {
|
|
|
|
|
if (invdetailDataList != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var invdetailData in invdetailDataList)
|
|
|
|
|
{
|
|
|
|
|
if (invdetailData.GOODSNAME == enumInvDetail.GOODSNAME) {
|
|
|
|
|
if (invdetailData.GOODSNAME == enumInvDetail.GOODSNAME)
|
|
|
|
|
{
|
|
|
|
|
invdetailData.TAXPRICE = invdetailData.TAXPRICE + enumInvDetail.TAXPRICE;
|
|
|
|
|
invdetailData.PRICE = invdetailData.PRICE + enumInvDetail.PRICE;
|
|
|
|
|
invdetailData.AMOUNT = invdetailData.AMOUNT + enumInvDetail.AMOUNT;
|
|
|
|
@ -2680,7 +2689,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!ishave) {
|
|
|
|
|
if (!ishave)
|
|
|
|
|
{
|
|
|
|
|
var invdetailtmp = enumInvDetail;
|
|
|
|
|
invdetailtmp.GID = "*";
|
|
|
|
|
invdetailtmp.PID = GID;
|
|
|
|
@ -2724,7 +2734,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (invdetailDataList != null) {
|
|
|
|
|
if (invdetailDataList != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var invdetailData in invdetailDataList)
|
|
|
|
|
{
|
|
|
|
|
if (invdetailData.GID == "*")
|
|
|
|
@ -2746,7 +2757,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.ExecuteNonQuery(cmdInsertInvDetail, tran);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var cmdUpdateInvDetail =
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
@ -2893,7 +2905,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
foreach (var enumValue in bodyList)
|
|
|
|
|
{
|
|
|
|
|
var stlamount = enumValue.STLAMOUNT;
|
|
|
|
|
var invappdetail = ChinvoiceapplicationDAL.GetBodyList("c.BILLNO='"+enumValue.BILLNO+"'");
|
|
|
|
|
var invappdetail = ChinvoiceapplicationDAL.GetBodyList("c.BILLNO='" + enumValue.BILLNO + "'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (invappdetail != null)
|
|
|
|
@ -3037,7 +3049,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
if (invdetailData.GOODSNAME == enumInvDetail.GOODSNAME)
|
|
|
|
|
{
|
|
|
|
|
invdetailData.TAXPRICE = invdetailData.TAXPRICE + enumInvDetail.TAXPRICE * (stlinvaount / enumInvDetail.AMOUNT);
|
|
|
|
|
invdetailData.PRICE = invdetailData.PRICE + enumInvDetail.PRICE*(stlinvaount/ enumInvDetail.AMOUNT);
|
|
|
|
|
invdetailData.PRICE = invdetailData.PRICE + enumInvDetail.PRICE * (stlinvaount / enumInvDetail.AMOUNT);
|
|
|
|
|
invdetailData.AMOUNT = invdetailData.AMOUNT + stlinvaount;
|
|
|
|
|
invdetailData.TAX = invdetailData.TAX + enumInvDetail.TAX * (stlinvaount / enumInvDetail.AMOUNT);
|
|
|
|
|
ishave = true;
|
|
|
|
@ -3179,7 +3191,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DBResult DelAppList(List<ChInvoiceapplication> boday,string billno)
|
|
|
|
|
public static DBResult DelAppList(List<ChInvoiceapplication> boday, string billno)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -3199,7 +3211,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
var cmddelete = db.GetSqlStringCommand("delete from ch_fee_do where BILLNO=@BILLNO AND FEEID IN (SELECT FEEID FROM CH_FEE_DO WHERE BILLNO=@AppBILLNO)");
|
|
|
|
|
|
|
|
|
|
var cmdUpdate =db.GetSqlStringCommand(
|
|
|
|
|
var cmdUpdate = db.GetSqlStringCommand(
|
|
|
|
|
@"declare @FEEID varchar(100)
|
|
|
|
|
declare @ORDERINVOICE numeric(19,4)
|
|
|
|
|
|
|
|
|
@ -3267,7 +3279,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DBResult UpdateInvNoDelete(string billno,string userid,bool isdelete=true)
|
|
|
|
|
public static DBResult UpdateInvNoDelete(string billno, string userid, bool isdelete = true)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -3291,7 +3303,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
|
@"UPDATE ch_fee_invoiceitems set ISDELETE=0 where INVOICENUM=@BILLNO");
|
|
|
|
|
|
|
|
|
|
if (billno.Length > 8) {
|
|
|
|
|
if (billno.Length > 8)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
cmdUpdate =
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
@ -3315,7 +3328,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdUpdate, "@DELETETIME", DbType.String, DateTime.Now);
|
|
|
|
|
db.ExecuteNonQuery(cmdUpdate, tran);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
cmdUpdate2.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdUpdate2, "@BILLNO", DbType.String, billno);
|
|
|
|
@ -3346,7 +3360,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
public static DBResult UpdateInvNoUse(string billno, string userid,string invbillno)
|
|
|
|
|
public static DBResult UpdateInvNoUse(string billno, string userid, string invbillno)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -3371,7 +3385,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
var cmdUpdate =
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
|
@"UPDATE ch_fee_invoiceitems set ISMAKEOUT=1,MAKEOUTUSER=@DELETEUSER,MAKEOUTTIME=@DELETETIME,BILLNO=@INVBILLNO where INVOICENUM=@BILLNO");
|
|
|
|
|
if (billno.Length > 8) {
|
|
|
|
|
if (billno.Length > 8)
|
|
|
|
|
{
|
|
|
|
|
cmdUpdate =
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
|
@"UPDATE ch_fee_invoiceitems set ISMAKEOUT=1,MAKEOUTUSER=@DELETEUSER,MAKEOUTTIME=@DELETETIME,BILLNO=@INVBILLNO FROM ch_fee_invoiceitems I
|
|
|
|
@ -3430,7 +3445,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
|
@"UPDATE ch_fee_invoiceitems set ISMAKEOUT=0,MAKEOUTUSER='',MAKEOUTTIME=null,BILLNO='' where INVOICENUM=@BILLNO");
|
|
|
|
|
|
|
|
|
|
if (billno.Length > 8) {
|
|
|
|
|
if (billno.Length > 8)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
cmdUpdate =
|
|
|
|
|
db.GetSqlStringCommand(
|
|
|
|
@ -3514,7 +3530,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static DBResult UpdateDelete(string billno,string userid,bool isdelete=true)
|
|
|
|
|
public static DBResult UpdateDelete(string billno, string userid, bool isdelete = true)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -3544,7 +3560,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
db.AddInParameter(cmdUpdate, "@BILLNO", DbType.String, billno);
|
|
|
|
|
db.ExecuteNonQuery(cmdUpdate, tran);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cmdUpdate2.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdUpdate2, "@BILLNO", DbType.String, billno);
|
|
|
|
|
db.ExecuteNonQuery(cmdUpdate2, tran);
|
|
|
|
@ -3711,7 +3728,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DBResult UnLock(String bill,string userid)
|
|
|
|
|
public static DBResult UnLock(String bill, string userid)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -3762,7 +3779,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static DBResult UnLockList(String bills,string userid)
|
|
|
|
|
public static DBResult UnLockList(String bills, string userid)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -3836,7 +3853,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cmdupdate = db.GetSqlStringCommand("update ch_fee_invoice set DZSTATUS='"+dzstatus+"' where BILLNO=@BILLNO");
|
|
|
|
|
var cmdupdate = db.GetSqlStringCommand("update ch_fee_invoice set DZSTATUS='" + dzstatus + "' where BILLNO=@BILLNO");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmdupdate.Parameters.Clear();
|
|
|
|
@ -3925,7 +3942,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
public static DBResult GetRemarksTemplate(string companyid, string templatename = "")
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
if (templatename == "" || templatename ==null) { templatename = "发票备注"; };
|
|
|
|
|
if (templatename == "" || templatename == null) { templatename = "发票备注"; };
|
|
|
|
|
string str = "";
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
strSql.Append("SELECT ");
|
|
|
|
@ -3950,7 +3967,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static DBResult SaveRemarksTemplate(string Template,string companyid,string templatename="")
|
|
|
|
|
public static DBResult SaveRemarksTemplate(string Template, string companyid, string templatename = "")
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
@ -4108,8 +4125,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
//if (strl == "") strl = str + Environment.NewLine;
|
|
|
|
|
//else strl = strl + str + Environment.NewLine;
|
|
|
|
|
if (strl == "") strl = str +" ";
|
|
|
|
|
else strl = strl + str +" ";
|
|
|
|
|
if (strl == "") strl = str + " ";
|
|
|
|
|
else strl = strl + str + " ";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -4122,7 +4139,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
for (var i = 0; i <= StrList.Length - 1; i++)
|
|
|
|
|
{
|
|
|
|
|
str = StrList[i];
|
|
|
|
|
if (str.IndexOf("[外币金额(总计)]") >=0|| str.IndexOf("[人民币金额(总计)]") >= 0 && str.IndexOf("[折算汇率(总计)]") >= 0)
|
|
|
|
|
if (str.IndexOf("[外币金额(总计)]") >= 0 || str.IndexOf("[人民币金额(总计)]") >= 0 && str.IndexOf("[折算汇率(总计)]") >= 0)
|
|
|
|
|
{
|
|
|
|
|
str = str.Replace("[委托编号]", "");
|
|
|
|
|
str = str.Replace("[主提单号]", "");
|
|
|
|
@ -4205,7 +4222,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
r.WriteLine("<Kp>");
|
|
|
|
|
r.WriteLine("<Version>2.0</Version>");
|
|
|
|
|
r.WriteLine("<Fpxx>");
|
|
|
|
|
r.WriteLine("<Zsl>"+headList.Count+"</Zsl>");
|
|
|
|
|
r.WriteLine("<Zsl>" + headList.Count + "</Zsl>");
|
|
|
|
|
r.WriteLine("<Fpsj>");
|
|
|
|
|
foreach (var bill in headList)
|
|
|
|
|
{
|
|
|
|
@ -4221,18 +4238,18 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
r.WriteLine("<Fhr>" + fhr + "</Fhr>");
|
|
|
|
|
r.WriteLine("<Skr>" + skr + "</Skr>");
|
|
|
|
|
r.WriteLine("<Spbmbbh>12.0</Spbmbbh>");
|
|
|
|
|
if (bill.EXCHANGERATE==0)
|
|
|
|
|
if (bill.EXCHANGERATE == 0)
|
|
|
|
|
r.WriteLine("<Hsbz>0</Hsbz>");
|
|
|
|
|
else
|
|
|
|
|
r.WriteLine("<Hsbz>1</Hsbz>");
|
|
|
|
|
|
|
|
|
|
r.WriteLine("<Spxx>");
|
|
|
|
|
var invdetaillist = GetDetailList("PID='"+bill.GID+"'");
|
|
|
|
|
var invdetaillist = GetDetailList("PID='" + bill.GID + "'");
|
|
|
|
|
var invno = 1;
|
|
|
|
|
foreach (var invdetail in invdetaillist)
|
|
|
|
|
{
|
|
|
|
|
r.WriteLine("<Sph>");
|
|
|
|
|
r.WriteLine("<Xh>" + invno.ToString()+ "</Xh>");
|
|
|
|
|
r.WriteLine("<Xh>" + invno.ToString() + "</Xh>");
|
|
|
|
|
r.WriteLine("<Spmc>" + invdetail.GOODSNAMEREF + "</Spmc>");
|
|
|
|
|
r.WriteLine("<Ggxh>" + invdetail.SPEC + "</Ggxh>");
|
|
|
|
|
r.WriteLine("<Jldw>" + invdetail.UNIT + "</Jldw>");
|
|
|
|
@ -4244,10 +4261,10 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
r.WriteLine("<Yhzcsm>" + defGOOD.DEFREMARK + "</Yhzcsm>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r.WriteLine("<Dj>" + Math.Round(invdetail.PRICE,2).ToString() + "</Dj>");
|
|
|
|
|
r.WriteLine("<Sl>" + Math.Round(invdetail.PKGS,0).ToString() + "</Sl>");
|
|
|
|
|
r.WriteLine("<Je>" + Math.Round(invdetail.AMOUNT,2).ToString() + "</Je>");
|
|
|
|
|
r.WriteLine("<Slv>" + Math.Round((invdetail.TAXRATE/100),2).ToString() + "</Slv>");
|
|
|
|
|
r.WriteLine("<Dj>" + Math.Round(invdetail.PRICE, 2).ToString() + "</Dj>");
|
|
|
|
|
r.WriteLine("<Sl>" + Math.Round(invdetail.PKGS, 0).ToString() + "</Sl>");
|
|
|
|
|
r.WriteLine("<Je>" + Math.Round(invdetail.AMOUNT, 2).ToString() + "</Je>");
|
|
|
|
|
r.WriteLine("<Slv>" + Math.Round((invdetail.TAXRATE / 100), 2).ToString() + "</Slv>");
|
|
|
|
|
r.WriteLine("<Kce>0</Kce>");
|
|
|
|
|
|
|
|
|
|
r.WriteLine("</Sph>");
|
|
|
|
@ -4259,9 +4276,10 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
r.WriteLine("</Spxx>");
|
|
|
|
|
|
|
|
|
|
r.WriteLine("</Fp>");
|
|
|
|
|
if (INVEXPLOCK.PARAMVALUE == "1") {
|
|
|
|
|
if (INVEXPLOCK.PARAMVALUE == "1")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var blUpSQL = "update ch_fee_invoice set BILLSTATUS=1 where BILLNO='" + bill.BILLNO+ "' ";
|
|
|
|
|
var blUpSQL = "update ch_fee_invoice set BILLSTATUS=1 where BILLNO='" + bill.BILLNO + "' ";
|
|
|
|
|
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4274,7 +4292,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
f.Close();
|
|
|
|
|
return filename;
|
|
|
|
|
}
|
|
|
|
|
public static string CreateDZInvList(List<ChInvoice_HangXin> headList, string path,string companyid)
|
|
|
|
|
public static string CreateDZInvList(List<ChInvoice_HangXin> headList, string path, string companyid)
|
|
|
|
|
{
|
|
|
|
|
var opBill = headList[0];
|
|
|
|
|
string filename = path + "\\" + headList[0].INVOICENO.ToString() + "-" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".xml";
|
|
|
|
@ -4306,7 +4324,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
var invdetaillist = GetDetailList("PID='" + bill.GID + "'");
|
|
|
|
|
foreach (var invdetail1 in invdetaillist)
|
|
|
|
|
{
|
|
|
|
|
hjse = hjse+invdetail1.TAX;
|
|
|
|
|
hjse = hjse + invdetail1.TAX;
|
|
|
|
|
}
|
|
|
|
|
hjje = bill.INVAMOUNT - hjse;
|
|
|
|
|
r.WriteLine("<COMMON_FPKJ_FPT class=\"COMMON_FPKJ_FPT\">");
|
|
|
|
@ -4315,9 +4333,9 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
r.WriteLine("<BMB_BBH>33.0</BMB_BBH>");
|
|
|
|
|
var company = MsCompanysDAL.GetNoPicData("GID='" + companyid + "'");
|
|
|
|
|
|
|
|
|
|
r.WriteLine("<XSF_NSRSBH>" + company.TAXCODE+ "</XSF_NSRSBH>");
|
|
|
|
|
r.WriteLine("<XSF_NSRSBH>" + company.TAXCODE + "</XSF_NSRSBH>");
|
|
|
|
|
r.WriteLine("<XSF_MC>" + company.BILLRISES + "</XSF_MC>");
|
|
|
|
|
r.WriteLine("<XSF_DZDH>" +company.ADDRESS + "</XSF_DZDH>");
|
|
|
|
|
r.WriteLine("<XSF_DZDH>" + company.ADDRESS + "</XSF_DZDH>");
|
|
|
|
|
r.WriteLine("<XSF_YHZH></XSF_YHZH>");
|
|
|
|
|
|
|
|
|
|
r.WriteLine("<GMF_NSRSBH>" + bill.CUSTRATENO + "</GMF_NSRSBH>");
|
|
|
|
@ -4349,7 +4367,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
r.WriteLine("<FPHXZ>0</FPHXZ>");
|
|
|
|
|
r.WriteLine("<SPBM>" + defGOOD.GOODCODE + "</SPBM>");
|
|
|
|
|
r.WriteLine("<ZXBM>" + defGOOD.GOODCODE + "</ZXBM>");
|
|
|
|
|
if (defGOOD.ISUSEPREF=="1")
|
|
|
|
|
if (defGOOD.ISUSEPREF == "1")
|
|
|
|
|
r.WriteLine("<YHZCBS>1</YHZCBS>");
|
|
|
|
|
else r.WriteLine("<YHZCBS>0</YHZCBS>");
|
|
|
|
|
r.WriteLine("<LSLBS>1</LSLBS>");
|
|
|
|
@ -4383,7 +4401,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CreateInvRYORDERTList(List<ChInvoice_HangXin> headList, string path,string optype,string invaccount,string invpsw)
|
|
|
|
|
public static string CreateInvRYORDERTList(List<ChInvoice_HangXin> headList, string path, string optype, string invaccount, string invpsw)
|
|
|
|
|
{
|
|
|
|
|
var opBill = headList[0];
|
|
|
|
|
string filename = path + "\\FPORDER" + headList[0].INVOICENO.ToString() + "-" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".xml";
|
|
|
|
@ -4397,7 +4415,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ReCode = "OP01";
|
|
|
|
|
if (optype=="M") ReCode = "OP02";
|
|
|
|
|
if (optype == "M") ReCode = "OP02";
|
|
|
|
|
if (optype == "D") ReCode = "OP03";
|
|
|
|
|
Request order = new Request();
|
|
|
|
|
XmlHead Head = new XmlHead();
|
|
|
|
@ -4415,10 +4433,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
foreach (var bill in headList)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var bslist = GetBsList("c.BILLNO='"+bill.BILLNO+"'");
|
|
|
|
|
var bslist = GetBsList("c.BILLNO='" + bill.BILLNO + "'");
|
|
|
|
|
var bs = new Chfee_do_detail();
|
|
|
|
|
if (bslist.Count > 0) bs = bslist[0];
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bs.ETD = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
|
|
bs.PORTLOAD = "QINGDAO";
|
|
|
|
|
bs.PORTDISCHARGE = "KOBE,JAPAN";
|
|
|
|
@ -4436,18 +4455,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
orderdetail.order_type = "整箱";
|
|
|
|
|
orderdetail.order_date = bs.ETD;
|
|
|
|
|
orderdetail.customer_fullname = bill.INVOICECUSTNAME;
|
|
|
|
|
orderdetail.start_port =bs.PORTLOAD.Replace(","," ");
|
|
|
|
|
orderdetail.start_port = bs.PORTLOAD.Replace(",", " ");
|
|
|
|
|
orderdetail.end_port = bs.PORTDISCHARGE.Replace(",", " ");
|
|
|
|
|
orderdetail.sail_date =bs.ETD;
|
|
|
|
|
orderdetail.shipname =bs.VESSEL;
|
|
|
|
|
orderdetail.voyage_no =bs.VOYNO;
|
|
|
|
|
orderdetail.bill_lading_no =bs.MBLNO;
|
|
|
|
|
orderdetail.sail_date = bs.ETD;
|
|
|
|
|
orderdetail.shipname = bs.VESSEL;
|
|
|
|
|
orderdetail.voyage_no = bs.VOYNO;
|
|
|
|
|
orderdetail.bill_lading_no = bs.MBLNO;
|
|
|
|
|
|
|
|
|
|
var ctnList = new List<XmlCtn>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bsctnlist =MsOpSeaeDAL.GetBodyListSum("BSNO='"+bs.BSNO+"'");
|
|
|
|
|
foreach (var enumCtn in bsctnlist ) {
|
|
|
|
|
var bsctnlist = MsOpSeaeDAL.GetBodyListSum("BSNO='" + bs.BSNO + "'");
|
|
|
|
|
foreach (var enumCtn in bsctnlist)
|
|
|
|
|
{
|
|
|
|
|
XmlCtn ctn = new XmlCtn();
|
|
|
|
|
ctn.ctn_type = enumCtn.CTNALL;
|
|
|
|
|
ctn.ctn_quantity = enumCtn.CTNNUM.ToString();
|
|
|
|
@ -4458,7 +4478,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
XmlCtns Ctns = new XmlCtns();
|
|
|
|
|
Ctns.Ctns = ctnList;
|
|
|
|
|
orderBody.Ctns= Ctns;
|
|
|
|
|
orderBody.Ctns = Ctns;
|
|
|
|
|
var feelist = new List<Xmlexpense>();
|
|
|
|
|
var invdetaillist = GetDetailList("PID='" + bill.GID + "'");
|
|
|
|
|
var invno = 1;
|
|
|
|
@ -4468,11 +4488,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
fee.expense_id = invdetail.GID;
|
|
|
|
|
fee.expense_name = invdetail.GOODSNAMEREF;
|
|
|
|
|
fee.currency = "RMB";
|
|
|
|
|
fee.price =Math.Round(invdetail.TAXPRICE,2).ToString();
|
|
|
|
|
fee.price = Math.Round(invdetail.TAXPRICE, 2).ToString();
|
|
|
|
|
fee.unit = invdetail.UNIT;
|
|
|
|
|
if (fee.unit == "") fee.unit = "票";
|
|
|
|
|
fee.quantity = Math.Round(invdetail.PKGS,0).ToString();
|
|
|
|
|
if (fee.quantity == ""|| fee.quantity == "0") fee.quantity = "1";
|
|
|
|
|
fee.quantity = Math.Round(invdetail.PKGS, 0).ToString();
|
|
|
|
|
if (fee.quantity == "" || fee.quantity == "0") fee.quantity = "1";
|
|
|
|
|
|
|
|
|
|
feelist.Add(fee);
|
|
|
|
|
}
|
|
|
|
@ -4482,7 +4502,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
orderBody.expenses = expenses;
|
|
|
|
|
order.OrderBody = orderBody;
|
|
|
|
|
|
|
|
|
|
// order.OrderBody=ord
|
|
|
|
|
// order.OrderBody=ord
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
using (StreamWriter sw = new StreamWriter(filename))
|
|
|
|
@ -4501,7 +4521,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string CreateInvRYTList(List<ChInvoice_HangXin> headList, string path, string optype, List<Xmlexpense> expenses,string invaccount,string invpsw,string email)
|
|
|
|
|
public static string CreateInvRYTList(List<ChInvoice_HangXin> headList, string path, string optype, List<Xmlexpense> expenses, string invaccount, string invpsw, string email)
|
|
|
|
|
{
|
|
|
|
|
var opBill = headList[0];
|
|
|
|
|
string filename = path + "\\FP" + headList[0].INVOICENO.ToString() + "-" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".xml";
|
|
|
|
@ -4550,7 +4570,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
invoice.customer_bank_name = banklist[0];
|
|
|
|
|
invoice.customer_bank_account = banklist[1];
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
invoice.customer_bank_name = bill.CUSTBANK;
|
|
|
|
|
invoice.customer_bank_account = bill.CUSTBANK;
|
|
|
|
|
}
|
|
|
|
@ -4568,7 +4589,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// order.OrderBody.Ctns.Ctns = ctnList;
|
|
|
|
|
// order.OrderBody.Ctns.Ctns = ctnList;
|
|
|
|
|
var XmlInvDetail = new List<XmlInvDetail>();
|
|
|
|
|
var invno = 1;
|
|
|
|
|
foreach (var invdetail in expenses)
|
|
|
|
@ -4589,8 +4610,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
|
|
|
|
|
invoiceBodys.InvDetail = invoicelist;
|
|
|
|
|
XmlInvoiceBody invoiceBody = new XmlInvoiceBody();
|
|
|
|
|
invoiceBody.InvoiceBodys = invoiceBodys;
|
|
|
|
|
order.InvoiceBody= invoiceBody;
|
|
|
|
|
// order.OrderBody.expenses.expenses = feelist;
|
|
|
|
|
order.InvoiceBody = invoiceBody;
|
|
|
|
|
// order.OrderBody.expenses.expenses = feelist;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|