Exemple #1
0
        public static Print_invoiceItemsList GetData(string p_id)
        {
            Print_invoiceItemsList list = new Print_invoiceItemsList();
            //
            List <Upvc_invoiceitems> inv_item_list = CUpvc_invoiceitems_exten.FKId(p_id, new DAL());

            for (int r = 0; r <= inv_item_list.Count - 1; r++)
            {
                Print_invoiceitemsRow row = new Print_invoiceitemsRow();
                //
                row.INVOICE_ITEM_ID = inv_item_list[r].Upvc_invoiceitems_id;
                row.INVOICE_ID      = inv_item_list[r].Upvc_invoice_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);
        }
Exemple #2
0
 static void localReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
 {
     switch (e.DataSourceNames[0])
     {
     case "MyDataSource_Items":
         try
         {
             Print_invoiceItemsList data_AT = P_InvoiceItem.GetData(vPId);
             e.DataSources.Add(new ReportDataSource("MyDataSource_Items", data_AT));
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
         }
         break;
     }
 }
        public static void Print(ReportViewer pRptViewer, string p_id)
        {
            Print_invoiceItemsList data = GetData(p_id);

            LocalReport localReport = pRptViewer.LocalReport;

            //= Set Report Path
            localReport.ReportPath  = Application.StartupPath + @"\PRINTS\P_PurchaseItem.rdlc"; //(1)//
            localReport.DisplayName = "invoice items";

            //= Set Report Data Source
            localReport.DataSources.Add(new ReportDataSource("MyDataSource_Items", data)); //(2)//

            //= Refresh the report

            PrinterSettings v_PrinterSettings = GetPrinterSettings();

            pRptViewer.PrinterSettings = v_PrinterSettings;
            pRptViewer.SetPageSettings(v_PrinterSettings.DefaultPageSettings);
            pRptViewer.RefreshReport();
        }
        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);
        }
Exemple #5
0
        public static Print_invoiceItemsList GetData(string p_id)
        {
            Print_invoiceItemsList list = new Print_invoiceItemsList();
            //
            List <Labouritems> inv_item_list = new List <Labouritems>();

            inv_item_list = CLabouritems_exten.FKId(p_id);

            for (int r = 0; r <= inv_item_list.Count - 1; r++)
            {
                Print_invoiceitemsRow row = new Print_invoiceitemsRow();
                //
                row.LABOUR_ITEM_ID = inv_item_list[r].Labouritems_id;
                row.LABOUR_ID      = inv_item_list[r].Labour_id;
                row.SL_NO          = (r + 1).ToString();



                row.PO_NO = inv_item_list[r].Po_no;
                row.DC_NO = inv_item_list[r].Dc_no;

                row.PRODUCT_ID = inv_item_list[r].Product_id;

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

                if (inv_item_list[r].Sizes_id == "")
                {
                    row.SIZES = "";
                }
                else
                {
                    row.SIZES = inv_item_list[r].Sizes_id;
                }

                if (inv_item_list[r].Qty == "0")
                {
                    row.QTY = "";
                }
                else
                {
                    row.QTY = inv_item_list[r].Qty.ToString();
                }

                if (inv_item_list[r].Price == 0)
                {
                    row.PRICE = "";
                }
                else
                {
                    row.PRICE = ConvertTO.Decimal2d(inv_item_list[r].Price.ToString());
                }

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

                decimal vQty   = ConvertTO.Decimal(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;

                if (vTaxableValue == 0)
                {
                    row.TAXABLEVALUE = "";
                }
                else
                {
                    row.TAXABLEVALUE = ConvertTO.Decimal2d(vTaxableValue.ToString());
                }


                if (vcgst_per == 0)
                {
                    row.CGST_PERCENT = "";
                }
                else
                {
                    row.CGST_PERCENT = ConvertTO.DecimalToS(vcgst_per.ToString());
                }

                if (vCGST == 0)
                {
                    row.CGST_AMOUNT = "";
                }
                else
                {
                    row.CGST_AMOUNT = ConvertTO.Decimal2d(vCGST.ToString());
                }

                if (vsgst_per == 0)
                {
                    row.SGST_PERCENT = "";
                }
                else
                {
                    row.SGST_PERCENT = ConvertTO.DecimalToS(vsgst_per.ToString());
                }

                if (vSGST == 0)
                {
                    row.SGST_AMOUNT = "";
                }
                else
                {
                    row.SGST_AMOUNT = ConvertTO.Decimal2d(vSGST.ToString());
                }

                if (vigst_per == 0)
                {
                    row.IGST_PERCENT = "";
                }
                else
                {
                    row.IGST_PERCENT = ConvertTO.DecimalToS(vigst_per.ToString());
                }

                if (vIGST == 0)
                {
                    row.IGST_AMOUNT = "";
                }
                else
                {
                    row.IGST_AMOUNT = ConvertTO.Decimal2d(vIGST.ToString());
                }

                if (vAmount == 0)
                {
                    row.SUB_TOTAL = "";
                }
                else
                {
                    row.SUB_TOTAL = ConvertTO.Decimal2d(vAmount.ToString());
                }


                //
                list.Add(row);
                //
            }
            //
            return(list);
        }