private void ShowORGDetails() { string orgName = "", orgAddress = "", orgLegalNos = "", orgStateCode = "", orgState = ""; ORG_Tools.GetORGDetails(out orgName, out orgAddress, out orgLegalNos, out orgStateCode, out orgState); lblOrgNAme.Text = orgName; lblAddressORG.Text = orgAddress; lblORGLegalNos.Text = orgLegalNos; lblOrgStateCode.Text = orgStateCode; lblOrgState.Text = orgState; //lblOrgNAme.Text = ORG_Tools._OrganizationName; //lblAddressORG.Text = INVOICE_TOOLS._IsOrgAddress ? ORG_Tools._Address + " \n" : ""; //lblAddressORG.Text += INVOICE_TOOLS._IsOrgCityTown ? ORG_Tools._CityTown + ", " : ""; //lblAddressORG.Text += INVOICE_TOOLS._IsOrgDistrict ? ORG_Tools._Dist + " \n" : ""; //lblAddressORG.Text += INVOICE_TOOLS._IsOrgState ? ORG_Tools._State + ", " : ""; //lblAddressORG.Text += INVOICE_TOOLS._IsOrgPin ? ORG_Tools._PIN + " \n" : ""; //lblAddressORG.Text += INVOICE_TOOLS._IsOrgContactNo ? ORG_Tools._ContactNo1 + " \n" : ""; //lblAddressORG.Text += INVOICE_TOOLS._IsOrgMailID ? ORG_Tools._Email + " " : ""; //lblAddressORG.Text = lblAddressORG.Text + "\nState :" + ORG_Tools._StateCode + "-" + ORG_Tools._State; //lblORGLegalNos.Text = INVOICE_TOOLS._IsOrgGSTIN ? "GSTIN : " + ORG_Tools._GSTin + " \n" : ""; //lblORGLegalNos.Text += INVOICE_TOOLS._IsOrgCIN ? "CIN : " + ORG_Tools._CorporateNo + " \n" : ""; //lblORGLegalNos.Text += INVOICE_TOOLS._IsOrgPAN ? "PAN : " + ORG_Tools._PAN + " \n" : ""; //lblOrgStateCode.Text = ORG_Tools._StateCode; //lblOrgState.Text = ORG_Tools._State; }
private void GenerateRegularTaxInvoice() { _DtSet.Tables["ItemDetails"].Rows.Clear(); _DtSet.Tables["InvoiceDetailsFooter"].Rows.Clear(); _DtSet.Tables["InvoiceDetailsAmounts"].Rows.Clear(); _DtSet.Tables["InvoiceDetailsHeader"].Rows.Clear(); string query = "SELECT SlNo, InvoiceNo, convert(varchar(11),InvoiceDate,106) as InvoiceDate, " + "LedgerId, BillingTerms, convert(varchar(11),DueDate,106) as DueDate, " + "BillingTo, BillingAddress, BillingGSTNO, BillingState, BillingStateCode, BuyerOrderNo, " + "convert(varchar(11),BuyerOrderDate,106) as BuyerOrderDate, ChallanNo, " + "convert(varchar(11),ChallanDate,106) as ChallanDate, DispatchThrough, VehiclaNo, " + "ShippingTo,ShippingAddress, ShippingState, ShippingStateCode,TotalQty, TotalAmount, " + "TotalDiscount, TotalTaxAmount, TotalCGST, TotalSGST, TotalIGST, TotalCess, NetAmount, " + "FreightChargs,PackingCharges, OtherCharges, OverAllDiscount,TotalInvoiceAmount, Note,RCM,InvoiceType from Invoice " + "where InvoiceNo = '" + mInvoiceNo + "'"; DataTable dt0 = SQLHelper.GetInstance().ExcuteNonQuery(query, out msg); if (dt0.IsValidDataTable()) { string orgName = "", orgAddress = "", orgLegalNos = "", orgStateCode = "", orgState = ""; ORG_Tools.GetORGDetails(out orgName, out orgAddress, out orgLegalNos, out orgStateCode, out orgState); _DtSet.Tables["InvoiceDetailsHeader"].Rows.Add(orgName, orgAddress, orgStateCode, orgState, orgLegalNos, ORG_Tools._LogoByte, dt0.Rows[0]["InvoiceNo"], dt0.Rows[0]["InvoiceDate"], dt0.Rows[0]["ChallanNo"], dt0.Rows[0]["ChallanDate"], dt0.Rows[0]["BuyerOrderNo"], dt0.Rows[0]["BuyerOrderDate"], dt0.Rows[0]["BillingTerms"], dt0.Rows[0]["DueDate"], dt0.Rows[0]["DispatchThrough"], dt0.Rows[0]["VehiclaNo"], dt0.Rows[0]["BillingTo"], dt0.Rows[0]["BillingAddress"], dt0.Rows[0]["BillingGSTNO"], dt0.Rows[0]["BillingStateCode"], dt0.Rows[0]["BillingState"], dt0.Rows[0]["ShippingTo"], dt0.Rows[0]["ShippingAddress"], dt0.Rows[0]["ShippingStateCode"], dt0.Rows[0]["ShippingState"], mInvoiceCopyText); //Billing and shipped details _DtSet.Tables["InvoiceDetailsAmounts"].Rows.Add(orgName, dt0.Rows[0]["TotalQty"], dt0.Rows[0]["TotalDiscount"], dt0.Rows[0]["TotalAmount"], dt0.Rows[0]["TotalTaxAmount"], dt0.Rows[0]["TotalCGST"], dt0.Rows[0]["TotalSGST"], dt0.Rows[0]["TotalIGST"], dt0.Rows[0]["TotalCess"], dt0.Rows[0]["NetAmount"], dt0.Rows[0]["TotalInvoiceAmount"], dt0.Rows[0]["FreightChargs"], dt0.Rows[0]["PackingCharges"], dt0.Rows[0]["OtherCharges"], dt0.Rows[0]["OverAllDiscount"], dt0.Rows[0]["RCM"]); ///Footer _DtSet.Tables["InvoiceDetailsFooter"].Rows.Add(orgName, INVOICE_TOOLS._DeclarationText, "", INVOICE_TOOLS._OrgBankDetailsText, INVOICE_TOOLS._OrgTermsAndConditionText, INVOICE_TOOLS._SignatureForText, INVOICE_TOOLS._SignatureAuthorityText); /////invoice item details query = "SELECT * from InvoiceDetails where InvoiceNo='" + mInvoiceNo + "'"; DataTable dt = SQLHelper.GetInstance().ExcuteNonQuery(query, out msg); if (dt.IsValidDataTable()) { foreach (DataRow item in dt.Rows) { object cess = item["CeassAmount"]; _DtSet.Tables["ItemDetails"].Rows.Add(orgName, item["ItemName"], item["HSNCode"], item["Quantity"], item["Unit"], item["Rate"], item["Amount"], item["DiscountRate"], item["DiscountAmount"], item["TaxAmount"], item["CGSTRate"], item["CGSTAmount"], item["SGSTRate"], item["SGSTAmount"], item["IGSTRate"], item["IGSTAmount"], item["CessRate"], cess, item["Total"]); if (cess.ISValidObject() && !isCess) { isCess = true; } } } ///Clarify Invoice type #region Invoice Type string invoiceType = dt0.Rows[0]["InvoiceType"].ToString(); string placeOfsuppllyState = dt0.Rows[0]["BillingState"].ToString(); if (invoiceType == "Regular") { if (ORG_Tools._State == placeOfsuppllyState) { if (isCess) { mInvoiceType = _InvoiceType.CGST_SGST_W_Cess; } else { mInvoiceType = _InvoiceType.CGST_SGST_WO_Cess; } } else { if (isCess) { mInvoiceType = _InvoiceType.IGST_O_Cess; } else { mInvoiceType = _InvoiceType.IGST_WO_Cess; } } } else { mInvoiceType = _InvoiceType.BillOfSupply; } #endregion //Organization details } }