Beispiel #1
0
 private static string AttachParams(string q, Upvc_Quotation v)
 {
     q = q.Replace("@" + UPVC_QUOTATION.UPVC_QUOTATION_ID + "@", "" + ConvertTO.SqlString(v.Upvc_Quotation_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.UNIQUENO + "@", "" + ConvertTO.SqlString(v.Uniqueno) + "");
     q = q.Replace("@" + UPVC_QUOTATION.COMPANY_ID + "@", "" + ConvertTO.SqlString(v.Company_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.ACY_ID + "@", "" + ConvertTO.SqlString(v.Acy_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.TAXTYPE_ID + "@", "" + ConvertTO.SqlString(v.Taxtype_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.SALESTYPE_ID + "@", "" + ConvertTO.SqlString(v.Salestype_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.QUOTATION_NO + "@", "" + ConvertTO.SqlString(v.Quotation_no) + "");
     q = q.Replace("@" + UPVC_QUOTATION.QUOTATION_DATE + "@", "" + ConvertTO.SqlDate(v.Quotation_date) + "");
     q = q.Replace("@" + UPVC_QUOTATION.PARTY_ID + "@", "" + ConvertTO.SqlString(v.Party_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.DELIVEREDTO_ID + "@", "" + ConvertTO.SqlString(v.Delivered_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.TRANSPORT_ID + "@", "" + ConvertTO.SqlString(v.Transport_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.VEHICLE_NO + "@", "" + ConvertTO.SqlString(v.Vehicle_no) + "");
     q = q.Replace("@" + UPVC_QUOTATION.TOTAL_QTY + "@", "" + ConvertTO.SqlString(v.Total_qty + ""));
     q = q.Replace("@" + UPVC_QUOTATION.TOTAL_AREASQ + "@", "" + ConvertTO.SqlString(v.Total_areasq + ""));
     q = q.Replace("@" + UPVC_QUOTATION.TOTAL_TAXABLE_AMOUNT + "@", "" + ConvertTO.SqlString(v.Total_taxable_amount + ""));
     q = q.Replace("@" + UPVC_QUOTATION.TOTAL_CGST + "@", "" + ConvertTO.SqlString(v.Total_cgst + ""));
     q = q.Replace("@" + UPVC_QUOTATION.TOTAL_SGST + "@", "" + ConvertTO.SqlString(v.Total_sgst + ""));
     q = q.Replace("@" + UPVC_QUOTATION.TOTAL_IGST + "@", "" + ConvertTO.SqlString(v.Total_igst + ""));
     q = q.Replace("@" + UPVC_QUOTATION.GSTTOTAL + "@", "" + ConvertTO.SqlString(v.Gsttotal + ""));
     q = q.Replace("@" + UPVC_QUOTATION.LEDGER_ID + "@", "" + ConvertTO.SqlString(v.Ledger_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.ADDITIONAL + "@", "" + ConvertTO.SqlString(v.Additional + ""));
     q = q.Replace("@" + UPVC_QUOTATION.ROUNDS + "@", "" + ConvertTO.SqlString(v.Rounds + ""));
     q = q.Replace("@" + UPVC_QUOTATION.GRANDTOTAL + "@", "" + ConvertTO.SqlString(v.Grandtotal + ""));
     q = q.Replace("@" + UPVC_QUOTATION.REFERED_NO + "@", "" + ConvertTO.SqlString(v.Refered_no + ""));
     q = q.Replace("@" + UPVC_QUOTATION.LOCKED + "@", "" + ConvertTO.SqlString(v.Locked) + "");
     q = q.Replace("@" + UPVC_QUOTATION.NOTES + "@", "" + ConvertTO.SqlString(v.Notes) + "");
     q = q.Replace("@" + UPVC_QUOTATION.ACTIVE_ID + "@", "" + ConvertTO.SqlString(v.Active_id) + "");
     q = q.Replace("@" + UPVC_QUOTATION.USER_ID + "@", "" + ConvertTO.SqlString(v.User_id) + "");
     return(q);
 }
Beispiel #2
0
        public static void Update(Upvc_Quotation v, DAL dalsession)
        {
            string q = "UPDATE " + UPVC_QUOTATION.UPVC_QUOTATION_TBL + " SET";

            q += " " + UPVC_QUOTATION.UNIQUENO + " = @" + UPVC_QUOTATION.UNIQUENO + "@ \r\n ";
            q += "," + UPVC_QUOTATION.COMPANY_ID + " = @" + UPVC_QUOTATION.COMPANY_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.ACY_ID + " = @" + UPVC_QUOTATION.ACY_ID + "@ \r\n";
            q += "," + UPVC_QUOTATION.TAXTYPE_ID + " = @" + UPVC_QUOTATION.TAXTYPE_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.SALESTYPE_ID + " = @" + UPVC_QUOTATION.SALESTYPE_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.QUOTATION_NO + " = @" + UPVC_QUOTATION.QUOTATION_NO + "@ \r\n ";
            q += "," + UPVC_QUOTATION.QUOTATION_DATE + " = @" + UPVC_QUOTATION.QUOTATION_DATE + "@ \r\n ";
            q += "," + UPVC_QUOTATION.PARTY_ID + " = @" + UPVC_QUOTATION.PARTY_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.DELIVEREDTO_ID + " = @" + UPVC_QUOTATION.DELIVEREDTO_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TRANSPORT_ID + " = @" + UPVC_QUOTATION.TRANSPORT_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.VEHICLE_NO + " = @" + UPVC_QUOTATION.VEHICLE_NO + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TOTAL_QTY + " = @" + UPVC_QUOTATION.TOTAL_QTY + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TOTAL_AREASQ + " = @" + UPVC_QUOTATION.TOTAL_AREASQ + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TOTAL_TAXABLE_AMOUNT + " = @" + UPVC_QUOTATION.TOTAL_TAXABLE_AMOUNT + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TOTAL_CGST + " = @" + UPVC_QUOTATION.TOTAL_CGST + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TOTAL_SGST + " = @" + UPVC_QUOTATION.TOTAL_SGST + "@ \r\n ";
            q += "," + UPVC_QUOTATION.TOTAL_IGST + " = @" + UPVC_QUOTATION.TOTAL_IGST + "@ \r\n ";
            q += "," + UPVC_QUOTATION.GSTTOTAL + " = @" + UPVC_QUOTATION.GSTTOTAL + "@ \r\n ";
            q += "," + UPVC_QUOTATION.LEDGER_ID + " = @" + UPVC_QUOTATION.LEDGER_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.ADDITIONAL + " = @" + UPVC_QUOTATION.ADDITIONAL + "@ \r\n ";
            q += "," + UPVC_QUOTATION.ROUNDS + " = @" + UPVC_QUOTATION.ROUNDS + "@ \r\n ";
            q += "," + UPVC_QUOTATION.GRANDTOTAL + " = @" + UPVC_QUOTATION.GRANDTOTAL + "@ \r\n ";
            q += "," + UPVC_QUOTATION.REFERED_NO + " = @" + UPVC_QUOTATION.REFERED_NO + "@ \r\n ";
            q += "," + UPVC_QUOTATION.LOCKED + " = @" + UPVC_QUOTATION.LOCKED + "@ \r\n ";
            q += "," + UPVC_QUOTATION.NOTES + " = @" + UPVC_QUOTATION.NOTES + "@ \r\n ";
            q += "," + UPVC_QUOTATION.ACTIVE_ID + " = @" + UPVC_QUOTATION.ACTIVE_ID + "@ \r\n ";
            q += "," + UPVC_QUOTATION.USER_ID + " = @" + UPVC_QUOTATION.USER_ID + "@ \r\n ";
            q += "  WHERE " + UPVC_QUOTATION.UPVC_QUOTATION_ID + " = @" + UPVC_QUOTATION.UPVC_QUOTATION_ID + "@ ";
            q  = AttachParams(q, v);
            dalsession.Execute(q);
        }
Beispiel #3
0
        public static string GetName_Id(string Id)
        {
            Upvc_Quotation obj = PKId(Id, new DAL());

            if (obj != null)
            {
                return(obj.Quotation_no);
            }
            return("");
        }
Beispiel #4
0
 public static bool LockStatus(string pkValue)
 {
     if (pkValue != null)
     {
         Upvc_Quotation obj = PKId(pkValue, new DAL());
         if (obj.Locked == Core.Unlocked)
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #5
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);
        }
Beispiel #6
0
        private static List <Upvc_Quotation> EntityList(string q)
        {
            List <Upvc_Quotation> list = new List <Upvc_Quotation>();

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    Upvc_Quotation obj = new Upvc_Quotation()
                    {
                        Upvc_Quotation_id    = redr[UPVC_QUOTATION.UPVC_QUOTATION_ID].ToString(),
                        Taxtype_id           = redr[TAXTYPE.TAXTYPE_ID].ToString(),
                        Salestype_id         = redr[SALESTYPE.SALESTYPE_NAME].ToString(),
                        Quotation_no         = redr[UPVC_QUOTATION.QUOTATION_NO].ToString(),
                        Quotation_date       = redr[UPVC_QUOTATION.QUOTATION_DATE].ToString(),
                        Party_id             = redr[PARTY.PARTY_NAME].ToString(),
                        Delivered_id         = redr[UPVC_QUOTATION.DELIVEREDTO_ID].ToString(),
                        Transport_id         = redr[TRANSPORT.TRANSPORT_NAME].ToString(),
                        Vehicle_no           = redr[UPVC_QUOTATION.VEHICLE_NO].ToString(),
                        Total_qty            = ConvertTO.Decimal(redr[UPVC_QUOTATION.TOTAL_QTY].ToString()),
                        Total_areasq         = ConvertTO.Decimal(redr[UPVC_QUOTATION.TOTAL_AREASQ].ToString()),
                        Total_taxable_amount = ConvertTO.Decimal(redr[UPVC_QUOTATION.TOTAL_TAXABLE_AMOUNT].ToString()),
                        Total_cgst           = ConvertTO.Decimal(redr[UPVC_QUOTATION.TOTAL_CGST].ToString()),
                        Total_sgst           = ConvertTO.Decimal(redr[UPVC_QUOTATION.TOTAL_SGST].ToString()),
                        Total_igst           = ConvertTO.Decimal(redr[UPVC_QUOTATION.TOTAL_IGST].ToString()),
                        Gsttotal             = ConvertTO.Decimal(redr[UPVC_QUOTATION.GSTTOTAL].ToString()),
                        Ledger_id            = redr[UPVC_QUOTATION.LEDGER_ID].ToString(),
                        Additional           = ConvertTO.Decimal(redr[UPVC_QUOTATION.ADDITIONAL].ToString()),
                        Rounds     = ConvertTO.Decimal(redr[UPVC_QUOTATION.ROUNDS].ToString()),
                        Grandtotal = ConvertTO.Decimal(redr[UPVC_QUOTATION.GRANDTOTAL].ToString()),
                        Refered_no = ConvertTO.Decimal(redr[UPVC_QUOTATION.REFERED_NO].ToString()),
                        Locked     = redr[UPVC_QUOTATION.LOCKED].ToString(),
                        Notes      = redr[UPVC_QUOTATION.NOTES].ToString(),
                        Active_id  = redr[UPVC_QUOTATION.ACTIVE_ID].ToString(),
                        User_id    = redr[USER.USER_NAME].ToString()
                    };

                    list.Add(obj);
                }

                redr.Close();
            }
            return(list);
        }
Beispiel #7
0
        private void LoadData(Upvc_Quotation obj)
        {
            vId          = obj.Upvc_Quotation_id;
            Core.TaxType = obj.Taxtype_id;
            SetTaxtype();

            txt_taxtype_id.Text   = obj.Taxtype_id;
            txt_salestype_id.Text = obj.Salestype_id;
            txt_invoice_no.Text   = obj.Quotation_no;
            txt_invoice_date.Text = obj.Quotation_date;
            txt_party_id.Text     = obj.Party_id;
            txt_Delivered_id.Text = CParty_exten.GetName_Id(obj.Delivered_id);
            txt_transport_id.Text = obj.Transport_id;
            txt_vehicle_no.Text   = obj.Vehicle_no;
            txt_total_qty.Text    = obj.Total_qty.ToString();
            txt_gsttotal.Text     = obj.Gsttotal.ToString();
            txt_ledger_id.Text    = obj.Ledger_id;
            txt_additional.Text   = obj.Additional.ToString();
            txt_grandtotal.Text   = obj.Grandtotal.ToString();
            txt_notes.Text        = obj.Notes;
            Core.Stative          = obj.Active_id;
            Setactives();
        }
Beispiel #8
0
        public static Upvc_Quotation GetNew()
        {
            Upvc_Quotation obj = new Upvc_Quotation
            {
                Upvc_Quotation_id    = string.Empty,
                Uniqueno             = string.Empty,
                Company_id           = Current.Company_id,
                Acy_id               = Current.Acy_id,
                Taxtype_id           = Core.SGST,
                Salestype_id         = Core.B2B,
                Quotation_no         = CUpvc_Quotation_exten.GetNext_No,
                Quotation_date       = string.Empty,
                Party_id             = string.Empty,
                Delivered_id         = string.Empty,
                Transport_id         = Core.ByRoad,
                Vehicle_no           = string.Empty,
                Total_qty            = 0,
                Total_areasq         = 0,
                Total_taxable_amount = 0,
                Total_cgst           = 0,
                Total_sgst           = 0,
                Total_igst           = 0,
                Gsttotal             = 0,
                Ledger_id            = string.Empty,
                Additional           = 0,
                Rounds               = 0,
                Grandtotal           = 0,
                Refered_no           = 0,
                Locked               = string.Empty,
                Notes     = string.Empty,
                Active_id = Core.Active,
                User_id   = Current.User
            };

            return(obj);
        }
Beispiel #9
0
        private Upvc_Quotation CollectData()
        {
            Upvc_Quotation fobj = new Upvc_Quotation()
            {
                Upvc_Quotation_id    = vId,
                Uniqueno             = Current.Acy_id + "~" + Current.Company_id + "~" + txt_invoice_no.Text,
                Company_id           = Current.Company_id,
                Acy_id               = Current.Acy_id,
                Taxtype_id           = CTaxtype_exten.GetId_Name(txt_taxtype_id.Text),
                Salestype_id         = CSalestype_exten.GetId_Name(txt_salestype_id.Text),
                Quotation_no         = txt_invoice_no.Text,
                Quotation_date       = txt_invoice_date.Text,
                Party_id             = CParty_exten.GetId_Name(txt_party_id.Text),
                Delivered_id         = CParty_exten.GetId_Name(txt_Delivered_id.Text),
                Transport_id         = CTransport_exten.GetId_Name(txt_transport_id.Text),
                Vehicle_no           = txt_vehicle_no.Text,
                Total_qty            = ConvertTO.Decimal(txt_total_qty.Text),
                Total_areasq         = ConvertTO.Decimal(vTotAreasq.ToString()),
                Total_taxable_amount = ConvertTO.Decimal(vTotTaxable.ToString()),
                Total_cgst           = ConvertTO.Decimal(vTotCgst.ToString()),
                Total_sgst           = ConvertTO.Decimal(vTotSgst.ToString()),
                Total_igst           = ConvertTO.Decimal(vTotIgst.ToString()),
                Gsttotal             = ConvertTO.Decimal(txt_gsttotal.Text),
                Ledger_id            = CLedger_exten.GetId_Name(txt_ledger_id.Text + ""),
                Additional           = ConvertTO.Decimal(txt_additional.Text),
                Rounds               = ConvertTO.Decimal(vRoundoff.ToString()),
                Grandtotal           = ConvertTO.Decimal(txt_grandtotal.Text),
                Refered_no           = ConvertTO.Decimal(txt_grandtotal.Text),
                Locked               = Core.Unlocked,
                Active_id            = Core.Stative,
                Notes   = txt_notes.Text,
                User_id = Current.User
            };

            return(fobj);
        }
Beispiel #10
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);
        }