예제 #1
0
        private int Invoice()
        {
            iCurrentItemId = -1;

            if (gridView1.SelectedRowsCount > 0)
            {
                iCurrentItemId = gridView1.FocusedRowHandle;

                DataRow row = gridView1.GetDataRow(iCurrentItemId);

                iCurrentBseqId = Convert.ToString(row["BSEQID"]);

                if (InvoiceBill(iCurrentBseqId, "0") == -1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }

                if (InvoiceBillHeader(iCurrentItemId) == -1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                if (InvoiceBillDetail(iCurrentItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                //接口开具发票,不成功作废后台明细
                if (frmMain.oComTaxCard.InvoiceBill() == 1)
                {
                    MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                    if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                    return(1);
                }
                else
                {
                    if (chkPrint.Checked)
                    {
                        frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                     frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                        if (frmMain.oComTaxCard.iResult == 1)
                        {
                            MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                            return(1);
                        }
                        if (PublicUtility.PrintBill(sCurrentInvSeqId) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }
                    }
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }
예제 #2
0
        //调用税控开票
        private int Invoice()
        {
            if (gridView2.SelectedRowsCount == 0)
            {
                MessageBox.Show("没有选择开票明细,请先选中开票明细后重试!"); return(1);
            }

            string sInvTypeId = cbbInvType.EditValue.ToString();

            if (sInvTypeId == "2")
            {
                frmMain.oComTaxCard.iInvType = 2;
            }
            if (sInvTypeId == "1")
            {
                frmMain.oComTaxCard.iInvType = 0;
            }

            if (InvoiceBill() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }

            if (InvoiceBillHeader() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            if (InvoiceBillDetail() == 1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            //接口开具发票,不成功作废后台明细
            if (chkNoBill.Checked == false)
            {
                if (frmMain.oComTaxCard.InvoiceBill() == 1)
                {
                    MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                    if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                    {
                        MessageBox.Show(sRetMsg);
                    }
                    return(1);
                }
                else
                {
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }

                    if (chkPrint.Checked)
                    {
                        frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                     frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                    }
                }
            }
            return(0);
        }
예제 #3
0
        private int InvoiceTaxBill(int iInvSeqId)
        {
            if (InvoiceBillDetail(iInvSeqId) == 1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            if (frmMain.oComTaxCard.InvoiceBill() == 1)
            {
                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                if (PublicUtility.InvoiceCanceled(iInvSeqId.ToString()) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg); return(1);
                }
                return(1);
            }
            else
            {
                if (chkPrint.Checked)
                {
                    short iInfoShowPrtDlg = 0;
                    if (chkShowPrint.Checked)
                    {
                        iInfoShowPrtDlg = 1;
                    }

                    frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                 frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, iInfoShowPrtDlg);
                    if (frmMain.oComTaxCard.iResult == 1)
                    {
                        MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                        return(1);
                    }
                    if (PublicUtility.PrintBill(iInvSeqId.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
                if (PublicUtility.InvoiceValidated(iInvSeqId.ToString(), frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg); return(1);
                }
            }
            return(0);
        }
예제 #4
0
        //调用税控开票
        private int Invoice()
        {
            if (InvoiceBill() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }

            if (InvoiceBillHeader() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            if (InvoiceBillDetail() == 1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            //接口开具发票,不成功作废后台明细
            if (chkNoBill.Checked == false)
            {
                if (frmMain.oComTaxCard.InvoiceBill() == 1)
                {
                    MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                    if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                    {
                        MessageBox.Show(sRetMsg);
                    }
                    return(1);
                }
                else
                {
                    if (chkPrint.Checked)
                    {
                        frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                     frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                    }
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }
예제 #5
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            int   iResult        = 0;
            int   iMyRetrun      = 0;
            short iInfoKind      = 0;
            int   iCurrentItemId = gridView1.FocusedRowHandle;

            DataRow row = gridView1.GetDataRow(iCurrentItemId);

            string iCurrentBseqId = Convert.ToString(row["INVSEQID"]);

            if (cbbInvType.SelectedValue.ToString() == "1")
            {
                iInfoKind = 0;
            }
            else
            {
                iInfoKind = 2;
            }

            iResult = frmMain.oComTaxCard.InvCancel(iInfoKind, Convert.ToInt32(row["INVOICENO"]), Convert.ToString(row["INVOICECODE"]));
            if (iResult == 1)
            {
                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
            }
            else
            {
                if (PublicUtility.InvoiceCanceled(iCurrentBseqId) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg);
                }
                if (PublicUtility.InvoiceCanceledSK(iCurrentBseqId) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg);
                }
            }
            GetData();
        }
예제 #6
0
        private int Invoice(int iItemId)
        {
            if (iItemId != -1)
            {
                //iCurrentItemId = gridView1.FocusedRowHandle;
                //iCurrentItemId = iItemId;

                DataRow row = gridView1.GetDataRow(iItemId);

                //iCurrentCustId = Convert.ToString(row["BSEQID"]);
                //后台生成发票明细
                if (InvoiceBill(iItemId) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg); return(1);
                }

                if (InvoiceBillHeader(iItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                if (InvoiceBillDetail(iItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }

                //if (int.Parse(cbbInvType.SelectedValue.ToString()) == 2) frmMain.oComTaxCard.iInvType = 2;
                //if (int.Parse(cbbInvType.SelectedValue.ToString()) == 1) frmMain.oComTaxCard.iInvType = 0;
                if (Convert.ToString(row["INVTYPEID"]) == "2")
                {
                    frmMain.oComTaxCard.iInvType = 2;
                }
                if (Convert.ToString(row["INVTYPEID"]) == "1")
                {
                    frmMain.oComTaxCard.iInvType = 0;
                }

                short iInfoShowPrtDlg = 0;
                if (chkShowPrint.Checked)
                {
                    iInfoShowPrtDlg = 1;
                }

                if (!chkEnable.Checked)
                {
                    //接口开具发票,不成功作废后台明细
                    if (frmMain.oComTaxCard.InvoiceBill() == 1)
                    {
                        MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                        if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }
                        return(1);
                    }
                    else
                    {
                        if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }

                        if (chkPrint.Checked)
                        {
                            frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                         frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, iInfoShowPrtDlg);
                            if (frmMain.oComTaxCard.iResult == 1)
                            {
                                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                                return(1);
                            }
                            if (PublicUtility.PrintBill(sCurrentInvSeqId) == -1)
                            {
                                MessageBox.Show(frmMain.sRetMsg); return(1);
                            }
                        }
                        //{ MessageBox.Show(frmMain.oComTaxCard.sRetMsg); return 1; }
                    }
                }
                else
                {
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, "111", "111") == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }
예제 #7
0
        private int Invoice(int iItemId)
        {
            if (iItemId != -1)
            {
                DataRow row = gridView1.GetDataRow(iItemId);

                iCurrentBseqId  = Convert.ToString(row["BSEQID"]);
                iCurrentTaxRate = int.Parse(Convert.ToString(row["TAXRATE"]));

                if (InvoiceBill(iCurrentBseqId, iCurrentTaxRate, "0") == -1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }

                if (InvoiceBillHeader(iItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                if (InvoiceBillDetail(iItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }

                if (Convert.ToString(row["INVTYPEID"]) == "2")
                {
                    frmMain.oComTaxCard.iInvType = 2;
                }
                if (Convert.ToString(row["INVTYPEID"]) == "1")
                {
                    frmMain.oComTaxCard.iInvType = 0;
                }

                if (chkShowPrint.Checked)
                {
                    frmMain.oComTaxCard.iInfoShowPrtDlg = 1;
                }
                else
                {
                    frmMain.oComTaxCard.iInfoShowPrtDlg = 0;
                }

                if (!chkEnable.Checked)
                {
                    if (frmMain.oComTaxCard.InvoiceBill() == 1)
                    {
                        MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                        if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                        {
                            MessageBox.Show(sRetMsg);
                        }
                        return(1);
                    }
                    else
                    {
                        if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }
                        if (chkPrint.Checked)
                        {
                            frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                         frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                            if (frmMain.oComTaxCard.iResult == 1)
                            {
                                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                                return(1);
                            }
                            if (PublicUtility.PrintBill(sCurrentInvSeqId) == -1)
                            {
                                MessageBox.Show(frmMain.sRetMsg); return(1);
                            }
                        }

                        //frmMain.refreshInfo();
                    }
                }
                else
                {
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, "000", "000") == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }