Example #1
0
        public Form_SelectPanels(usrc_InvoiceMan x_usrc_InvoiceMan)
        {
            InitializeComponent();
            rdb_Items.Checked = false;
            rdb_ItemsAndDoc.Checked = false;
            rdb_Doc.Checked = false;
            m_usrc_InvoiceMan = x_usrc_InvoiceMan;
            if (m_usrc_InvoiceMan.Mode == usrc_InvoiceMan.eMode.Shops)
            {
                rdb_Items.Checked = true;
            }
            else if (m_usrc_InvoiceMan.Mode == usrc_InvoiceMan.eMode.Shops_and_InvoiceTable)
            {
                rdb_ItemsAndDoc.Checked = true;
            }
            else if (m_usrc_InvoiceMan.Mode == usrc_InvoiceMan.eMode.InvoiceTable)
            {
                rdb_Doc.Checked = true;
            }
            else
            {
                LogFile.Error.Show("ERROR:Form_SelectPanels:m_usrc_InvoiceMan.Mode illegal Mode!");
            }

            this.rdb_Doc.CheckedChanged += new System.EventHandler(this.rdb_Doc_CheckedChanged);
            this.rdb_ItemsAndDoc.CheckedChanged += new System.EventHandler(this.rdb_ItemsAndDoc_CheckedChanged);
            this.rdb_Items.CheckedChanged += new System.EventHandler(this.rdb_Items_CheckedChanged);
        }
Example #2
0
        public Form_NewDocument(usrc_InvoiceMan xusrc_InvoiceMan)
        {
            InitializeComponent();
            m_usrc_InvoiceMan = xusrc_InvoiceMan;
            string sdraft = "";
            string sNumber = m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.FinancialYear.ToString() + "-" + m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.NumberInFinancialYear.ToString();
            string sInvoiceNumber = null;
            int ItemsCount = m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.ItemsCount(m_usrc_InvoiceMan.DocInvoice);
            if (m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.bDraft)
            {
                sdraft = lngRPM.s_Draft.s;
                sInvoiceNumber = "(" + sdraft + " št.:" + m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.FinancialYear.ToString() + "-"+ m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.DraftNumber.ToString()
                                   + " " + lngRPM.s_Total.s + " = " + m_usrc_InvoiceMan.m_usrc_Invoice.lbl_Sum.Text + ")";
            }
            else
            {
                sInvoiceNumber = "(" + sdraft + " št.:" + m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.FinancialYear.ToString() + "-" + m_usrc_InvoiceMan.m_usrc_Invoice.m_ShopABC.m_CurrentInvoice.NumberInFinancialYear.ToString()
                +" " +lngRPM.s_Total.s + " = " + m_usrc_InvoiceMan.m_usrc_Invoice.lbl_Sum.Text + ")";
            }

            if (m_usrc_InvoiceMan.IsDocInvoice)
            {
                lngRPM.s_New_Empty_Invoice.Text(this.btn_New_Empty);
                lngRPM.s_New_Copy_ThisInvoice_ToNewOne.Text(this.btn_New_Copy_Of_SameDocType);
                lngRPM.s_New_Copy_ThisInvoice_ToNewProformaInvoice.Text(this.btn_New_Copy_To_Another_DocType);
            }
            else if (m_usrc_InvoiceMan.IsDocProformaInvoice)
            {
                lngRPM.s_New_Empty_ProformaInvoice.Text(this.btn_New_Empty);
                lngRPM.s_New_Copy_ThisProformaInvoice_ToNewOne.Text(this.btn_New_Copy_Of_SameDocType);
                lngRPM.s_New_Copy_ThisProformaInvoice_ToInvoice.Text(this.btn_New_Copy_To_Another_DocType);
            }
            else
            {
                LogFile.Error.Show("ERROR:Tangenta:Form_NewDocument.cs:Form_NewDocument: Unknown DocInvoice type!");
            }
            if (ItemsCount == 0 )
            {
                btn_New_Copy_Of_SameDocType.Visible = false;
                btn_New_Copy_To_Another_DocType.Visible = false;
            }
            else
            {
                btn_New_Copy_Of_SameDocType.Text = btn_New_Copy_Of_SameDocType.Text.Replace("%s", sInvoiceNumber);
                btn_New_Copy_To_Another_DocType.Text = btn_New_Copy_To_Another_DocType.Text.Replace("%s", sInvoiceNumber);
            }
        }