Esempio n. 1
0
        private Creditnote CollectData()
        {
            Creditnote fobj = new Creditnote()
            {
                Creditnote_id = vId,
                Uniqueno      = Current.Acy_id + "~" + Current.Company_id + "~" + txt_invoice_no.Text,
                Company_id    = Current.Company_id,
                //Div_id = Current.Div_id,
                Acy_id               = Current.Acy_id,
                Order_id             = COrder_exten.GetId_Name(txt_order_id.Text, "", "", ""),
                Creditnote_no        = txt_invoice_no.Text,
                Creditnote_date      = txt_invoice_date.Text,
                Party_id             = CParty_exten.GetId_Name(txt_party_id.Text),
                Taxtype_id           = CTaxtype_exten.GetId_Name(txt_taxtype_id.Text),
                Salestype_id         = CSalestype_exten.GetId_Name(txt_salestype_id.Text),
                Total_qty            = txt_total_qty.Text,
                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_amt          = ConvertTO.Decimal(txt_grandtotal.Text),
                Locked               = Core.Unlocked,
                Active_id            = Core.Stative,
                Notes   = txt_notes.Text,
                User_id = Current.User
            };

            return(fobj);
        }
Esempio n. 2
0
        private Voucher CollectData()
        {
            Voucher fobj = new Voucher()
            {
                Voucher_id     = vId,
                Company_id     = Current.Company_id,
                Voucher_no     = txt_voucher_no.Text,
                Voucher_date   = txt_voucher_date.Text,
                Vouchertype_id = CVouchertype_exten.GetId_Name(txt_vouchertype_id.Text),
                Order_id       = COrder_exten.GetId_Name(txt_order_id.Text),
                Ledger_id      = CLedger_exten.GetId_Name(txt_ledger_id.Text),
                Party_id       = CParty_exten.GetId_Name(txt_party_id.Text),
                Purpose        = txt_purpose.Text,
                Credit         = "",
                Debit          = "",
                Active_id      = Core.Stative,
                Notes          = txt_notes.Text,
                User_id        = Current.User
            };


            var method = CVouchertype_exten.GetMethodid_Name(txt_vouchertype_id.Text);

            if (method == "1")// 1 payment
            {
                fobj.Credit = txt_credit.Text;
            }
            else if (method == "2") // receipt
            {
                fobj.Debit = txt_debit.Text;
            }


            return(fobj);
        }
Esempio n. 3
0
        private Quotation CollectData()
        {
            Quotation fobj = new Quotation()
            {
                Quotation_id         = vId,
                Uniqueno             = Current.Acy_id + "~" + Current.Company_id + "~" + txt_quotation_no.Text,
                Company_id           = Current.Company_id,
                Acy_id               = Current.Acy_id,
                Order_id             = "1",
                Quotation_no         = txt_quotation_no.Text,
                Quotation_date       = txt_quotation_date.Text,
                Party_id             = CParty_exten.GetId_Name(txt_party_id.Text),
                Total_qty            = ConvertTO.Decimal(totalQty),
                Total_taxable_amount = ConvertTO.Decimal(vTotTaxable.ToString()),
                Ledger_id            = txt_ledger_id.Text,
                Additional           = ConvertTO.Decimal(txt_additional.Text),
                Rounds               = ConvertTO.Decimal(vRoundoff.ToString()),
                Grandtotal           = ConvertTO.Decimal(txt_grandtotal.Text),
                Refered_amt          = ConvertTO.Decimal(txt_grandtotal.Text),
                Locked               = Core.Unlocked,
                Active_id            = Core.Stative,
                Notes   = txt_notes.Text,
                User_id = Current.User
            };

            return(fobj);
        }
Esempio n. 4
0
        public void List_Option(ListOption pAction)
        {
            fAction = pAction;

            switch (fAction)
            {
            case ListOption.active:

                if (chk_notactive.Checked == true)
                {
                    LoadData(CVoucher_exten.NotActive(new DAL()));
                }
                else
                {
                    LoadData(CVoucher_exten.Active(new DAL()));
                }

                break;

            case ListOption.notactive:

                if (chk_notactive.Checked == true)
                {
                    LoadData(CVoucher_exten.NotActive(new DAL()));
                }
                else
                {
                    LoadData(CVoucher_exten.Active(new DAL()));
                }

                break;

            case ListOption.Search:

                List <Voucher> list =
                    CVoucher_exten.Searchfilter(
                        txt_voucher_no.Text
                        , txt_voucher_no_1.Text
                        , txt_voucher_date.Text
                        , txt_voucher_date_1.Text
                        , CVouchertype_exten.GetId_Name(txt_vouchertype.Text)
                        , COrder_exten.GetId_Name(txt_orderref.Text)
                        , CLedger_exten.GetId_Name(txt_ledger.Text)
                        , CParty_exten.GetId_Name(txt_party.Text)
                        , txt_purpose.Text
                        , new DAL());

                LoadData(list);

                break;

            default:
                LoadData(CVoucher_exten.Active(new DAL()));
                break;
            }
        }
Esempio n. 5
0
        private static Print_List GetData(string p_id)
        {
            Outward outward = COutward_exten.PKId(p_id);

            Print_List list = new Print_List();

            Print_QuotationRow row = new Print_QuotationRow();

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

            row.COMPANY_NAME  = obj.Display_name.ToUpper();
            row.ADDRESS1      = obj.Street1 + " , " + obj.Street2;
            row.ADDRESS2      = obj.City_id + " - " + obj.Pincode_id + " , " + obj.State_id + ". Code -33,    Email : " + obj.Email;
            row.COMPANY_GSTIN = " GSTIN : " + obj.Gstin + "";// ,    Cell :    " + obj.Cell1 + " ";

            row.OUTWARD_ID   = p_id;
            row.OUTWARD_NO   = "NO    : " + outward.Outward_no.ToString();
            row.OUTWARD_DATE = "DATE  : " + ConvertTO.Date2S(outward.Outward_date);



            Party _party_list = CParty_exten.PKId(outward.Party_id, new DAL());

            row.PARTY_NAME = _party_list.Party_name;

            if (_party_list.Party_name != null)
            {
                row.STREET1 = _party_list.Street_1 + ", " + _party_list.Street_2;
                row.STREET2 = "";
                row.CITY    = _party_list.City_id + " - " + _party_list.Pincode_id + " ,";
                //row.STATE = _party_list.State_id + " - " + CState_exten.GetStateCode(_party_list.State_id);
                row.COUNTRY = _party_list.Country_id;
                row.PINCODE = "";

                if (_party_list.Gstin.Trim().Length != 0)
                {
                    row.GSTIN += "GSTIN No : " + _party_list.Gstin;
                }
            }

            row.TOTAL_QTY       = ConvertTO.DecimalToS(outward.Total_qty.ToString());
            row.TOTAL_BUNDLE    = outward.Total_bundel;
            row.DELIVREDTHROUGH = outward.Delivredthrough;

            list.Add(row);

            return(list);
        }
Esempio n. 6
0
        private Cash_receipt CollectData()
        {
            Cash_receipt fobj = new Cash_receipt()
            {
                Cash_receipt_id = vId,
                Receipt_date    = txt_receipt_date.Text,
                Party_id        = CParty_exten.GetId_Name(txt_party_id.Text),
                Purpose         = txt_purpose.Text,
                Receipt_amount  = ConvertTO.Decimal(txt_receipt_amount.Text),
                Active_id       = Core.Stative,
                Notes           = txt_notes.Text,
                User_id         = Current.User
            };

            return(fobj);
        }
Esempio n. 7
0
 private void LoadData(Quotation obj)
 {
     vId = obj.Quotation_id;
     txt_quotation_no.Text   = obj.Quotation_no.ToString();
     txt_quotation_date.Text = obj.Quotation_date;
     txt_party_id.Text       = obj.Party_id;
     //txt_total_qty.Text = obj.Total_qty.ToString();
     //txt_total_taxable_amount.Text = obj.Total_taxable_amount;
     //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_balance.Text    = CQuotation_exten.GetBalance(CParty_exten.GetId_Name(txt_party_id.Text)).ToString();
     txt_notes.Text      = obj.Notes;
     Core.Stative        = obj.Active_id;
     Setactives();
 }
Esempio n. 8
0
        private Cash_payment CollectData()
        {
            Cash_payment fobj = new Cash_payment()
            {
                Cash_payment_id = vId,
                Order_id        = COrder_exten.GetId_Name(txt_order_id.Text, "", "", ""),
                Payment_date    = txt_payment_date.Text,
                Ledger_id       = CLedger_exten.GetId_Name(txt_ledger_id.Text),
                Purpose         = txt_purpose.Text,
                Party_id        = CParty_exten.GetId_Name(txt_party_id.Text),
                Payment_amount  = ConvertTO.Decimal(txt_payment_amount.Text),
                Active_id       = Core.Stative,
                Notes           = txt_notes.Text,
                User_id         = Current.User
            };

            return(fobj);
        }
Esempio n. 9
0
 private void LoadData(Creditnote obj)
 {
     vId = obj.Creditnote_id;
     txt_order_id.Text     = obj.Order_id;
     txt_invoice_no.Text   = obj.Creditnote_no.ToString();
     txt_invoice_date.Text = obj.Creditnote_date;
     txt_party_id.Text     = obj.Party_id;
     txt_taxtype_id.Text   = obj.Taxtype_id;
     SetTaxtype();
     txt_salestype_id.Text = obj.Salestype_id;
     txt_total_qty.Text    = obj.Total_qty.ToString();
     //txt_total_taxable_amount.Text = obj.Total_taxable_amount;
     txt_gsttotal.Text   = obj.Gsttotal.ToString();
     txt_ledger_id.Text  = CLedger_exten.GetName_Id(obj.Ledger_id);
     txt_additional.Text = obj.Additional.ToString();
     txt_grandtotal.Text = obj.Grandtotal.ToString();
     txt_balance.Text    = CCreditnote_exten.GetBalance(CParty_exten.GetId_Name(txt_party_id.Text)).ToString();
     txt_notes.Text      = obj.Notes;
     Core.Stative        = obj.Active_id;
     Setactives();
 }
Esempio n. 10
0
        private Order CollectData()
        {
            Order fobj = new Order()
            {
                Order_id     = vId,
                Uniqueno     = Current.Acy_id + "~" + Current.Company_id + "~" + txt_order_no.Text,
                Company_id   = Current.Company_id,
                Acy_id       = Current.Acy_id,
                Order_no     = txt_order_no.Text,
                Order_date   = txt_order_date.Text,
                Ordertype_id = COrdertype_exten.GetId_Name(txt_ordertype_id.Text),
                Party_id     = CParty_exten.GetId_Name(txt_party_id.Text),
                Party_ref    = txt_party_ref.Text,
                Refered_no   = "",
                Locked       = Core.Unlocked,
                Active_id    = Core.Stative,
                Notes        = txt_notes.Text,
                User_id      = Current.User
            };

            return(fobj);
        }
Esempio n. 11
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();
        }
Esempio n. 12
0
        private Outward CollectData()
        {
            Outward fobj = new Outward()
            {
                Inward_id       = vId,
                Uniqueno        = Current.Acy_id + "~" + Current.Company_id + "~" + txt_outward_no.Text,
                Company_id      = Current.Company_id,
                Acy_id          = Current.Acy_id,
                Order_id        = COrder_exten.GetId_Name(txt_order_id.Text, "", "", ""),
                Outward_no      = txt_outward_no.Text,
                Outward_date    = txt_outward_date.Text,
                Party_dcno      = txt_party_dcno.Text,
                Party_id        = CParty_exten.GetId_Name(txt_party_id.Text),
                Total_qty       = txt_total_qty.Text,
                Total_bundel    = txt_total_bundel.Text,
                Delivredthrough = txt_deliveredthrough.Text,
                Locked          = Core.Unlocked,
                Notes           = txt_notes.Text,
                Active_id       = Core.Stative,
                User_id         = Current.User
            };

            return(fobj);
        }
Esempio n. 13
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);
        }
