Beispiel #1
0
        private List <PUpvcSales> CollectSales(string id)
        {
            List <PUpvcSales> list = new List <PUpvcSales>();

            CXCORE.Company company = CXCORE.CCompany_exten.PKId(Current.Company_id);

            Upvc_invoice invoice = CUpvc_invoice_exten.PKId(id, new DAL());

            CXCORE.Party party     = CXCORE.CParty_exten.PKId(invoice.Party_id, new DAL());
            CXCORE.Party consignee = CXCORE.CParty_exten.PKId(invoice.Party_id, new DAL());

            PUpvcSales obj = new PUpvcSales()
            {
                Company_name      = company.Company_name,
                Company_address   = company.Street1 + "" + company.Street2 + "" + company.City_id + "" + company.State_id + " ",
                Company_address_1 = company.Email + "" + company.Website,
                Company_gstin     = company.Gstin + "" + company.Cell1,

                Invoice_no   = invoice.Invoice_no,
                Invoice_date = invoice.Invoice_date,
                billtobill   = invoice.Taxtype_id,

                Sales_type    = invoice.Salestype_id,
                PlaceOfSupply = invoice.Delivered_id,

                Party_name     = party.Party_name,
                Party_adress   = party.Street_1 + "" + party.Street_2,
                Party_adress_1 = party.City_id + "" + party.Pincode_id,
                Party_gstin    = party.Gstin,

                Consignee_name      = consignee.Party_name,
                Consignee_address   = consignee.Street_1 + "" + consignee.Street_2,
                Consignee_address_1 = consignee.City_id + "" + consignee.Pincode_id,
                Consignee_gstin     = consignee.Gstin,

                Transport = invoice.Transport_id,

                Taxable_value = invoice.Total_taxable_amount.ToString(),
                Cgst_tax      = invoice.Total_cgst.ToString(),
                Sgst_tax      = invoice.Total_sgst.ToString(),
                Gst_total     = invoice.Gsttotal.ToString(),

                Roundoff = invoice.Rounds.ToString(),

                GrandTotal    = invoice.Grandtotal.ToString(),
                Amountinwords = Global.AmountInWords(invoice.Grandtotal),
            };

            list.Add(obj);

            return(list);
        }
Beispiel #2
0
        public void SetAction(BtnEvent pAction, string pPkValue)
        {
            fAction = pAction;

            switch (fAction)
            {
            case BtnEvent.Open:
                btn_save.Text = "&CLOSE";
                obj           = CUpvc_invoice_exten.PKId(pPkValue, new DAL());
                list          = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL());
                this.EnableControls(false);
                break;

            case BtnEvent.New:
                btn_save.Text = "&SAVE";
                obj           = CUpvc_invoice.GetNew();
                list          = new List <Upvc_invoiceitems>();
                this.EnableControls(true);
                break;

            case BtnEvent.Edit:
                btn_save.Text = "&UPDATE";
                obj           = CUpvc_invoice_exten.PKId(pPkValue, new DAL());
                list          = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL());
                this.EnableControls(true);
                break;

            case BtnEvent.Delete:
                btn_save.Text = "CONFIRM\r\n&DELETE";
                obj           = CUpvc_invoice_exten.PKId(pPkValue, new DAL());
                list          = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL());
                this.EnableControls(false);
                break;

            case BtnEvent.Print:
                btn_save.Text = "&PRINT";
                obj           = CUpvc_invoice_exten.PKId(pPkValue, new DAL());
                list          = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL());
                this.EnableControls(false);
                print_panel.Show();
                break;
            }

            LoadData(obj);
            Loaditems(list);
        }