private void Init_SLV() { TaxCard card = TaxCardFactory.CreateTaxCard(); int count = card.get_SQInfo().PZSQType.Count; List <double> list = new List <double>(); for (int i = 0; i < count; i++) { if ((card.get_SQInfo().PZSQType[i].invType == 11) && (card.get_SQInfo().PZSQType[i].TaxRate.Count > 0)) { this.textBox16.Text = card.get_SQInfo().PZSQType[i].TaxRate[0].Rate.ToString(); } } }
public static double GetInvLimit(InvType FPType) { if (InvLimitCommon == -1.0) { InvoiceType type = (InvoiceType)FPType; int count = taxCard.get_SQInfo().PZSQType.Count; for (int i = 0; i < count; i++) { if (taxCard.get_SQInfo().PZSQType[i].invType == 2) { InvLimitCommon = taxCard.get_SQInfo().PZSQType[i].InvAmountLimit; } if (taxCard.get_SQInfo().PZSQType[i].invType == 0) { InvLimitSpecial = taxCard.get_SQInfo().PZSQType[i].InvAmountLimit; } if (taxCard.get_SQInfo().PZSQType[i].invType == 11) { InvLimitTransportation = taxCard.get_SQInfo().PZSQType[i].InvAmountLimit; } if (taxCard.get_SQInfo().PZSQType[i].invType == 12) { InvLimitVehiclesales = taxCard.get_SQInfo().PZSQType[i].InvAmountLimit; } } if (FPType == InvType.Common) { return(InvLimitCommon); } if (FPType == InvType.Special) { return(InvLimitSpecial); } if (FPType == InvType.transportation) { return(InvLimitTransportation); } if (FPType == InvType.vehiclesales) { return(InvLimitVehiclesales); } return(0.0); } if (FPType == InvType.Common) { return(InvLimitCommon); } if (FPType == InvType.Special) { return(InvLimitSpecial); } if (FPType == InvType.transportation) { return(InvLimitTransportation); } if (FPType == InvType.vehiclesales) { return(InvLimitVehiclesales); } return(0.0); }
private void toolBtnZDCF_Click(object sender, EventArgs e) { try { if (this.aisinoDataGrid1.get_SelectedRows().Count != 0) { if (this.aisinoDataGrid1.get_SelectedRows().Count == 1) { string bH = this.aisinoDataGrid1.get_SelectedRows()[0].Cells["BH"].Value.ToString(); SaleBill bill = this.billBL.Find(bH); InvType common = InvType.Common; TaxCard card = TaxCardFactory.CreateTaxCard(); if (bill.DJZL == "c") { if (!card.get_QYLX().ISPTFP) { MessageManager.ShowMsgBox("无法取得普通发票开票限额,不能拆分!"); return; } common = InvType.Common; } else if (bill.DJZL == "s") { if (!card.get_QYLX().ISZYFP) { MessageManager.ShowMsgBox("无法取得专用发票开票限额,不能拆分!"); return; } common = InvType.Special; } double invAmountLimit = 0.0; int count = card.get_SQInfo().PZSQType.Count; for (int i = 0; i < count; i++) { if (card.get_SQInfo().PZSQType[i].invType == 2) { invAmountLimit = card.get_SQInfo().PZSQType[i].InvAmountLimit; } if (card.get_SQInfo().PZSQType[i].invType == 0) { invAmountLimit = card.get_SQInfo().PZSQType[i].InvAmountLimit; } } bool hzfw = card.get_StateInfo().CompanyType > 0; bool exEWMInfoSplit = false; if (this.checkBox2.Checked) { if ((bill.DJZL == "c") && (bill.QDHSPMC.Length > 0)) { exEWMInfoSplit = false; } else { exEWMInfoSplit = true; } } else if (bill.DJZL == "s") { exEWMInfoSplit = true; } if (!hzfw) { exEWMInfoSplit = true; } int[] slvjeseIndex = GenerateInvoice.Instance.SetInvoiceTimes(); string reason = ""; string str3 = this.billBL.CheckBillRecordCF(bill, "AT", exEWMInfoSplit, ref reason, slvjeseIndex, hzfw, false); if (str3 == "Needless") { if (reason.Equals("差额税单据不允许拆分")) { MessageManager.ShowMsgBox(reason); } else { MessageManager.ShowMsgBox("INP-272204"); } } else if (str3 != "Need") { str3 = "该单据不能进行自动拆分!" + str3.Replace("HasWrong", ""); MessageBoxHelper.Show(reason, "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { SeparateType keepMaxJE; bool mergeSmallJE = false; if (this.radioButton1.Checked) { keepMaxJE = SeparateType.KeepMaxJE; } else { keepMaxJE = SeparateType.KeepMaxSL; } if (this.checkBox1.Checked) { mergeSmallJE = true; } string str4 = this.billBL.AutoSeparate(bill, keepMaxJE, mergeSmallJE, exEWMInfoSplit, slvjeseIndex, hzfw); if (str4 == "0") { DJCFAuto auto = new DJCFAuto(bill, this.djcfBLL); if (auto.ShowDialog() == DialogResult.OK) { if (this.JYrule == "s") { this.aisinoDataGrid1.remove_DataGridRowSelectionChanged(new EventHandler <DataGridRowEventArgs>(this.aisinoDataGrid1_DataGridRowSelectionChanged)); this.CheckAdd(this.djcfBLL.Pagesize, this.djcfBLL.CurrentPage); this.aisinoDataGrid1.add_DataGridRowSelectionChanged(new EventHandler <DataGridRowEventArgs>(this.aisinoDataGrid1_DataGridRowSelectionChanged)); } else { this.dataSet = this.djcfBLL.QueryXSDJ(this.KeyWords, this.DJmonth, this.DJtype, this.JYrule, this.djcfBLL.Pagesize, this.djcfBLL.CurrentPage); this.aisinoDataGrid1.set_DataSource(this.dataSet); } } if (this.aisinoDataGrid1.get_Rows().Count == 0) { this.aisinoDataGrid2.set_DataSource(this.djcfBLL.QueryXSDJMX("noexist", this.djcfBLL.Pagesize, 1)); } } else { string str6; string str5 = "该单据不能进行自动拆分!"; switch (str4) { case "-1": MessageManager.ShowMsgBox("折扣组超过拆分限制,不允许拆分!"); return; case "-2": MessageManager.ShowMsgBox("非清单发票商品名称中含有“清单”字样,不允许拆分!"); return; case "-3": MessageManager.ShowMsgBox(str5); return; case "-4": MessageManager.ShowMsgBox(str5); return; case "-5": MessageManager.ShowMsgBox(str5); return; case "-6": MessageManager.ShowMsgBox("INP-272204"); return; case "-7": MessageManager.ShowMsgBox("商品金额乘以税率的值与税额的误差超过限制,不允许拆分!"); return; case "-8": MessageManager.ShowMsgBox("商品单价乘以数量与金额误差超过限制,不允许拆分!"); return; case "-9": MessageManager.ShowMsgBox("拆分后单据号长度超过50,不允许拆分!"); return; case "-10": MessageManager.ShowMsgBox(str5); return; case "-11": MessageManager.ShowMsgBox(str5); return; } if (str4.StartsWith("[-1]")) { str6 = str4.Substring(4, str4.Length - 4); if (str6.Equals("A612")) { MessageManager.ShowMsgBox("作为汉字防伪用户 该单据存在单行商品的商品名称超出范围,不允许拆分!"); } else if (str6.Equals("A613")) { MessageManager.ShowMsgBox("作为汉字防伪用户 该单据存在单行商品的计量单位超出范围,不允许拆分!"); } else if ((str6.Equals("A017") || str6.Equals("A018")) || str6.Equals("A128")) { MessageManager.ShowMsgBox("税率非法,不允许拆分!"); } else if (str6.Equals("A052")) { MessageManager.ShowMsgBox("稀土商品单价和数量为空,不允许拆分!"); } else if (str6.Equals("A024")) { MessageManager.ShowMsgBox("增值税专用发票的购方税号为空,不允许拆分!"); } else if ((((str6.Equals("A631") || str6.Equals("A632")) || (str6.Equals("A633") || str6.Equals("A634"))) || (str6.Equals("A635") || str6.Equals("A636"))) || str6.Equals("A637")) { MessageManager.ShowMsgBox("该单据中购方税号不符合校验规则,系统不允许拆分!"); } else { MessageManager.ShowMsgBox(str6); } } else if (str4.StartsWith("group")) { str6 = str4.Substring(5, str4.Length - 5); MessageManager.ShowMsgBox("第" + str6 + "组折扣商品开票金额超出金税设备允许范围¥" + invAmountLimit.ToString()); } else if (str4.StartsWith("[sql]")) { MessageManager.ShowMsgBox(str4.Substring(5, str4.Length - 5)); } else if (str4.StartsWith("[error]")) { str6 = str4.Substring(7, str4.Length - 7); MessageManager.ShowMsgBox("第" + str6 + "行,金额为0!"); } else if (str4.StartsWith("[error_1_hs]")) { str6 = str4.Substring(12, str4.Length - 12); MessageManager.ShowMsgBox("第" + str6 + "行,单价乘以数量不等于含税金额!"); } else if (str4.StartsWith("[error_1_bhs]")) { str6 = str4.Substring(13, str4.Length - 13); MessageManager.ShowMsgBox("第" + str6 + "行,单价乘以数量不等于金额!"); } else if (str4.StartsWith("[error_2]")) { MessageManager.ShowMsgBox("第" + str4.Substring(9, str4.Length - 9) + "行,商品数据非法!"); } } } } else { MessageManager.ShowMsgBox("INP-272202"); } } } catch (CustomException exception) { MessageBoxHelper.Show(exception.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } catch (Exception exception2) { HandleException.HandleError(exception2); } }
public List <InvTypeEntity> GetInvTypeCollect() { List <InvTypeEntity> list = new List <InvTypeEntity>(); InvTypeEntity item = new InvTypeEntity(); TaxCard card = TaxCardFactory.CreateTaxCard(); if (card.get_QYLX().ISZYFP) { item.m_invType = INV_TYPE.INV_SPECIAL; item.m_strInvName = "增值税专用发票"; list.Add(item); } if (card.get_QYLX().ISPTFP) { item = new InvTypeEntity { m_invType = INV_TYPE.INV_COMMON, m_strInvName = "增值税普通发票" }; list.Add(item); } if (card.get_QYLX().ISHY) { item = new InvTypeEntity { m_invType = INV_TYPE.INV_TRANSPORTATION, m_strInvName = "货物运输业增值税专用发票" }; list.Add(item); } if (card.get_QYLX().ISJDC) { item = new InvTypeEntity { m_invType = INV_TYPE.INV_VEHICLESALES, m_strInvName = "机动车销售统一发票" }; list.Add(item); } if (card.get_QYLX().ISPTFPDZ) { item = new InvTypeEntity { m_invType = INV_TYPE.INV_PTDZ, m_strInvName = "电子增值税普通发票" }; list.Add(item); } if (card.get_QYLX().ISPTFPJSP) { item = new InvTypeEntity { m_invType = INV_TYPE.INV_JSFP, m_strInvName = "增值税普通发票(卷票)" }; list.Add(item); } if (string.IsNullOrEmpty(card.get_SQInfo().DHYBZ)) { item.m_invType = INV_TYPE.INV_SPECIAL; item.m_strInvName = "增值税专用发票"; list.Add(item); item = new InvTypeEntity { m_invType = INV_TYPE.INV_COMMON, m_strInvName = "增值税普通发票" }; list.Add(item); } return(list); }