/// <summary> /// 打印财政发票 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int rowHandle = gridView1.FocusedRowHandle; if (rowHandle >= 0) { if (gridView1.GetRowCellValue(rowHandle, "FA190").ToString().Substring(0, 1) == "1") { string s_fa001 = gridView1.GetRowCellValue(rowHandle, "FA001").ToString(); //如果是新接口上线前开具的发票,不能打印 if (MiscAction.FinRefundBeforeOnline(s_fa001)) { XtraMessageBox.Show("此笔收费财政发票为新接口上线前开具,不能通过新接口打印!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); return; } OracleDataReader reader = SqlAssist.ExecuteReader("select INVOICENO,INVOICEZCH from fin_log where settleId ='" + s_fa001 + "'"); if (reader.HasRows && reader.Read()) { string s_batch_code = reader["INVOICEZCH"].ToString(); string s_billno = reader["INVOICENO"].ToString(); reader.Dispose(); if (XtraMessageBox.Show("打印财政发票?\r\n" + "注册号:" + s_batch_code + "\r\n" + "发票号:" + s_billno, "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FinInvoice.PrintInvoice(s_batch_code, s_billno); } } } else { XtraMessageBox.Show("当前收费记录未开财政发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
/// <summary> /// 补开财政退费发票 /// </summary> /// <param name="fa001"></param> private void ReInvoiceFinRefund(string fa001) { //如果是新版接口上线前开具的原发票 if (MiscAction.FinRefundBeforeOnline(fa001)) { XtraMessageBox.Show("原发票在财政新接口上线前开具,不能开具对应退费发票,请在财政发票系统内完成发票开具.\r\n 开具成功后请更新发票号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (FinInvoice.GetCurrentPh() > 0) { if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FinInvoice.Refund(fa001); } } }
/// <summary> /// 收款作废 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bBi_remove_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (tabPane1.SelectedPageIndex == 0) //按笔数显示 { int rowHandle = gridView1.FocusedRowHandle; if (rowHandle >= 0) { string s_handler = gridView1.GetRowCellValue(rowHandle, "FA100").ToString(); if (!AppAction.CheckRight("收费作废", s_handler)) { return; } string s_reason = string.Empty; string s_rc001 = gridView1.GetRowCellValue(rowHandle, "AC001").ToString(); string s_fa001 = gridView1.GetRowCellValue(rowHandle, "FA001").ToString(); string s_fa190 = gridView1.GetRowCellValue(rowHandle, "FA190").ToString(); if (XtraMessageBox.Show("确认要作废吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } Frm_RemoveFinReason frm_reason = new Frm_RemoveFinReason(); if (frm_reason.ShowDialog() == DialogResult.OK) { s_reason = frm_reason.swapdata["reason"].ToString(); } frm_reason.Dispose(); if (gridView1.GetRowCellValue(rowHandle, "FA002").ToString() == "2") //寄存业务 { decimal count = (decimal)SqlAssist.ExecuteScalar("select count(*) from v_rc04 where rc001='" + s_rc001 + "'", null); if (count <= 1) { if (XtraMessageBox.Show("此记录是唯一一次交费记录,作废此记录将删除寄存登记信息,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } } } int re = MiscAction.FinanceRemove(s_fa001, s_reason, Envior.cur_userId); ///作废成功,开始作废发票 if (re > 0) { this.RefreshData(); XtraMessageBox.Show("收费作废成功!如果本次收费已开具发票,点击【确定】开始作废已开具发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); ///作废财政发票 if (s_fa190.Substring(0, 1) == "1") { //如果不在新接口上线前,则可以作废发票 if (!MiscAction.FinRefundBeforeOnline(s_fa001)) { if (FinInvoice.InvoiceRemoved(s_fa001) > 0) { MiscAction.FinRemove_log(s_fa001, Envior.cur_userName, s_reason); } } else { XtraMessageBox.Show("此笔收费为新财政发票接口上线前开具,发票需要在系统外进行作废!详情请与管理员联系!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } ///作废税务发票 if (s_fa190.Substring(1, 1) == "1") { if (TaxInvoice.Remove(s_fa001, Envior.cur_userName) > 0) //发票作废成功 { //修改发票作废日志 MiscAction.TaxRemove_log(s_fa001, Envior.cur_userName, s_reason); } else { XtraMessageBox.Show("未能作废税务发票,请在【税神通】中作废指定票据!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } } else //发票作废 !!!! { int rowHandle = gridView1.FocusedRowHandle; string s_fa001 = gridView3.GetRowCellValue(rowHandle, "FA001").ToString(); string s_billType = gridView3.GetRowCellValue(rowHandle, "BILLTYPE").ToString(); if (s_billType == "F") //财政发票作废 { } else if (s_billType == "T") { } } } catch (Exception ee) { XtraMessageBox.Show(ee.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void b_ok_Click(object sender, EventArgs e) { if (rc001 == null) { XtraMessageBox.Show("数据传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (txtEdit_oc003.EditValue == null || txtEdit_oc003.EditValue is System.DBNull) { txtEdit_oc003.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight; txtEdit_oc003.ErrorText = "请输入迁出办理人!"; return; } if (mem_oc005.EditValue == null) { mem_oc005.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight; mem_oc005.ErrorText = "请输入迁出原因!"; return; } string s_oc003 = txtEdit_oc003.Text; //迁出人 string s_oc005 = mem_oc005.Text; //迁出原因 string s_oc004 = txtEdit_oc004.Text; //迁出人身份证号 int diff = int.Parse(txtEdit_diff.EditValue.ToString()); decimal nums = decimal.Zero; string fa001 = Tools.GetEntityPK("FA01"); string last_fa001 = RegisterAction.GetREGLastSettleId(rc001); //获取最后一次缴费 结算流水号 //补退情况 if (checkEdit1.Checked) { nums = decimal.Parse(txtEdit_nums.Text); } else { nums = 0; } if (XtraMessageBox.Show("确认要继续办理迁出吗?本业务将不能回退!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } if (checkEdit1.Checked && Math.Abs(regfee) > 0) { if (XtraMessageBox.Show("迁出需要补退费" + regfee.ToString("##,##0.00") + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } } if ((!string.IsNullOrEmpty(txtEdit_fee.Text)) && Convert.ToDecimal(txtEdit_fee.Text) > 0 && Envior.cur_userId != AppInfo.ROOTID && !isrefund) { XtraMessageBox.Show("当前记录已经欠费,不能迁出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } int re = RegisterAction.RegisterOut(rc001, s_oc003, s_oc004, s_oc005, diff, fa001, price, isrefund ? 0 - nums : nums, isrefund ? 0 - Math.Abs(regfee) : Math.Abs(regfee), Envior.cur_userId ); if (re > 0) { //保存迁出人信息 if (IDC_FLAG) { ic01_dao.Insert(ic01); ///更新身份证照片 if (ic01 != null) { FileStream file = new FileStream("zp.bmp", FileMode.Open, FileAccess.Read); Byte[] imgByte = new Byte[file.Length]; //把图片转成 Byte型 二进制流 file.Read(imgByte, 0, imgByte.Length); //把二进制流读入缓冲区 file.Close(); MiscAction.Update_IDC_Photo(ic01.ic001, imgByte); } } XtraMessageBox.Show("迁出办理成功!现在打印【迁出通知单】", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); PrtServAction.PrtRegisterOutNotice(rc001, this.Handle.ToInt32()); if (!isrefund && nums > 0) { if (XtraMessageBox.Show("现在开具【发票】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { if (FinInvoice.GetCurrentPh() > 0) { if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FinInvoice.Invoice(fa001); } } } } else if (isrefund && Math.Abs(nums) > 0) //退费发票 { //如果是新版接口上线前开具的原发票 if (MiscAction.FinRefundBeforeOnline(fa001)) { XtraMessageBox.Show("原发票在财政新接口上线前开具,不能开具对应退费发票,请在财政发票系统内完成发票开具.\r\n 开具成功后请更新发票号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (FinInvoice.GetCurrentPh() > 0) { if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FinInvoice.Refund(fa001); } } } } DialogResult = DialogResult.OK; this.Close(); }