Ejemplo n.º 1
0
 public FrmConsignmentReturn(DEInvoice inv)
 {
     InitializeComponent();
     invoice = inv;
     rdo_isCarton.Checked = true;
     rdo_Price1.Checked   = true;
 }
Ejemplo n.º 2
0
 public FrmConsignmentReturn(DEInvoice inv, FrmCashInvoice cashInvoiceForm)
 {
     InitializeComponent();
     invoice = inv;
     rdo_isCarton.Checked = true;
     rdo_Price1.Checked   = true;
     this.frm_CashInvoice = cashInvoiceForm;
     isCashInvoice        = true;
 }
Ejemplo n.º 3
0
        public Boolean LoadInvoiceRow(DEInvoice inv)
        {
            DALInvoice obj_DALInvoice = new DALInvoice();

            Boolean bool_HasRow = obj_DALInvoice.LoadInvoiceRow(inv);

            obj_DALInvoice = null;

            return(bool_HasRow);
        }
Ejemplo n.º 4
0
        public DataTable LoadInvoiceTableForAllDataByInvoice_No(DEInvoice inv)
        {
            DALInvoice obj_DALInvoice = new DALInvoice();

            DataTable dt_Invoice = obj_DALInvoice.LoadInvoiceTableForAllDataByInvoice_No(inv);

            obj_DALInvoice = null;

            return(dt_Invoice);
        }
Ejemplo n.º 5
0
        public int UpdateData(DEInvoice inv)
        {
            DALInvoice obj_DALInvoice = new DALInvoice();

            int int_Result = obj_DALInvoice.UpdateData(inv);

            obj_DALInvoice = null;

            return(int_Result);
        }
Ejemplo n.º 6
0
        public int InsertData(DEInvoice inv, DEInvoiceNo invNo)
        {
            DALInvoice obj_DALInvoice = new DALInvoice();

            int int_Result = obj_DALInvoice.InsertData(inv, invNo);

            obj_DALInvoice = null;

            return(int_Result);
        }
