Beispiel #1
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);
        }
Beispiel #2
0
        public static Print_invoiceItemsList GetData(string p_id)
        {
            Print_invoiceItemsList list = new Print_invoiceItemsList();
            //
            List <Purchaseitems> inv_item_list = new List <Purchaseitems>();

            if (Customise.Purchase_poid_dcid == true)
            {
                inv_item_list = CPurchaseitems_exten.FKId(p_id, new DAL());
            }

            if ((Customise.Purchase_pono_dcno == true) || (Customise.Purchase_Without_podc == true))
            {
                inv_item_list = CPurchaseitems_exten.FKNo(p_id, new DAL());
            }

            for (int r = 0; r <= inv_item_list.Count - 1; r++)
            {
                Print_invoiceitemsRow row = new Print_invoiceitemsRow();
                //
                row.PURCHASE_ITEM_ID = inv_item_list[r].Purchaseitems_id;
                row.PURCHASE_ID      = inv_item_list[r].Purchase_id;
                row.SL_NO            = (r + 1).ToString();

                if (inv_item_list[r].Po_id == "Without Po")
                {
                    row.PO_ID = "";
                }
                else
                {
                    row.PO_ID = inv_item_list[r].Po_id;
                }


                if (inv_item_list[r].Dc_id == "0")
                {
                    row.DC_ID = "";
                }
                else
                {
                    row.DC_ID = inv_item_list[r].Dc_id;
                }

                row.PRODUCT_ID = inv_item_list[r].Product_id;

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

                row.QTY   = ConvertTO.DecimalToS(inv_item_list[r].Qty);
                row.PRICE = ConvertTO.Decimal2d(inv_item_list[r].Price.ToString());

                decimal vAmount       = 0M;
                decimal vTaxableValue = 0M;

                decimal vQty   = Global.ToDecimal(row.QTY);
                decimal vPrice = Global.ToDecimal(row.PRICE);

                decimal vcgst_per = Global.ToDecimal(inv_item_list[r].Cgst_percent);
                decimal vsgst_per = Global.ToDecimal(inv_item_list[r].Sgst_percent);
                decimal vigst_per = Global.ToDecimal(inv_item_list[r].Igst_percent);

                vTaxableValue = vQty * vPrice;

                decimal vCGST = decimal.Round(((vTaxableValue * vcgst_per) / 100), 2);
                decimal vSGST = decimal.Round(((vTaxableValue * vsgst_per) / 100), 2);
                decimal vIGST = decimal.Round(((vTaxableValue * vigst_per) / 100), 2);

                vAmount = vTaxableValue + vCGST + vSGST + vIGST;

                row.TAXABLEVALUE = ConvertTO.Decimal2d(vTaxableValue.ToString());

                row.CGST_PERCENT = ConvertTO.DecimalToS(vcgst_per.ToString());

                row.CGST_AMOUNT = ConvertTO.Decimal2d(vCGST.ToString());

                row.SGST_PERCENT = ConvertTO.DecimalToS(vsgst_per.ToString());

                row.SGST_AMOUNT = ConvertTO.Decimal2d(vSGST.ToString());

                row.IGST_PERCENT = ConvertTO.DecimalToS(vigst_per.ToString());

                row.IGST_AMOUNT = ConvertTO.Decimal2d(vIGST.ToString());

                row.SUB_TOTAL = ConvertTO.Decimal2d(vAmount.ToString());
                //
                list.Add(row);
                //
            }
            //
            return(list);
        }