Esempio n. 14
0
        private Receipt CollectData()
        {
            Receipt fobj = new Receipt()
            {
                Receipt_id     = vId,
                Uniqueno       = Current.Acy_id + "~" + Current.Company_id + "~" + txt_receipt_no.Text,
                Company_id     = Current.Company_id,
                Acy_id         = Current.Acy_id,
                Receipt_no     = txt_receipt_no.Text,
                Receipt_date   = txt_receipt_date.Text,
                Party_id       = CParty_exten.GetId_Name(txt_party_id.Text),
                Receipttype_id = CReceipttype_exten.GetId_Name(txt_receipttype_id.Text),
                Cheq_no        = txt_cheq_no.Text,
                Receipt_amount = ConvertTO.Decimal(txt_receipt_amount.Text),
                Cheq_date      = txt_cheq_date.Text,
                Bank_id        = GetBankid,
                Total_amount   = ConvertTO.Decimal(txt_total_amount.Text),
                Active_id      = Core.Stative,
                Notes          = txt_notes.Text,
                User_id        = Current.User
            };

            return(fobj);
        }
Esempio n. 15
0
 private void Txt_party_TextChanged(object sender, EventArgs e)
 {
     txt_balance.Text = CQuotation_exten.GetBalance(CParty_exten.GetId_Name(txt_party_id.Text)).ToString();
 }
Esempio n. 16
0
 void txt_party_LookupUpdate(object sender, EventArgs e)
 {
     txt_party_id.LookupList = CParty_exten.GetforLookup(new DAL());
 }
Esempio n. 17
0
        private static void InsertData(Invoice.Const.Invoice obj, List <Invoiceitems> items, string newDB)
        {
            DAL dalsession;

            try
            {
                dalsession = new DAL();
                dalsession.BeginTransaction();

                List <Invoiceitems> list_new = new List <Invoiceitems>();
                if (obj != null)
                {
                    if (CheckData(obj, newDB) != true)
                    {
                        Invoice.Const.Invoice obj_new = new Invoice.Const.Invoice
                        {
                            Uniqueno             = obj.Uniqueno,
                            Company_id           = obj.Company_id,
                            Acy_id               = obj.Acy_id,
                            Order_id             = "1",
                            Invoice_no           = obj.Invoice_no,
                            Invoice_date         = obj.Invoice_date,
                            Party_id             = CParty_exten.GetId_Name(obj.Party_id),
                            Taxtype_id           = CTaxtype_exten.GetId_Name(obj.Taxtype_id),
                            Salestype_id         = CSalestype_exten.GetId_Name(obj.Salestype_id),
                            Transport_id         = CTransport_exten.GetId_Name(obj.Transport_id),
                            Deliveredto_id       = CDeliveredto_exten.GetId_Name(obj.Deliveredto_id),
                            Bundel               = obj.Bundel,
                            Total_qty            = obj.Total_qty,
                            Total_taxable_amount = obj.Total_taxable_amount,
                            Total_cgst           = obj.Total_cgst,
                            Total_sgst           = obj.Total_sgst,
                            Total_igst           = obj.Total_igst,
                            Gsttotal             = obj.Gsttotal,
                            Ledger_id            = CLedger_exten.GetName_Id(obj.Ledger_id),
                            Additional           = obj.Additional,
                            Rounds               = obj.Rounds,
                            Grandtotal           = obj.Grandtotal,
                            Refered_amt          = obj.Refered_amt,
                            Locked               = obj.Locked,
                            Notes     = obj.Notes,
                            Active_id = obj.Active_id,
                            User_id   = "1"
                        };

                        //switch (obj.Company_id)
                        //{
                        //    case "1":
                        //        obj_new.Company_id = "1";
                        //        obj_new.Acy_id = "1";
                        //        break;

                        //    case "3":
                        //        obj_new.Company_id = "1";
                        //        obj_new.Acy_id = "2";
                        //        break;

                        //    case "4":
                        //        obj_new.Company_id = "1";
                        //        obj_new.Acy_id = "3";
                        //        break;

                        //}

                        obj_new.Uniqueno = obj_new.Acy_id + "~" + obj_new.Company_id + "~" + obj_new.Invoice_no;


                        Invoice.Class.CInvoice.Insert(obj_new, dalsession);
                        var vId = DAL.GetIdentity(dalsession);

                        for (int k = 0; k < items.Count; k++)
                        {
                            Invoiceitems v = new Invoiceitems()
                            {
                                Invoice_id   = vId,
                                Po_no        = "",
                                Dc_no        = "",
                                Product_id   = CProduct_exten.GetId_Name(items[k].Product_id),
                                Sizes_id     = CSizes_exten.GetId_Name(items[k].Sizes_id),
                                Colours_id   = "1",
                                Qty          = items[k].Qty,
                                Price        = items[k].Price,
                                Cgst_percent = items[k].Cgst_percent,
                                Sgst_percent = items[k].Sgst_percent,
                                Igst_percent = items[k].Igst_percent,
                                Refered_id   = items[k].Refered_id,
                                Locked       = items[k].Locked
                            };
                            list_new.Add(v);
                        }

                        Invoice.Class.CInvoiceitems.Insert(list_new, dalsession);
                        dalsession.Commit();
                    }
                }
            }
            catch (Exception ex)

            {
                MessageBox.Show("error : " + ex);
            }
        }