Ejemplo n.º 7
0
 public FrmConsignmentReturn(FrmConsignmentInvoice confignmentInvoiceForm, DEInvoice inv)
 {
     InitializeComponent();
     invoice = inv;
     rdo_isCarton.Checked        = true;
     rdo_Price1.Checked          = true;
     this.frm_ConsignmentInvoice = confignmentInvoiceForm;
     isCreditInvoice             = false;
     isCashInvoice = false;
 }
        private void search()
        {
            if (false) //(cbx_Customer.Text.Trim().Length == 0 || cbx_Customer.SelectedValue == null)
            {
                ErrorProvider.SetError(cbx_Customer, "Please Select Customer");
                string str_error = ErrorProvider.GetError(cbx_Customer);
                MessageBox.Show(str_error);

                ErrorProvider.Clear();
            }
            else
            {
                BLLInvoice obj_BLLInvoice = new BLLInvoice();

                DECustomer customer = new DECustomer();
                DEInvoice  invoice  = new DEInvoice();

                DECatagory category = new DECatagory();

                DateTime dateTime_From = Convert.ToDateTime(dtp_InvoiceDateFrom.Value);
                DateTime dateTime_To   = Convert.ToDateTime(dtp_InvoiceDateTo.Value.Date.AddHours(23.9));

                try
                {
                    customer.Catagory_Id          = Convert.ToInt32(cbx_CustomerGroup.SelectedItem.Col3);
                    customer.Catagory_Description = cbx_CustomerGroup.SelectedText;
                }
                catch (Exception ex)
                {
                    customer.Catagory_Id          = 0;
                    customer.Customer_Description = "";
                }

                try
                {
                    customer.Customer_Id = Convert.ToInt32(cbx_Customer.SelectedItem.Col4);
                }
                catch (Exception ex)
                {
                    customer.Customer_Id = 0;
                }

                try
                {
                    category.Catagory_Id = Convert.ToInt32(cbx_Category.SelectedItem.Col3);
                }
                catch (Exception ex)
                {
                    category.Catagory_Id = 0;
                }

                invoice.Customer_Id           = customer.Customer_Id;
                customer.Customer_Description = cbx_Customer.Text;
                customer.Address = txt_Address.Text;
                customer.Phone   = txt_PhoneNo.Text;

                DataTable dt_Sale   = new DataTable();
                DataTable dt_Return = new DataTable();

                if (rdo_Customer.Checked)
                {
                    dt_Sale   = obj_BLLInvoice.LoadInvoiceDetailTableForAllDataByInvoiceDateCustomerId(invoice.Customer_Id, dateTime_From, dateTime_To, category.Catagory_Id);
                    dt_Return = obj_BLLInvoice.LoadProductReturnSummaryTableForAllDataByInvoiceDateCustomerId(invoice.Customer_Id, dateTime_From, dateTime_To, category.Catagory_Id);
                }
                else
                {
                    dt_Sale   = obj_BLLInvoice.LoadInvoiceDetailTableForAllDataByInvoiceDateCustomerGroupId(customer.Catagory_Id, dateTime_From, dateTime_To, category.Catagory_Id);
                    dt_Return = obj_BLLInvoice.LoadProductReturnSummaryTableForAllDataByInvoiceDateCustomerId(customer.Catagory_Id, dateTime_From, dateTime_To, category.Catagory_Id);
                }

                if (rdo_Sale.Checked == true)
                {
                    bindSaleReport(customer, dt_Sale);
                }
                else
                {
                    bindReturnReport(customer, dt_Return);
                }
            }
        }
        private void bindInvoiceReport()
        {
            DataTable dt_Invoice;
            DataTable dt_InvoiceDetail;
            DataTable dt_InvoiceReturnDetail;

            DEInvoice invoice = new DEInvoice();

            invoice.Invoice_Id = invoice_Id;

            DEInvoiceDetail invoiceDetail = new DEInvoiceDetail();

            invoiceDetail.Invoice_Id = invoice_Id;

            DEInvoiceReturnDetail invoiceReturnDetail = new DEInvoiceReturnDetail();

            invoiceReturnDetail.Invoice_Id = invoice_Id;

            BLLInvoice             obj_BLLInvoice             = new BLLInvoice();
            BLLInvoiceDetail       obj_BLLInvoiceDetail       = new BLLInvoiceDetail();
            BLLInvoiceReturnDetail obj_BLLInvoiceReturnDetail = new BLLInvoiceReturnDetail();

            dt_Invoice             = obj_BLLInvoice.LoadInvoiceTableForAllDataByInvoice_Id(invoice);
            dt_InvoiceDetail       = obj_BLLInvoiceDetail.LoadInvoiceDetailTableForAllDataByInvoiceId(invoiceDetail);
            dt_InvoiceReturnDetail = obj_BLLInvoiceReturnDetail.LoadInvoiceReturnDetailTableForAllDataByInvoiceId(invoiceReturnDetail);

            NumberingTableForDataGridView(dt_InvoiceDetail);
            NumberingTableForDataGridView(dt_InvoiceReturnDetail);

            rptv_ConsignInvoiceReport.Clear();
            rptv_ConsignInvoiceReport.Reset();

            rptv_ConsignInvoiceReport.ProcessingMode = ProcessingMode.Local;

            LocalReport localReport = rptv_ConsignInvoiceReport.LocalReport;

            if (chb_SmallSize.Checked == false)
            {
                localReport.ReportEmbeddedResource = "StockAndSale.WinUI.Reports.Classes.Rpt_ConsignInvoiceReport.rdlc";
            }
            else
            {
                localReport.ReportEmbeddedResource = "StockAndSale.WinUI.Reports.Classes.Rpt_ConsignInvoiceA5Report.rdlc";
            }

            ReportDataSource ds_Invoice = new ReportDataSource();

            ds_Invoice.Name  = "DS_InvoiceReport_dt_Invoice";
            ds_Invoice.Value = dt_Invoice;

            ReportDataSource ds_InvoiceDetail = new ReportDataSource();

            ds_InvoiceDetail.Name  = "DS_InvoiceReport_dt_InvoiceDetail";
            ds_InvoiceDetail.Value = dt_InvoiceDetail;

            ReportDataSource ds_InvoiceReturnDetail = new ReportDataSource();

            ds_InvoiceReturnDetail.Name  = "DS_InvoiceReport_dt_InvoiceReturnDetail";
            ds_InvoiceReturnDetail.Value = dt_InvoiceReturnDetail;

            ReportParameter parTotal = new ReportParameter();

            parTotal.Name = "parTotal";

            ReportParameter parAdvance = new ReportParameter();

            parAdvance.Name = "parAdvance";

            ReportParameter parDiscount = new ReportParameter();

            parDiscount.Name = "parDiscount";

            ReportParameter parCommercialTax = new ReportParameter();

            parCommercialTax.Name = "parCommercialTax";

            ReportParameter parDeliveryDiscount = new ReportParameter();

            parDeliveryDiscount.Name = "parDeliveryDiscount";

            ReportParameter parReturnAmount = new ReportParameter();

            parReturnAmount.Name = "parReturnAmount";

            ReportParameter parDifferenceTotal = new ReportParameter();

            parDifferenceTotal.Name = "parDifferenceTotal";

            ReportParameter parGrandTotal = new ReportParameter();

            parGrandTotal.Name = "parGrandTotal";

            ReportParameter parInvoiceNo = new ReportParameter();

            parInvoiceNo.Name = "parInvoiceNo";

            ReportParameter parInvoiceDate = new ReportParameter();

            parInvoiceDate.Name = "parInvoiceDate";

            ReportParameter parCustomerName = new ReportParameter();

            parCustomerName.Name = "parCustomerName";

            ReportParameter parCustomerShop = new ReportParameter();

            parCustomerShop.Name = "parCustomerShop";

            ReportParameter parAddress = new ReportParameter();

            parAddress.Name = "parAddress";

            ReportParameter parPhone = new ReportParameter();

            parPhone.Name = "parPhone";

            ReportParameter parPONumber = new ReportParameter();

            parPONumber.Name = "parPONumber";

            ReportParameter parPromDesc = new ReportParameter();

            parPromDesc.Name = "parPromDesc";

            ReportParameter parIsPromotion = new ReportParameter();

            parIsPromotion.Name = "parIsPromotion";

            ReportParameter parPaymentStatus = new ReportParameter();

            parPaymentStatus.Name = "parPaymentStatus";

            ReportParameter parPaymentDate = new ReportParameter();

            parPaymentDate.Name = "parPaymentDate";

            ReportParameter parInvoiceDueDate = new ReportParameter();

            parInvoiceDueDate.Name = "parInvoiceDueDate";

            ReportParameter parShowReturn = new ReportParameter();

            parShowReturn.Name = "parShowReturn";

            ReportParameter parShow = new ReportParameter();

            parShow.Name = "parShowLetterHead";
            parShow.Values.Add(chb_ShowLetterHead.Checked.ToString());

            ReportParameter parShowFooter = new ReportParameter();

            parShowFooter.Name = "parShowLetterFooter";
            parShowFooter.Values.Add(chb_ShowLetterFooter.Checked.ToString());

            if (chb_Return.Checked == true)
            {
                parShowReturn.Values.Add("true");
            }
            else
            {
                parShowReturn.Values.Add("false");
            }

            Boolean bool_HasRow = obj_BLLInvoice.LoadInvoiceRow(invoice);

            if (true)
            {
                if (invoice.isPaid == true)
                {
                    parPaymentStatus.Values.Add("Paid on :");
                    parPaymentDate.Values.Add(invoice.PayDate.ToLongDateString());
                }
                else
                {
                    parPaymentStatus.Values.Add("No Paid :");
                    parPaymentDate.Values.Add("");
                }

                parInvoiceDueDate.Values.Add(invoice.Invoice_Due_Date.ToString());
                parTotal.Values.Add(invoice.Total.ToString());
                parAdvance.Values.Add(invoice.Advance.ToString());
                parDiscount.Values.Add(invoice.Discount.ToString());
                parCommercialTax.Values.Add(invoice.CommercialTax.ToString());
                parDeliveryDiscount.Values.Add(invoice.DeliveryDiscount.ToString());
                parGrandTotal.Values.Add(invoice.GrandTotal.ToString());

                parInvoiceNo.Values.Add(invoice.Invoice_No.ToString());
                parInvoiceDate.Values.Add(invoice.Invoice_Date.ToString());
                parCustomerName.Values.Add(invoice.Customer_Name);
                parCustomerShop.Values.Add(invoice.Customer_Description);
                parAddress.Values.Add(invoice.Address);
                parPhone.Values.Add(invoice.Phone);
                parPONumber.Values.Add(invoice.PONumber);
                parPromDesc.Values.Add(invoice.PromDesc);
                parIsPromotion.Values.Add(invoice.IsPromotion.ToString());

                Decimal dec_RetTotal  = 0;
                Decimal dec_DiffTotal = 0;

                for (int i = 0; i < dt_InvoiceReturnDetail.Rows.Count; i++)
                {
                    dec_RetTotal += Convert.ToDecimal(dt_InvoiceReturnDetail.Rows[i]["RAmount"].ToString());
                }

                if (dec_RetTotal != 0)
                {
                    dec_DiffTotal = invoice.GrandTotal - dec_RetTotal;
                }

                parReturnAmount.Values.Add(dec_RetTotal.ToString());
                parDifferenceTotal.Values.Add(dec_DiffTotal.ToString());
            }

            rptv_ConsignInvoiceReport.LocalReport.SetParameters(new ReportParameter[] { parTotal, parAdvance, parDiscount, parGrandTotal, parInvoiceNo, parInvoiceDate, parCustomerName, parCustomerShop, parAddress, parPhone, parInvoiceDueDate, parPaymentStatus, parPaymentDate, parShowReturn, parShow, parShowFooter, parPONumber, parPromDesc, parIsPromotion, parDeliveryDiscount, parCommercialTax, parReturnAmount, parDifferenceTotal }); // parPaymentStatus, parPaymentDate, parInvoiceDueDate });

            localReport.DataSources.Add(ds_InvoiceDetail);
            localReport.DataSources.Add(ds_Invoice);
            localReport.DataSources.Add(ds_InvoiceReturnDetail);

            rptv_ConsignInvoiceReport.RefreshReport();
        }
