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); }
private static Print_LabourList ReturnLabour(string Id, List <PrintCopies> printcopies) { Const.Labour invoice = CLabour_exten.PKId(Id); List <Labouritems> invoiceitems = CLabouritems_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_LabourList list = new Print_LabourList(); for (int i = 0; i < printcopies.Count; i++) { Print_Labour row = new Print_Labour(); 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.LABOUR_ID = invoice.Labour_id; row.LABOUR_NO = ":. " + invoice.Labour_no; row.LABOUR_DATE = ": " + ConvertTO.Date2S(invoice.Labour_date); row.TRANSPORT = ": " + invoice.Transport_id; row.DELIVERYTO = ": " + invoice.Deliveredto_id; row.BUNDEL = ": " + invoice.Bundel; 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); }