Esempio n. 18
0
        private static Print_PurchaseList GetData(string p_id, List <PrintCopies> printcopies)
        {
            Garment_purchase invoice = CPurchase_exten.PKId(p_id, new DAL());

            Print_PurchaseList list = new Print_PurchaseList();

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

                row.COPIES    = printcopies[i].Copies;
                row.SALESTYPE = invoice.Salestype_id;

                Company obj = CCompany_exten.PKId(Current.Company_id, new DAL());
                row.COMPANY_NAME = obj.Display_name.ToUpper();
                row.ADDRESS1     = obj.Street1 + " , " + obj.Street2;
                row.ADDRESS2     = obj.City_id + " - " + obj.Pincode_id + " , " + obj.State_id + ". Code -33,    Email : " + obj.Email;
                row.COMPANY_TIN  = " GSTIN : " + obj.Gst + "";// ,    Cell :    " + obj.Cell1 + " ";

                row.PURCHASE_ID   = p_id;
                row.PURCHASE_NO   = invoice.Garment_purchase_no;
                row.PURCHASE_DATE = ConvertTO.Date2S(invoice.Garment_purchase_date);

                row.PARTY_NAME = invoice.Party_id;

                Party _party_list = CParty_exten.SearchName(invoice.Party_id, new DAL());

                if (_party_list.Party_name != null)
                {
                    row.STREET1 = _party_list.Street1 + ", " + _party_list.Street2;
                    row.STREET2 = "";
                    row.CITY    = _party_list.City_id + " - " + _party_list.Pincode_id + " , " + _party_list.State_id;
                    row.STATE   = "";
                    row.COUNTRY = _party_list.Country_id;
                    row.PINCODE = "";
                    if (_party_list.Tin.Trim().Length != 0)
                    {
                        row.GSTIN = "TIN No : " + _party_list.Tin;
                    }
                    if (_party_list.Gst.Trim().Length != 0)
                    {
                        row.GSTIN += "GSTIN No : " + _party_list.Gst;
                    }
                }
                row.TOTAL_QTY = ConvertTO.DecimalToS(invoice.Total_qty.ToString());

                row.TAXABLE_VALUE = ConvertTO.Decimal2d(invoice.Total_taxable_amount.ToString());


                List <Purchaseitems> klist = CPurchaseitems_exten.FKId(p_id, new DAL());

                if (klist.Count != 0)
                {
                    row.LBL_CGST = "  Add CGST tax @ " + ConvertTO.DecimalToS(klist[0].Cgst_percent.ToString()) + " %";
                    row.LBL_SGST = "  Add SGST tax @ " + ConvertTO.DecimalToS(klist[0].Sgst_percent.ToString()) + " %";
                }
                else
                {
                    row.LBL_CGST = "  Add CGST tax ";
                    row.LBL_SGST = "  Add SGST tax ";
                }

                row.TOTAL_CGST = ConvertTO.Decimal2d(invoice.Total_cgst.ToString());
                row.TOTAL_SGST = ConvertTO.Decimal2d(invoice.Total_sgst.ToString());
                row.TOTAL_IGST = ConvertTO.Decimal2d(invoice.Total_igst.ToString());

                row.TOTAL_SUB = (Global.ToDecimal(row.TAXABLE_VALUE) + Global.ToDecimal(row.TOTAL_CGST) + Global.ToDecimal(row.TOTAL_SGST) + Global.ToDecimal(row.TOTAL_IGST) + Global.ToDecimal(row.TOTAL_CESS)).ToString();

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

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

                list.Add(row);
            }

            return(list);
        }