Ejemplo n.º 10
0
        private void bindCashInvoiceReport()
        {
            DataTable dt_Invoice;
            DataTable dt_InvoiceDetail;

            DEInvoice invoice = new DEInvoice();

            invoice.Invoice_Id = invoice_Id;

            DEInvoiceDetail invoiceDetail = new DEInvoiceDetail();

            invoiceDetail.Invoice_Id = invoice_Id;

            BLLInvoice       obj_BLLInvoice       = new BLLInvoice();
            BLLInvoiceDetail obj_BLLInvoiceDetail = new BLLInvoiceDetail();

            dt_Invoice       = obj_BLLInvoice.LoadInvoiceTableForAllDataByInvoice_Id(invoice);
            dt_InvoiceDetail = obj_BLLInvoiceDetail.LoadInvoiceDetailTableForAllDataByInvoiceId(invoiceDetail);

            NumberingTableForDataGridView(dt_InvoiceDetail);

            rptv_CashInvoiceReport.Clear();
            rptv_CashInvoiceReport.Reset();

            rptv_CashInvoiceReport.ProcessingMode = ProcessingMode.Local;

            LocalReport localReport = rptv_CashInvoiceReport.LocalReport;

            if (chb_SmallSize.Checked == false)
            {
                localReport.ReportEmbeddedResource = "StockAndSale.WinUI.Reports.Classes.Rpt_CashInvoiceReport.rdlc";
            }
            else
            {
                localReport.ReportEmbeddedResource = "StockAndSale.WinUI.Reports.Classes.Rpt_CashInvoiceA5Report.rdlc";
            }

            ReportDataSource ds_Invoice = new ReportDataSource();

            ds_Invoice.Name  = "DS_InvoiceReport_dt_Invoice";
            ds_Invoice.Value = dt_Invoice;

            ReportDataSource ds_InvoiceDetail = new ReportDataSource();

            ds_InvoiceDetail.Name  = "DS_InvoiceReport_dt_InvoiceDetail";
            ds_InvoiceDetail.Value = dt_InvoiceDetail;

            ReportParameter parTotal = new ReportParameter();

            parTotal.Name = "parTotal";

            ReportParameter parAdvance = new ReportParameter();

            parAdvance.Name = "parAdvance";

            ReportParameter parDiscount = new ReportParameter();

            parDiscount.Name = "parDiscount";

            ReportParameter parCommercialTax = new ReportParameter();

            parCommercialTax.Name = "parCommercialTax";

            ReportParameter parDeliveryDiscount = new ReportParameter();

            parDeliveryDiscount.Name = "parDeliveryDiscount";

            ReportParameter parGrandTotal = new ReportParameter();

            parGrandTotal.Name = "parGrandTotal";

            ReportParameter parInvoiceNo = new ReportParameter();

            parInvoiceNo.Name = "parInvoiceNo";

            ReportParameter parInvoiceDate = new ReportParameter();

            parInvoiceDate.Name = "parInvoiceDate";

            ReportParameter parCustomerName = new ReportParameter();

            parCustomerName.Name = "parCustomerName";

            ReportParameter parCustomerShop = new ReportParameter();

            parCustomerShop.Name = "parCustomerShop";

            ReportParameter parAddress = new ReportParameter();

            parAddress.Name = "parAddress";

            ReportParameter parPhone = new ReportParameter();

            parPhone.Name = "parPhone";

            ReportParameter parPONumber = new ReportParameter();

            parPONumber.Name = "parPONumber";

            ReportParameter parPromDesc = new ReportParameter();

            parPromDesc.Name = "parPromDesc";

            ReportParameter parIsPromotion = new ReportParameter();

            parIsPromotion.Name = "parIsPromotion";

            ReportParameter parShow = new ReportParameter();

            parShow.Name = "parShowLetterHead";
            parShow.Values.Add(chb_ShowLetterHead.Checked.ToString());

            ReportParameter parShowFooter = new ReportParameter();

            parShowFooter.Name = "parShowLetterFooter";
            parShowFooter.Values.Add(chb_ShowLetterFooter.Checked.ToString());

            Boolean bool_HasRow = obj_BLLInvoice.LoadInvoiceRow(invoice);

            if (true)
            {
                parTotal.Values.Add(invoice.Total.ToString());
                parAdvance.Values.Add(invoice.Advance.ToString());
                parDiscount.Values.Add(invoice.Discount.ToString());
                parCommercialTax.Values.Add(invoice.CommercialTax.ToString());
                parDeliveryDiscount.Values.Add(invoice.DeliveryDiscount.ToString());
                parGrandTotal.Values.Add(invoice.GrandTotal.ToString());

                parInvoiceNo.Values.Add(invoice.Invoice_No.ToString());
                parInvoiceDate.Values.Add(invoice.Invoice_Date.ToString());
                parCustomerName.Values.Add(invoice.Customer_Name);
                parCustomerShop.Values.Add(invoice.Customer_Description);
                parAddress.Values.Add(invoice.Address);
                parPhone.Values.Add(invoice.Phone);
                parPONumber.Values.Add(invoice.PONumber);
                parPromDesc.Values.Add(invoice.PromDesc);
                parIsPromotion.Values.Add(invoice.IsPromotion.ToString());
            }


            rptv_CashInvoiceReport.LocalReport.SetParameters(new ReportParameter[] { parTotal, parAdvance, parDiscount, parGrandTotal, parInvoiceNo, parInvoiceDate, parCustomerName, parCustomerShop, parAddress, parPhone, parShow, parShowFooter, parPONumber, parPromDesc, parIsPromotion, parDeliveryDiscount, parCommercialTax });

            localReport.DataSources.Add(ds_InvoiceDetail);
            localReport.DataSources.Add(ds_Invoice);

            rptv_CashInvoiceReport.RefreshReport();
        }