Exemplo n.º 1
0
        public static Print_QuotationItemsList GetData(string p_id)
        {
            Print_QuotationItemsList list = new Print_QuotationItemsList();
            //
            List <Upvc_Quotationitems> inv_item_list = CUpvc_Quotationitems_exten.FKId(p_id, new DAL());

            for (int r = 0; r <= inv_item_list.Count - 1; r++)
            {
                Print_QuotationitemsRow row = new Print_QuotationitemsRow();
                //
                row.QUOTATION_ITEM_ID = inv_item_list[r].Upvc_Quotationitems_id;
                row.QUOTATION_ID      = inv_item_list[r].Upvc_Quotation_id;
                row.SL_NO             = (r + 1).ToString();
                row.PRODUCT_ID        = inv_item_list[r].Product_id;

                row.HSN_CODE_ID = Ccoreplus.GetHsncode_name(inv_item_list[r].Product_id);

                row.PCRATE  = inv_item_list[r].Pcrate;
                row.MSM     = inv_item_list[r].Msm;
                row.QTY     = ConvertTO.DecimalToS(inv_item_list[r].Qty.ToString());
                row.WIDTHS  = ConvertTO.DecimalToS(inv_item_list[r].Widths.ToString());
                row.HEIGTHS = ConvertTO.DecimalToS(inv_item_list[r].Heights.ToString());
                row.AREASQ  = ConvertTO.DecimalToS(inv_item_list[r].TotalAreasq.ToString());
                row.PRICE   = ConvertTO.DecimalToS(inv_item_list[r].Price.ToString());

                Upvc_invoiceitems obj = new Upvc_invoiceitems()
                {
                    Pcrate       = row.PCRATE,
                    Msm          = row.MSM,
                    Qty          = ConvertTO.Decimal(row.QTY),
                    Widths       = ConvertTO.Decimal(row.WIDTHS),
                    Heights      = ConvertTO.Decimal(row.HEIGTHS),
                    Price        = ConvertTO.Decimal(row.PRICE),
                    Cgst_percent = inv_item_list[r].Cgst_percent,
                    Sgst_percent = inv_item_list[r].Sgst_percent,
                    Igst_percent = inv_item_list[r].Igst_percent
                };

                UpvcCalculation.Calculate(obj);

                row.TAXABLEVALUE = ConvertTO.Decimal2d(obj.Taxable_amount.ToString());

                row.CGST_PERCENT = ConvertTO.DecimalToS(obj.Cgst_percent.ToString());

                row.CGST_AMOUNT = ConvertTO.Decimal2d(obj.Cgst_amount.ToString());

                row.SGST_PERCENT = ConvertTO.DecimalToS(obj.Sgst_percent.ToString());

                row.SGST_AMOUNT = ConvertTO.Decimal2d(obj.Sgst_amount.ToString());

                row.SUB_TOTAL = ConvertTO.Decimal2d((obj.Taxable_amount + obj.Cgst_amount + obj.Sgst_amount + obj.Igst_amount).ToString());

                list.Add(row);
                //
            }
            //
            return(list);
        }
Exemplo n.º 2
0
        public void SetAction(BtnEvent pAction, string pPkValue)
        {
            fAction = pAction;

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

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

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

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

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

            LoadData(obj);
            Loaditems(list);
        }