Esempio n. 19
0
        private static Print_QuotationList GetData(string p_id)
        {
            Quotation quotation = CQuotation_exten.PKId(p_id, new DAL());

            Print_QuotationList list = new Print_QuotationList();

            Print_QuotationRow row = new Print_QuotationRow();

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

            row.COMPANY_NAME = obj.Display_name.ToUpper();
            row.ADDRESS1     = obj.Street1 + " , " + obj.Street2;
            row.ADDRESS2     = obj.City_id + " - " + obj.Pincode_id + " , " + obj.State_id + ". Code -33,    Email : " + obj.Email;
            row.COMPANY_TIN  = " GSTIN : " + obj.Gstin + "";// ,    Cell :    " + obj.Cell1 + " ";

            row.QUOTATION_ID   = p_id;
            row.QUOTATION_NO   = "NO    : " + quotation.Quotation_no.ToString();
            row.QUOTATION_DATE = "DATE  : " + ConvertTO.Date2S(quotation.Quotation_date);

            row.PARTY_NAME = quotation.Party_id;

            Party _party_list = CParty_exten.SearchName(quotation.Party_id, new DAL());

            if (_party_list.Party_name != null)
            {
                row.STREET1 = _party_list.Street_1 + ", " + _party_list.Street_2;
                row.STREET2 = "";
                row.CITY    = _party_list.City_id + " - " + _party_list.Pincode_id + " ,";
                //row.STATE = _party_list.State_id + " - " + CState_exten.GetStateCode(_party_list.State_id);
                row.COUNTRY = _party_list.Country_id;
                row.PINCODE = "";

                if (_party_list.Gstin.Trim().Length != 0)
                {
                    row.GSTIN += "GSTIN No : " + _party_list.Gstin;
                }
            }

            row.TOTAL_QTY = ConvertTO.DecimalToS(quotation.Total_qty.ToString());

            row.TAXABLE_VALUE = ConvertTO.Decimal2d(quotation.Total_taxable_amount.ToString());


            List <Quotationitems> klist = CQuotationitems_exten.FKId(p_id, new DAL());

            row.TOTAL_SUB = (Global.ToDecimal(row.TAXABLE_VALUE).ToString());

            if (quotation.Ledger_id != null)
            {
                if (quotation.Ledger_id.Trim() != "")
                {
                    row.LEDGER = "Add TAX Invoice " + quotation.Ledger_id;
                }
                else
                {
                    row.LEDGER = "";
                }
            }

            row.ADDITIONAL      = quotation.Additional.ToString();
            row.OUTSTANDING     = "Total Outstanding Amount : " + CQuotation_exten.GetBalance(CParty_exten.GetId_Name(quotation.Party_id));
            row.GRANDTOTAL      = quotation.Grandtotal.ToString();
            row.AMOUNT_IN_WORDS = "Rupees   : " + Global.AmountInWords(Convert.ToDecimal(quotation.Grandtotal));

            list.Add(row);

            return(list);
        }
        private static Print_CreditnoteList ReturnCreditnote(string Id, List <PrintCopies> printcopies)
        {
            Creditnote             invoice      = CCreditnote_exten.PKId(Id);
            List <Creditnoteitems> invoiceitems = CCreditnoteitems_exten.FKId(Id);

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

            Party party = CParty_exten.SearchName(invoice.Party_id, new DAL());

            Company_bank cmpbank = CCompany_bank_exten.PKId("1");

            Print_CreditnoteList list = new Print_CreditnoteList();

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

                row.COPY_NAME  = printcopies[i].Copies;
                row.SALES_TYPE = invoice.Salestype_id;
                row.TAX_TYPE   = invoice.Taxtype_id;

                row.COMPANY_NAME      = company.Display_name;
                row.COMPANY_ADDRESS_1 = company.Street1 + ", " + company.Street2;
                row.COMPANY_ADDRESS_2 = company.City_id + "- " + company.Pincode_id + ", " + company.State_id + " - (" + Ccoreplus.GetStateCode(company.State_id) + ") . Email :- " + company.Email;
                row.COMPANY_PHONE     = company.Phone;
                row.COMPANY_CELL1     = company.Cell1;
                row.COMPANY_CELL2     = company.Cell2;

                row.COMPANY_EMAIL   = company.Email;
                row.COMPANY_WEBSITE = company.Website;


                if (company.Gstin.Trim().Length != 0)
                {
                    row.COMPANY_GSTIN = "GSTIN : " + company.Gstin;

                    if (company.Cell1.Trim().Length != 0)
                    {
                        row.COMPANY_GSTIN = "GSTIN : " + company.Gstin + " , Mobile : " + company.Cell1;

                        if (company.Cell2.Trim().Length != 0)
                        {
                            row.COMPANY_GSTIN = "GSTIN : " + company.Gstin + " , Mobile : " + company.Cell1 + ", " + company.Cell2;
                        }
                    }
                }
                else
                {
                    row.COMPANY_GSTIN = "";
                }

                row.CREDITNOTE_ID   = invoice.Creditnote_id;
                row.CREDITNOTE_NO   = ":. " + invoice.Creditnote_no;
                row.CREDITNOTE_DATE = ":  " + ConvertTO.Date2S(invoice.Creditnote_date);

                row.PARTY_NAME     = party.Party_name;
                row.PARTY_STREET_1 = party.Street_1 + ",";

                if (party.Street_2.Trim().Length != 0)
                {
                    row.PARTY_STREET_2 = party.Street_2 + ",";
                }

                if (party.Pincode_id.Trim().Length == 6)
                {
                    row.PARTY_CITY = party.City_id + " - :" + party.Pincode_id + ",";
                }
                else
                {
                    row.PARTY_CITY = party.City_id + ",";
                }


                row.PARTY_STATE = party.State_id + " - (" + Ccoreplus.GetStateCode(party.State_id) + ").";

                row.PARTY_STATE_CODE = "";
                row.PARTY_COUNTRY    = party.Country_id;
                row.PARTY_PINCODE    = party.Pincode_id;

                if (party.Gstin.Trim().Length != 0)
                {
                    row.PARTY_GSTIN = "GSTIN :" + party.Gstin;
                }

                row.TOTAL_QTY     = invoice.Total_qty.ToString();
                row.TAXABLE_VALUE = invoice.Total_taxable_amount.ToString();

                if (Customised.TaxType == Core.SGST)
                {
                    row.CGST_PERCENT = "  Add CGST " + (invoiceitems[0].Cgst_percent.ToString()) + " %";
                    row.SGST_PERCENT = "  Add SGST " + (invoiceitems[0].Sgst_percent.ToString()) + " %";

                    row.TOTAL_CGST = invoice.Total_cgst.ToString();
                    row.TOTAL_SGST = invoice.Total_sgst.ToString();
                }
                else if (Customised.TaxType == Core.IGST)
                {
                    row.CGST_PERCENT = "";
                    row.SGST_PERCENT = "  Add IGST " + (invoiceitems[0].Igst_percent.ToString()) + " %";

                    row.TOTAL_CGST = "";
                    row.TOTAL_SGST = invoice.Total_igst.ToString();
                }

                row.TOTAL_SUB = invoice.Grandtotal.ToString();

                row.LEDGER = CLedger_exten.GetName_Id(invoice.Ledger_id);

                if (invoice.Additional != 0)
                {
                    row.ADDITIONAL = invoice.Additional.ToString();
                }
                else
                {
                    row.ADDITIONAL = "";
                }

                row.ROUNDS   = invoice.Rounds.ToString();
                row.GSTTOTAL = invoice.Gsttotal.ToString();

                row.GRANDTOTAL      = invoice.Grandtotal.ToString();
                row.AMOUNT_IN_WORDS = "Rupees : " + Global.AmountInWords(invoice.Grandtotal);
                row.NOTES           = invoice.Notes;
                row.ENTRY_BY        = invoice.User_id;

                row.FORSIGN = company.Display_name;

                if (Customised.InvoiceWithBankDetails)
                {
                    row.ACCOUNT_NO = "A/C NO          :  " + cmpbank.Account_number;
                    row.IFSC_CODE  = "IFSC CODE    :  " + cmpbank.Ifsc_code;
                    row.BANK_NAME  = "BANK NAME  :  " + cmpbank.Company_bank_name;
                    row.BRANCH     = "BRANCH        :  " + cmpbank.Branch_name;
                }
                else
                {
                    row.ACCOUNT_NO = "";
                    row.IFSC_CODE  = "";
                    row.BANK_NAME  = "";
                    row.BRANCH     = "";
                }

                row.TERMS_1 = Message.TERMS_1;
                row.TERMS_2 = Message.TERMS_2;
                row.TERMS_3 = Message.TERMS_3;
                row.TERMS_4 = Customised.Terms_4;

                list.Add(row);
            }

            return(list);
        }
