/// <summary> /// 订单收款状态 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public string colStatus(string orderId) { int id = 0; int.TryParse(orderId, out id); DataTable orderdt = To_OrderCollectDetialManager.getList(id); List <string> status = new List <string>(); for (int i = 0; i < orderdt.Rows.Count; i++) { status.Add(getStatus(orderdt.Rows[i]["id"].ToString(), orderdt.Rows[i]["money"].ToString())); } if (status.All <string>(x => x == "0")) //判断是否都为0 { return("<font color='red'>未收款</font>"); } else if (status.All <string>(x => x == "2")) //判断是否都为2 { return("<font color='green'>完成收款</font>"); } else { return("<font color='blue'>部分收款</font>"); } }
/// <summary> /// 验证是否能够存档 /// </summary> /// <param name="orderid"></param> /// <param name="fileStatus"></param> /// <param name="iscancel"></param> /// <returns></returns> public bool isCanFile(object orderid, object fileStatus, object iscancel) { if (iscancel.ToString() == "Y") { return(true); } else { int id = 0; int.TryParse(orderid.ToString(), out id); DataTable ordercollect = To_OrderCollectDetialManager.getList(id); DataTable orderpay = To_OrderPayDetialManager.getList(id); List <string> collectstatus = new List <string>(); List <string> paystatus = new List <string>(); for (int i = 0; i < ordercollect.Rows.Count; i++) { collectstatus.Add(ordercollect.Rows[i]["collectStatus"].ToString()); } for (int i = 0; i < orderpay.Rows.Count; i++) { paystatus.Add(orderpay.Rows[i]["payStatus"].ToString()); } if ((collectstatus.All <string>(x => x == "完成收款") && paystatus.All <string>(x => x == "完成付款")) && fileStatus.ToString() == "0") { return(true); } else { return(false); } } }
/// <summary> /// 得到收款明细信息 /// </summary> /// <param name="orderid"></param> /// <returns></returns> public string getCollectDetail(object orderid) { //return "得到收款明细"; StringBuilder str = new StringBuilder(); str.Append("<table border='1' >"); str.Append("<tr><th width='200px'>收款单位</th><th width='50px'>成人</th><th width='50px'>儿童</th><th width='50px'>陪同</th><th width='80px'>应收团款</th><th width='80px'>已收团款</th><th width='80px'>未收团款</th><th width='80px'>业务提成</th></tr>"); DataTable dt = To_OrderCollectDetialManager.getList(int.Parse(orderid.ToString())); for (int i = 0; i < dt.Rows.Count; i++) { double money = Convert.IsDBNull(dt.Rows[i]["money"]) ? 0.0 : Convert.ToDouble(dt.Rows[i]["money"]); double collectAmount = Convert.IsDBNull(dt.Rows[i]["collectAmount"]) ? 0.0 : Convert.ToDouble(dt.Rows[i]["collectAmount"]); str.Append("<tr><td>" + dt.Rows[i]["cusName"].ToString() + "</td>"); //收款单位 str.Append("<td>" + dt.Rows[i]["adultNum"].ToString() + "</td>"); //成人数 str.Append("<td>" + dt.Rows[i]["childNum"].ToString() + "</td>"); //儿童数 str.Append("<td>" + dt.Rows[i]["withNum"].ToString() + "</td>"); //陪同数 str.Append("<td>" + money.ToString() + "</td>"); //应收团款 str.Append("<td>" + collectAmount.ToString() + "</td>"); //已收团款 str.Append("<td>" + (money - collectAmount).ToString() + "</td>"); //未收团款 str.Append("<td>" + dt.Rows[i]["cutPayStatus"].ToString() + "</td></tr>"); //业务提成 } str.Append("</table>"); return(str.ToString()); }
/// <summary> /// 收款 /// </summary> /// <param name="id"></param> private decimal LoadCol(int id) { decimal moneyAmount = 0; decimal hasAmount = 0; decimal outmoney = 0; DataTable dt = To_OrderCollectDetialManager.getList(id); if (dt.Rows.Count > 0) { HtmlTableRow row = null; HtmlTableCell cell = null; for (int i = 0; i < dt.Rows.Count; i++) { //string statusAndMoney = GetColStatusAndAmount(dt.Rows[i]["orderid"].ToString(), dt.Rows[i]["cusId"].ToString(), dt.Rows[i]["money"].ToString()); row = new HtmlTableRow(); cell = new HtmlTableCell(); //收款单位名称 cell.Attributes.CssStyle.Add("height", "20px"); cell.InnerHtml = dt.Rows[i]["cusName"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //业务员 cell.InnerHtml = dt.Rows[i]["salesman"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //营业部 cell.Attributes.Add("onclick", "getdepart('" + dt.Rows[i]["linkid"].ToString() + "')"); cell.InnerHtml = dt.Rows[i]["departName"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //联系人 cell.InnerHtml = dt.Rows[i]["linkname"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //成人数 cell.InnerHtml = dt.Rows[i]["adultNum"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //儿童数 cell.InnerHtml = dt.Rows[i]["childNum"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //陪同 cell.InnerHtml = dt.Rows[i]["withNum"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //金额 cell.InnerHtml = dt.Rows[i]["money"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //收款状态 cell.InnerHtml = dt.Rows[i]["collectStatus"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //实际收款金额 cell.Attributes.Add("class", "abc"); cell.Attributes.Add("title", "实际收款金额"); cell.InnerHtml = dt.Rows[i]["collectAmount"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); //剩余金额 double symoney = getSurplus(dt.Rows[i]["money"].ToString(), dt.Rows[i]["collectAmount"].ToString()); cell.InnerHtml = symoney.ToString("F2"); row.Controls.Add(cell); cell = new HtmlTableCell(); //备注 cell.InnerHtml = dt.Rows[i]["remark"].ToString(); row.Controls.Add(cell); this.tablelink.Controls.Add(row); //应收金额合计 outmoney = 0; decimal.TryParse(dt.Rows[i]["money"].ToString(), out outmoney); moneyAmount += outmoney; //实际金额合计 outmoney = 0; decimal.TryParse(dt.Rows[i]["collectAmount"].ToString(), out outmoney); hasAmount += outmoney; } } this.lblCollAmount.InnerText = moneyAmount.ToString("F2"); this.lblColHasAmount.InnerText = hasAmount.ToString("F2"); return(hasAmount); }