Exemplo n.º 1
0
 //导入结算单据
 void ImportDocument()
 {
     if (windowStatus == WindowStatus.View)
     {
         return;
     }
     if (txtcCustName.Tag == null)//客户
     {
         MessageBoxEx.Show(string.Format("请选择{0}!", lblCustName.Text.Replace(":", "")));
         txtcCustName.Focus();
         return;
     }
     string paymentType = CommonCtrl.IsNullToString(cboOrderType.SelectedValue);//收付款类型
     if (paymentType.Length == 0)
     {
         return;
     }
     if (orderType == DataSources.EnumOrderType.RECEIVABLE)
     {
         #region 应收
         DataSources.EnumReceivableType enumType = (DataSources.EnumReceivableType)int.Parse(paymentType);
         if (enumType == DataSources.EnumReceivableType.RECEIVABLE)
         {
             cmsImport.Show(base.btnImport, 0, base.btnImport.Height);
             return;
         }
         else
         {
             //预收
             frmReceivableByAdvances frm = new frmReceivableByAdvances(txtcCustName.Tag.ToString());
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 BindDocument(frm.listRows, true);
             }
         }
         #endregion
     }
     else
     {
         #region 应付
         StringBuilder sbWhere = new StringBuilder();
         DataSources.EnumPaymentType enumType = (DataSources.EnumPaymentType)int.Parse(paymentType);
         if (enumType == DataSources.EnumPaymentType.PAYMENT)
         {
             frmPayment frm = new frmPayment(txtcCustName.Tag.ToString());
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 BindDocument(frm.listRows, false);
             }
         }
         else
         {
             frmPaymentByAdvances frm = new frmPaymentByAdvances(txtcCustName.Tag.ToString());
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 BindDocument(frm.listRows, true);
             }
         }
         #endregion
     }
 }
 /// <summary>
 /// 导入预付
 /// </summary>
 /// <param name="txtcCust"></param>
 /// <param name="lblCust"></param>
 void ImportYuFu(TextChooser txtcCust, Label lblCust)
 {
     if (txtcCust.Tag == null)
     {
         MessageBoxEx.Show(string.Format("请选择{0}!", lblCust.Text.TrimEnd(':')));
         txtcCust.Focus();
         return;
     }
     //frmBalanceDocuments frmDocuments = new frmBalanceDocuments(DataSources.EnumOrderType.PAYMENT, txtcCust.Tag.ToString(), ((int)DataSources.EnumPaymentType.ADVANCES).ToString());
     frmPaymentByAdvances frmDocuments = new frmPaymentByAdvances(txtcCust.Tag.ToString());
     if (frmDocuments.ShowDialog() == DialogResult.OK)
     {
         StringBuilder sbWhere = new StringBuilder();
         sbWhere.AppendFormat("order_id in ({0})", frmDocuments.ids);
         sbWhere.AppendFormat(" and wait_money>0");
         DataTable dt = DBHelper.GetTable("", "v_parts_purchase_order_payment", "*", sbWhere.ToString(), "", "");
         foreach (DataRow dr in dt.Rows)
         {
             DataGridViewRow dgvr = dgvDocuments.Rows[dgvDocuments.Rows.Add()];
             dgvr.Cells[colOrderName.Name].Value = "采购订单";//单据名称
             dgvr.Cells[colOrderNum.Name].Value = dr["order_num"];//单据编号
             dgvr.Cells[colOrderID.Name].Value = dr["sale_billing_id"];//单据ID
             //dgvr.Cells[colOrderDate.Name].Value = Common.UtcLongToLocalDateTime(dr["receivables_date"]);//单据日期
             dgvr.Cells[colMoney.Name].Value = dr["prepaid_money"];//开单金额
             dgvr.Cells[colSettledMoney.Name].Value = dr["money"];//已结算金额
             dgvr.Cells[colWaitMoney.Name].Value = dr["wait_money"];//未结算金额
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 导入预付
 /// </summary>
 void ImportPaymentByAdvances()
 {
     frmPaymentByAdvances frm = new frmPaymentByAdvances(txtcCustName.Tag.ToString());
     if (frm.ShowDialog() == DialogResult.OK)
     {
         BindDocument(frm.listRows, true);
     }
 }