Esempio n. 21
0
        private static Receipt GetOldData(int id, string OldDB)
        {
            string q = "USE " + OldDB + "; ";

            q += " SELECT " + RECEIPT.RECEIPT_TBL + ".* \r\n";
            q += ", " + PARTY.PARTY_TBL + "." + PARTY.PARTY_NAME + " \r\n";
            q += ", " + RECEIPTTYPE.RECEIPTTYPE_TBL + "." + RECEIPTTYPE.RECEIPTTYPE_NAME + " \r\n";
            q += ", " + BANK.BANK_TBL + "." + BANK.BANK_NAME + " \r\n";
            q += " FROM  " + RECEIPT.RECEIPT_TBL + " \r\n";
            q += " INNER JOIN  " + PARTY.PARTY_TBL + "\r\n";
            q += " ON(" + RECEIPT.RECEIPT_TBL + "." + RECEIPT.PARTY_ID + " = " + PARTY.PARTY_TBL + "." + PARTY.PARTY_ID + " )\r\n";
            q += " INNER JOIN  " + RECEIPTTYPE.RECEIPTTYPE_TBL + "\r\n";
            q += " ON(" + RECEIPT.RECEIPT_TBL + "." + RECEIPT.RECEIPTTYPE_ID + " = " + RECEIPTTYPE.RECEIPTTYPE_TBL + "." + RECEIPTTYPE.RECEIPTTYPE_ID + " )\r\n";
            q += " INNER JOIN  " + BANK.BANK_TBL + "\r\n";
            q += " ON(" + RECEIPT.RECEIPT_TBL + "." + RECEIPT.BANK_ID + " = " + BANK.BANK_TBL + "." + BANK.BANK_ID + " )\r\n";
            q += " WHERE " + RECEIPT.RECEIPT_TBL + "." + RECEIPT.RECEIPT_ID + "  = '" + id + "' \r\n";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    Receipt obj = new Receipt
                    {
                        Receipt_id     = "",
                        Uniqueno       = "",
                        Company_id     = redr[RECEIPT.COMPANY_ID].ToString(),
                        Acy_id         = "1",
                        Receipt_no     = redr[RECEIPT.RECEIPT_NO].ToString(),
                        Receipt_date   = redr[RECEIPT.RECEIPT_DATE].ToString(),
                        Party_id       = CParty_exten.GetId_Name(redr[PARTY.PARTY_NAME].ToString()),
                        Receipttype_id = CReceipttype_exten.GetId_Name(redr[RECEIPTTYPE.RECEIPTTYPE_NAME].ToString()),
                        Cheq_no        = redr[RECEIPT.CHEQ_NO].ToString(),
                        Receipt_amount = ConvertTO.Decimal(redr[RECEIPT.RECEIPT_AMOUNT].ToString()),
                        Cheq_date      = redr[RECEIPT.CHEQ_DATE].ToString(),
                        Bank_id        = "1",
                        Total_amount   = ConvertTO.Decimal(redr[RECEIPT.TOTAL_AMOUNT].ToString()),
                        Notes          = redr[RECEIPT.NOTES].ToString(),
                        Active_id      = redr[RECEIPT.ACTIVE_ID].ToString(),
                        User_id        = "1",
                    };

                    switch (obj.Company_id)
                    {
                    case "1":
                        obj.Company_id = "1";
                        obj.Acy_id     = "1";
                        break;

                    case "3":
                        obj.Company_id = "1";
                        obj.Acy_id     = "2";
                        break;

                    case "4":
                        obj.Company_id = "1";
                        obj.Acy_id     = "3";
                        break;
                    }

                    obj.Uniqueno = obj.Acy_id + "~" + obj.Company_id + "~" + obj.Receipt_no;

                    return(obj);
                }
                return(null);
            }
        }
Esempio n. 22
0
 void Txt_shipping_LookupUpdate(object sender, EventArgs e)
 {
     txt_Delivered_id.LookupList = CParty_exten.GetforLookup(new DAL());
 }
Esempio n. 23
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);
        }