Exemplo n.º 3
0
        private static Print_QuotationList GetData(string p_id, List <PrintCopies> printcopies)
        {
            Upvc_Quotation quote_obj = CUpvc_Quotation_exten.PKId(p_id, new DAL());

            Print_QuotationList list = new Print_QuotationList();

            for (int i = 0; i < printcopies.Count; i++)
            {
                Print_QuotationRow row = new Print_QuotationRow();

                row.COPIES = printcopies[i].Copies;

                row.QUOTATION_ID = p_id;

                //Company obj = Company.SetCompany(Current.Company_id);
                Company obj = CCompany_exten.PKId(Current.Company_id);

                row.COMPANY_NAME = obj.Display_name.ToUpper();

                row.ADDRESS1 = obj.Street1 + ", " + obj.Street2 + ", " + obj.City_id + " - " + obj.Pincode_id + " , " + obj.State_id + ". State code - 33";

                row.ADDRESS2 = "Email : " + obj.Email + "  www.smsupvc.com ";

                row.COMPANY_GST    = "GSTIN                             :  " + obj.Gstin;
                row.SALES_TYPE     = "Create Quotation     :  " + quote_obj.Salestype_id;
                row.QUOTATION_NO   = "Serial no.of Quotation      :  " + quote_obj.Quotation_no + " / " + CAcy_exten.GetName_Id(quote_obj.Acy_id);
                row.QUOTATION_DATE = "Invoice Date                  :  " + ConvertTO.Date2S(quote_obj.Quotation_date);


                row.TRANSPORT  = "Mode of Transport      :  " + quote_obj.Transport_id;
                row.VEHICLE_NO = "";
                row.PLACE      = "Place of Supply            :  " + Ccoreplus.GetCity_id(quote_obj.Delivered_id);


                row.PARTY_NAME = quote_obj.Party_id;

                Party party_obj = CParty_exten.SearchName(quote_obj.Party_id, new DAL());

                if (party_obj.Party_name != null)
                {
                    row.STREET1 = party_obj.Street_1 + ", " + party_obj.Street_2;
                    row.STREET2 = "";
                    row.CITY    = party_obj.City_id + " - " + party_obj.Pincode_id + " , " + party_obj.State_id + ", State Code -" + Ccoreplus.GetStateCode(party_obj.State_id);
                    row.STATE   = "";
                    row.COUNTRY = party_obj.Country_id;
                    row.PINCODE = "";
                    if (party_obj.Gstin.Trim().Length != 0)
                    {
                        row.GSTIN = "TIN No : " + party_obj.Gstin;
                    }
                    if (party_obj.Gstin.Trim().Length != 0)
                    {
                        row.GSTIN += ",   GSTIN No : " + party_obj.Gstin;
                    }
                }


                row.SHIPPING_NAME = CParty_exten.GetName_Id(quote_obj.Delivered_id);

                Party shipping_obj = CParty_exten.PKId(quote_obj.Delivered_id, new DAL());

                if (shipping_obj.Party_name != null)
                {
                    row.SHIPPING_STREET1 = shipping_obj.Street_1 + ", " + shipping_obj.Street_2;
                    row.SHIPPING_STREET2 = "";
                    row.SHIPPING_CITY    = shipping_obj.City_id + " - " + shipping_obj.Pincode_id + " , " + shipping_obj.State_id + ", State Code -" + Ccoreplus.GetStateCode(shipping_obj.State_id);
                    row.SHIPPING_STATE   = "";
                    row.SHIPPING_COUNTRY = shipping_obj.Country_id;
                    row.SHIPPING_PINCODE = "";
                    if (shipping_obj.Gstin.Trim().Length != 0)
                    {
                        row.SHIPPING_GSTIN += ",   GSTIN No : " + shipping_obj.Gstin;
                    }
                }


                row.TOTAL_QTY = ConvertTO.DecimalToS(quote_obj.Total_qty + "");

                row.TOTAL_AREASQ = ConvertTO.DecimalToS(quote_obj.Total_areasq + "");

                row.TAXABLE_VALUE = ConvertTO.Decimal2d(quote_obj.Total_taxable_amount + "");

                List <Upvc_Quotationitems> klist = CUpvc_Quotationitems_exten.FKId(p_id, new DAL());

                row.LBL_SGST   = "  Add SGST tax @ " + ConvertTO.DecimalToS(klist[0].Sgst_percent.ToString()) + " %";
                row.TOTAL_SGST = ConvertTO.Decimal2d(quote_obj.Total_sgst + "");

                row.LBL_CGST   = "  Add CGST tax @ " + ConvertTO.DecimalToS(klist[0].Cgst_percent.ToString()) + " %";
                row.TOTAL_CGST = ConvertTO.Decimal2d(quote_obj.Total_cgst + "");



                row.TOTAL_SUB = (ConvertTO.Decimal(row.TAXABLE_VALUE) + ConvertTO.Decimal(row.TOTAL_CGST) + ConvertTO.Decimal(row.TOTAL_SGST)).ToString();



                if (quote_obj.Ledger_id != null)
                {
                    if (quote_obj.Ledger_id.Trim() != "")
                    {
                        row.LEDGER     = "  " + quote_obj.Ledger_id;
                        row.ADDITIONAL = quote_obj.Additional + "";
                    }
                    else
                    {
                        row.LEDGER     = "";
                        row.ADDITIONAL = "";
                    }
                }
                row.ROUNDS     = quote_obj.Rounds + "";
                row.GSTTOTAL   = quote_obj.Gsttotal + "";
                row.GRANDTOTAL = quote_obj.Grandtotal + "";

                if (quote_obj.Notes != null)
                {
                    if (quote_obj.Notes.Trim().Length != 0)
                    {
                        row.NOTES = "Notes :  " + quote_obj.Notes;
                    }
                }
                row.AMOUNT_IN_WORDS = "Rupees   : " + Global.AmountInWords(Convert.ToDecimal(quote_obj.Grandtotal));
                row.ENTRY_BY        = quote_obj.User_id;

                list.Add(row);
            }

            return(list);
        }