private void preformInvoice() { int cost = totalDaysRented * 30; SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.DefaultExt = "pdf"; saveFileDialog.Filter = "PDF files (*.pdf)|*.pdf"; saveFileDialog.ShowDialog(); string filePath = saveFileDialog.FileName; string[] name = new string[4] { "Kia of Hamilton", "1885 Upper James Street", "Hamilton, Ontario, Cananada", "L9B1B8" }; string[] customer = new string[4] { txtfname.Text + " " + txtlname.Text, txtAddress.Text, cmbCity.Items[cmbCity.SelectedIndex] + ", " + cmbProvince.Items[cmbProvince.SelectedIndex], txtPhone.Text }; new InvoicerApi(SizeOption.A4, OrientationOption.Portrait, "$") .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(@"logo.jpg", 90, 80) .Company(Address.Make("FROM", name)) .Client(Address.Make("BILLING TO", customer)) .Items(new List <ItemRow> { ItemRow.Make("2018 Soul", "Car rental", totalDaysRented, 30, cost), }) .Totals(new List <TotalRow> { TotalRow.Make("Total", cost, true), }) .Details(new List <DetailRow> { DetailRow.Make("RENTAL INFORMATION", "\n1. I am the only driver authorized by Kia of Hamilton to operate the Vehicle unless others are listed below. The Vehicle is in good and safe mechanical condition and I shall return the Vehicle in the same condition. If applicable, list other authorized drivers here . \n\n 2. I shall obey all Federal, Provincial and Municipal laws, rules and regulations relating to the operation and use of the Vehicle and I shall indemnify Kia of Hamilton for any infractions of such laws, rules and regulations.\n\n 3. I shall pay for all loss or damage to the Vehicle whether or not caused by my negligence. \n\n 4. I have confirmed with my insurance company that this Vehicle is covered under my insurance policy as a substitute vehicle. Insurance Company Name: Policy Number: . \n\n 5. For consideration in the amount of $10.00 which is acknowledged to have been received by Kia of Hamilton, the Vehicle shall be considered to be a Leased Vehicle and I and any other authorized drivers of the Vehicle ('Authorized Drivers') shall be considered to be Lessees for the purposes of determining the order of third party liability established by Section 277 of the Insurance Act R.S.O. 1990, c. I. 8.\n\n 6. I understand that I am being provided with the Vehicle for normal personal use only and will not allow the Vehicle to be used for commercial purposes or for hire, or for any illegal purpose. \n\n 7. During the time that I am authorized to use the Vehicle I shall not operate it in an area outside a 100 km radius from Kia of Hamilton’s location and in no event shall I allow the Vehicle to be driven outside of Ontario without the express written consent of Kia of Hamilton. A charge of 10 cents per km will apply if the Vehicle is driven more than km per day that I am in possession of the Vehicle. \n\n 8. I shall be responsible to pay all fees, tolls and costs of operating the Vehicle while in my custody and shall return the Vehicle with a full tank of gas at my expense. \n\n 9. I shall indemnify Kia of Hamilton against all other liabilities, losses, costs, damages, fines, fees, tolls and expenses of any kind arising while the Vehicle is in my custody. \n\n 10. I shall return the Vehicle to the location where I received it no later than or forthwith upon demand.\n\n 11. I agree to provide Kia of Hamilton with a credit card imprint in my name which I hereby authorize to be processed for a deposit immediately of $ and any additional sum for which I might become liable under this authorization.\n\n 12. Card Number: " + txtCC.Text + " Expiry: " + txtMM.Text + "/" + txtYY.Text + " CVC: " + txtCVV.Text + " \nI agree to pay and authorize Kia of Hamilton to process any applicable credit card voucher for advance deposits and all charges incurred including parking violations, traffic violations, toll charges, damages to and theft of the Vehicle. \n\n 13. I acknowledge, in providing a copy of my driver’s licence and number that Kia of Hamilton at its discretion will run a driver’s abstract to ensure that I am legally permitted to operate the Vehicle. \n\n", "", "", "Thank you for your business.") }) .Footer("http://www.kiaofhamilton.com | The Power to Surprise") .Save(filePath); Process.Start(filePath); }
public void Go(Venta v) { List <ItemRow> lstItems = new List <ItemRow>(); foreach (ProductoVendido pv in v.LstProductosVendidos) { lstItems.Add(ItemRow.Make(pv.Producto.Descripcion, pv.Producto.Marca.Descripcion, (decimal)pv.Cantidad, (decimal)pv.PrecioU, (decimal)pv.PrecioT)); } new InvoicerApi(v.IdVenta, v.FechaVenta, SizeOption.A4, OrientationOption.Portrait, "$") .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(@"..\..\images\veggiestuff.jpg", 135, 25) .Company(Address.Make("DATOS VENDEDOR", new string[] { "Veggie Stuff", "Av. Mitre 2425", "Vicente Lopez", "Buenos Aires" }, "", "")) .Client(Address.Make("DATOS CLIENTE", new string[] { v.Cliente.NombreCompleto })) .Items(lstItems) .Totals(new List <TotalRow> { TotalRow.Make("Total", (decimal)v.Monto, true), }) .Details(new List <DetailRow> { DetailRow.Make("INFORMACIÓN DE PAGO", "Destinar cheques a Veggie Stuff Incorporated.", "", "Por cualquier consulta puede contactarnos mediante correo electronico a [email protected]", "", "Gracias por su compra.") }) .Footer("http://www.veggiestuff.com.ar") .Save(); }
public void PrintInvoice() { new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "NGN") .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(@"vodafone.jpg", 125, 32) .Company(Address.Make("FROM", new string[] { "Vodafone Limited", "Vodafone House", "The Connection", "Newbury", "Berkshire RG14 2FN" }, "1471587", "569953277")) .Client(Address.Make("BILLING TO", new string[] { "Isabella Marsh1", "Overton Circle", "Little Welland", "Worcester", "WR## 2DJ" })) .Items(new List <ItemRow> { ItemRow.Make("Nexus 6", "Midnight Blue", (decimal)1, 20, (decimal)166.66, (decimal)199.99), ItemRow.Make("24 Months (£22.50pm)", "100 minutes, Unlimited texts, 100 MB data 3G plan with 3GB of UK Wi-Fi", (decimal)1, 20, (decimal)360.00, (decimal)432.00), ItemRow.Make("Special Offer", "Free case (blue)", (decimal)1, 0, (decimal)0, (decimal)0), }) .Totals(new List <TotalRow> { TotalRow.Make("Sub Total", (decimal)526.66), TotalRow.Make("VAT @ 20%", (decimal)105.33), TotalRow.Make("Total", (decimal)631.99, true), }) .Details(new List <DetailRow> { DetailRow.Make("PAYMENT INFORMATION", "Make all cheques payable to Vodafone UK Limited.", "", "If you have any questions concerning this invoice, contact our sales department at [email protected].", "", "Thank you for your business.") }) .Footer("http://www.vodafone.co.uk") //.Save(); .Save(@"C:\NewProjects\Juju\", 0); }
/// <summary> /// Generates the test with discount and without VAT. /// </summary> public void GenerateTestWithoutVATAndWithDiscount() { new InvoiceSharpApi(SizeOption.A4, OrientationOption.Portrait, "€") .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(@"..\..\..\images\vodafone.jpg", 125, 27) .Company(Address.Make("FROM", new string[] { "Vodafone Limited", "Vodafone House", "The Connection", "Newbury", "Berkshire RG14 2FN" }, "1471587", null)) .Client(Address.Make("BILLING TO", new string[] { "Isabella Marsh", "Overton Circle", "Little Welland", "Worcester", "WR## 2DJ" })) .Items(new List <ItemRow> { ItemRow.Make("Nexus 6", "Midnight Blue", (decimal)1, 0, (decimal)199.99, (decimal)199.99), ItemRow.Make("24 Months (€22.50pm)", "100 minutes, Unlimited texts, 100 MB data 3G plan with 3GB of UK Wi-Fi", (decimal)1, (decimal)432.00, (decimal)432.00), ItemRow.Make("Special Offer", "Free case (blue)", (decimal)1, (decimal)0, (decimal)0), ItemRow.Make("Test", "This needs improving", (decimal)1, (decimal)10, "-5.00", (decimal) - 5), }) .Totals(new List <TotalRow> { TotalRow.Make("Total", (decimal)626.99, true), }) .Details(new List <DetailRow> { DetailRow.Make("PAYMENT INFORMATION", "Make all cheques payable to Vodafone UK Limited.", "", "If you have any questions concerning this invoice, contact our sales department at [email protected].", "", "Thank you for your business.") }) .Footer("http://www.vodafone.co.uk") .Save("NonVAT_Discount.pdf"); }
/// <summary> /// Generates the test without VAT or discount. /// </summary> public void GenerateTestEucaly() { byte[] image = LoadImage("eucaly.jpg"); string imageFilename = MigraDocFilenameFromByteArray(image); var invoice = new InvoiceSharpApi(SizeOption.A4, OrientationOption.Portrait, "€") .TextColor("#057a55") .BackColor("#F7FAFC") .Image(imageFilename, 70, 70) .Title("FACTURE N° " + 12) .OrderReference("ORDER ID") .Company(Address.Make( "FROM", new string[] { "Test Limited", "Test House", "Rue de la paix", "Paris", "CEDEX 15" }, "1471587", "569953277", new string[] { "Vodafone Limited. Registered in England and Wales No. 1471587.", "Registered office: Vodafone House, The Connection, Newbury, Berkshire RG14 2FN." })) .Client(Address.Make("INVOICE TO", new string[] { "Isabella Marsh", "Overton Circle", "Little Welland", "Worcester", "WR## 2DJ" })) .Items(GenerateFakeDate()) .Totals(new List <TotalRow> { TotalRow.Make("Sous Total", (decimal)631.99, true), TotalRow.Make("Total TVA 20%", (decimal)20.99, true), TotalRow.Make("Coupon NOMDECOUPONBEAUCOUP", (decimal)20.99, true), TotalRow.Make("dont Total TVA Réduite (10%)", (decimal)12.99, true, true), TotalRow.Make("dont Total TVA Livraison (10%)", (decimal)12.99, true, true), TotalRow.Make("Grand Total", (decimal)800.99, true), }) .Details(new List <DetailRow> { DetailRow.Make("NOTES", "Payé par Stripe", "N'hésitez pas à nous contacter pour toutes questions ou toutes nouvelles commandes", "Merci et à très vite !") }) .BillingDate(DateTime.Now) .PayedDate(DateTime.Now) .IsUnpaid(false); using (var stream = invoice.Get()) { using (var fs = new FileStream("fs.pdf", FileMode.Create)) { stream.CopyTo(fs); } } }
public ActionResult createinvoice(Guid id) { if (id == null) { return(new HttpNotFoundResult("Geçersiz fatura numarası")); } if (id == Guid.Empty) { return(new HttpNotFoundResult("Geçersiz fatura numarası")); } Siparisler result = _siparis.Find(id); if (result == null) { return(new HttpNotFoundResult("Böyle bir sipariş bulunamadı.")); } SirketBilgiTB sirket = _sirket.Find(); string fatid = Guid.NewGuid().ToString().Replace("-", "").ToUpper(); List <ItemRow> aciklamalar = new List <ItemRow>(); aciklamalar.Add(ItemRow.Make("Günlük Yemek Ücreti", $"{result.Yemek.YemekAdi} {result.Yemek.PorsiyonGr} gr,{result.YemekSayisi} kişilik,sipariş trh:{result.SiparisTarihi.ToShortDateString()}", result.YemekSayisi, 8.0m, result.Musteri.GunlukYemekFiyati, decimal.Parse(result.Odeme.OdemeTutari))); new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "₺") .TextColor("#8C2234") .BackColor("#FFD6CC").Title($"Günlük Yemek Faturası") .Image(HttpContext.Server.MapPath("~/Content/assets/images/ikra/logo.png"), 127, 85) .Company(Address.Make($"ÖDEME YAPAN", new string[] { result.Musteri.FirmaAdSoyad, result.Musteri.Telefon, result.Musteri.Email, result.Musteri.FirmaAdres })) .Client(Address.Make($"ÖDEME ALAN", new string[] { sirket.Name, sirket.Phone, sirket.VATNo, sirket.Address }, sirket.Name, sirket.VATNo)) .Items(aciklamalar) .DueDate(result.Odeme.OdemeTarihi) .Totals(new List <TotalRow> { TotalRow.Make("Ara Toplam(Kesinti)", 0m), TotalRow.Make("Toplam Ödenen Ücret", decimal.Parse(result.Odeme.OdemeTutari), true), }) .Details(new List <DetailRow> { DetailRow.Make("Yemek Ücreti Faturası", $"Müşterimiz {result.Musteri.FirmaAdSoyad}'nın günlük yemek ücreti için verilen faturadır") }) .Footer("http://www.ikrayemek.com.tr") .Reference(fatid.Substring(0, 15)) .Save(HttpContext.Server.MapPath("~/Content/") + fatid + ".pdf"); byte[] fileBytes = System.IO.File.ReadAllBytes(HttpContext.Server.MapPath("~/Content/") + fatid + ".pdf"); string fileName = $"IKRAYEMEK{result.SiparisTarihi.Year}{result.SiparisTarihi.Month}{result.SiparisTarihi.Day}{result.SiparisTarihi.Hour}{result.SiparisTarihi.Minute}{result.SiparisTarihi.Second}-FATURA.pdf"; return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Pdf, fileName)); return(File("", "")); }
public void Go(DataTable dt, string BillNumber) { new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "RS.", BillNumber) .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(@"..\..\image\sss_logo.png", 125, 27) .Company(Address.Make("FROM", new string[] { "SSS AGENCY", "MANGALAM", "PERAMBALUR", "PH : 99947 05803", "GSTIN : 33CXJPS0061H1ZJ" }, "GSTIN : 33CXJPS0061H1ZJ", "")) .Client(Address.Make("BILLING TO", GetCustomerName(dt))) .Items(GetItemRows(dt)) .Totals(GetTotalRow(dt)) .Details(new List <DetailRow> { DetailRow.Make("PAYMENT INFORMATION", "Make all cheques payable to SSS Agency.", "", "If you have any questions concerning this invoice.", "", "Thank you for your business.") }) .Footer("SSS Agency") .Save(); }
/// <summary> /// Generates the test without VAT or discount. /// </summary> public void GenerateTestWithoutVAT() { byte[] image = LoadImage("vodafone.jpg"); string imageFilename = MigraDocFilenameFromByteArray(image); var invoice = new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "£") .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(imageFilename, 125, 27) .Company(Address.Make( "FROM", new string[] { "Vodafone Limited", "Vodafone House", "The Connection", "Newbury", "Berkshire RG14 2FN" }, "1471587", null, new string[] { "Vodafone Limited. Registered in England and Wales No. 1471587.", "Registered office: Vodafone House, The Connection, Newbury, Berkshire RG14 2FN." })) .Client(Address.Make("INVOICE TO", new string[] { "Isabella Marsh", "Overton Circle", "Little Welland", "Worcester", "WR## 2DJ" })) .Items(new List <ItemRow> { ItemRow.Make("Nexus 6", "Midnight Blue", (decimal)1, (decimal)199.99, (decimal)199.99), ItemRow.Make("24 Months (£22.50pm)", "100 minutes, Unlimited texts, 100 MB data 3G plan with 3GB of UK Wi-Fi", (decimal)1, (decimal)432.00, (decimal)432.00), ItemRow.Make("Special Offer", "Free case (blue)", (decimal)1, (decimal)0, (decimal)0), }) .Totals(new List <TotalRow> { TotalRow.Make("Total", (decimal)631.99, true), }) .Details(new List <DetailRow> { DetailRow.Make("PAYMENT INFORMATION", "Make all cheques payable to Vodafone UK Limited.", "", "If you have any questions concerning this invoice, contact our sales department at [email protected].", "", "Thank you for your business.") }) .Footer("http://www.vodafone.co.uk"); using (var stream = invoice.Get()) { using (var fs = new FileStream("fs.pdf", FileMode.Create)) { stream.CopyTo(fs); } } }
public void GeneratePdf(int idconsultation) { new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "CHF") .TextColor("#CC0000") .BackColor("#FFD6CC") .Items(new List <ItemRow> { ItemRow.Make("Nexus 6", "Midnight Blue", (decimal)1, 20, (decimal)166.66, (decimal)199.99), ItemRow.Make("24 Months (£22.50pm)", "100 minutes, Unlimited texts, 100 MB data 3G plan with 3GB of UK Wi-Fi", (decimal)1, 20, (decimal)360.00, (decimal)432.00), ItemRow.Make("Special Offer", "Free case (blue)", (decimal)1, 0, (decimal)0, (decimal)0), }) .Totals(new List <TotalRow> { TotalRow.Make("Sub Total", (decimal)526.66), TotalRow.Make("VAT @ 20%", (decimal)105.33), TotalRow.Make("Total", (decimal)631.99, true), }) .Details(new List <DetailRow> { DetailRow.Make("INFORMATIONS De payement", "Make all cheques payable to Vodafone UK Limited.", "", "If you have any questions concerning this invoice, contact our sales department at [email protected].", "", "Thank you for your business.") }) .Footer("http://www.vodafone.co.uk") .Save(); }
///<summary>Creates invoice.pdf file with reservation details, saves it and opens it</summary> public static void CreatePdfDocument(int lasku_id) { ConnectionUtils.OpenConnection(); string fileSaveLocation = Path.GetDirectoryName(Application.ExecutablePath) + "\\invoice.pdf"; //Next to .exe file //Customer name string query = "SELECT CONCAT(a.etunimi, ' ', a.sukunimi) AS nimi " + "FROM lasku l " + "JOIN varaus v ON l.varaus_id = v.varaus_id " + "JOIN asiakas a ON v.asiakas_id = a.asiakas_id " + "WHERE l.lasku_id = " + lasku_id + ";"; MySqlCommand cmd = new MySqlCommand(query, ConnectionUtils.connection); string customerName = cmd.ExecuteScalar().ToString(); //Customer address query = "SELECT a.lahiosoite " + "FROM lasku l " + "JOIN varaus v ON l.varaus_id = v.varaus_id " + "JOIN asiakas a ON v.asiakas_id = a.asiakas_id " + "WHERE l.lasku_id = " + lasku_id + ";"; cmd = new MySqlCommand(query, ConnectionUtils.connection); string customerAddress = cmd.ExecuteScalar().ToString(); //Customer zip code query = "SELECT CONCAT(a.postinro, ' ', p.toimipaikka) AS posti " + "FROM lasku l " + "JOIN varaus v ON l.varaus_id = v.varaus_id " + "JOIN asiakas a ON v.asiakas_id = a.asiakas_id " + "JOIN posti p ON a.postinro = p.postinro " + "WHERE l.lasku_id = " + lasku_id + ";"; cmd = new MySqlCommand(query, ConnectionUtils.connection); string customerPostal = cmd.ExecuteScalar().ToString().ToUpper(); //varaus_id for calculating the price later query = "SELECT varaus_id " + "FROM lasku " + "WHERE lasku_id = " + lasku_id + ";"; cmd = new MySqlCommand(query, ConnectionUtils.connection); int varaus_id = Convert.ToInt32(cmd.ExecuteScalar()); DateTime billingDate = DateTime.Now; string dueDate = DateTime.Now.AddDays(14).ToShortDateString(); string[] senderAddress = { "Village Newbies Oy", "Siilokatu 1", "90700 OULU" }; string[] receiverAddress = { customerName, customerAddress, customerPostal }; List <ItemRow> itemsList = GenerateItemsList(lasku_id); double totalPrice = CalculateTotalPrice(varaus_id); string totalPriceString = String.Format("{0:0.00}", totalPrice); double totalAlvAmount = 0; foreach (ItemRow item in itemsList) { totalAlvAmount += (Convert.ToDouble(item.Total) * (Convert.ToDouble(item.VAT) / 100)); } double subTotal = totalPrice - totalAlvAmount; //Creating the PDF document new InvoicerApi(SizeOption.A4, OrientationOption.Portrait, "€") .Reference(lasku_id.ToString()) .BillingDate(billingDate) .Company(Address.Make("Lähettäjä", senderAddress, "", "")) .Client(Address.Make("Vastaanottaja", receiverAddress, "", "")) .TextColor("#2E5902") .BackColor("#e7fecf") .Image(@"..\..\images\vnLogo.png", 175, 60) .Items(itemsList) .Totals(new List <TotalRow> { TotalRow.Make("Välisumma", (decimal)subTotal), TotalRow.Make("ALV", (decimal)totalAlvAmount), TotalRow.Make("Kokonaishinta", (decimal)totalPrice, true), }) .Details(new List <DetailRow> { DetailRow.Make("MAKSUTIEDOT", "SAAJAN TILINUMERO", "FI12345678910", "BIC", "NDEAFIHH", "SAAJA", "VILLAGE NEWBIES OY", "VIITENUMERO", "123456789", "ERÄPÄIVÄ", dueDate, "EURO", totalPriceString) }) .Footer("http://www.villagenewbies.fi") .Save(fileSaveLocation); //Open the document using default application System.Diagnostics.Process.Start(fileSaveLocation); ConnectionUtils.CloseConnection(); }
public override void Init(HttpListenerContext ctx = null) { if (ctx.Request.Cookies["guid"] != null && Sessions.sessions.ContainsKey( (from s in Sessions.sessions where s.Value.Item2 == ctx.Request.Cookies["guid"].Value select s.Key) .First())) { } sales_catalog_car car = DB.GetModel("sales_catalog_car").Select("*").AddFieldToFilter("car_license_plate", new Tuple <string, Expression>("eq", new Expression(Url.Split('/')[1]))).Load().ToDataSet <sales_catalog_car>().First(); int customerID = (from s in Sessions.sessions where s.Value.Item2 == ctx.Request.Cookies["guid"].Value select s.Key).First(); core_customer customer = DB.GetModel("core_customer").Select("*").AddFieldToFilter("customer_id", new Tuple <string, Expression>("eq", new Expression(customerID.ToString()))).Load().ToDataSet <core_customer>().First(); Model insertModel = DB.GetModel("sales_flat_order").Insert(); insertModel .AddDataToInsert(new KeyValuePair <string, string>("customer_id", customer.customer_id.ToString())) .AddDataToInsert(new KeyValuePair <string, string>("treated_by", "PIET")); insertModel.Load(); sales_flat_order order = DB.GetModel("sales_flat_order").Select("*").AddFieldToFilter("order_id", Tuple.Create <string, Expression>("eq", new Expression("LAST_INSERT_ID()", false))).Load().ToDataSet <sales_flat_order>().First(); DB.GetModel("sales_flat_order") .Update() .AddKeyValueToUpdate(new KeyValuePair <string, string>("invoice_link", "pdf/1000" + order.order_id + ".pdf")) .AddFieldToFilter("order_id", Tuple.Create <string, Expression>("eq", new Expression(order.order_id.ToString()))) .Load(); DB.GetModel("sales_order_item").Insert() .AddDataToInsert(new KeyValuePair <string, string>("order_id", order.order_id.ToString())) .AddDataToInsert(new KeyValuePair <string, string>("car_id", car.car_id.ToString())) .AddDataToInsert(new KeyValuePair <string, string>("hired_from", _POST["date_1"])) .AddDataToInsert(new KeyValuePair <string, string>("hired_to", _POST["date_2"])) .Load(); int days = Convert.ToInt16( (DateTime.ParseExact(_POST["date_2"], "yyyy/MM/dd", CultureInfo.InvariantCulture) - DateTime.ParseExact(_POST["date_1"], "yyyy/MM/dd", CultureInfo.InvariantCulture)).TotalDays); new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "€") .TextColor("#0000CC") .BackColor("#87ceeb") .Title("Factuur") .BillingDate(DateTime.Now) .Reference("1000" + order.order_id) .Company(Address.Make("VAN", new string[] { "Rent-a-Car", "Almere" })) .Client(Address.Make("FACTUUR ADRES", new string[] { customer.customer_name, customer.address_street + " " + customer.address_number, customer.address_city, customer.address_postal })) .Items(new List <ItemRow> { ItemRow.Make(car.car_type + " - " + car.car_brand, "van: " + _POST["date_1"] + " tot: " + _POST["date_2"], (decimal)days, days * decimal.Multiply(car.car_day_price, (decimal)0.25), (decimal)car.car_day_price, decimal.Multiply(days, car.car_day_price)), }) .Totals(new List <TotalRow> { TotalRow.Make("Subtotaal", days * decimal.Multiply(car.car_day_price, (decimal)0.75)), TotalRow.Make("BTW @ 25%", days * decimal.Multiply(car.car_day_price, (decimal)0.25)), TotalRow.Make("Totaal", decimal.Multiply(days, car.car_day_price), true), }) .Details(new List <DetailRow> { DetailRow.Make("BETALINGS INFORMATIE", "U kunt achteraf betalen bij de medewerker die uw order afhandeld.", "", "Als u nog verdere vragen heeft kunt u mailen naar [email protected]", "", "Bedankt voor uw bestelling", "U kunt de auto ophalen op: " + _POST["date_1"], "En de auto dient op zijn laatst om 17:00 op: " + _POST["date_2"] + " terug gebracht te worden.") }) .Footer("http://www.rent-a-car.com") .Save(FileManager.BaseDir + "pdf/1000" + order.order_id + ".pdf"); string path = FileManager.BaseDir + "pdf/1000" + order.order_id + ".pdf"; Location = "/pdf/1000" + order.order_id + ".pdf"; this.response = ""; this.ContentType = Constants.CONTENT_PDF; }
public static string PrintInvoiceBar(string path, InvoicerModel gravm, string imagePath) { var guestItems = new List <ItemRow>(); foreach (var rm in gravm.InvoicerItemModelList.OrderBy(x => x.ItemName)) { guestItems.Add(new ItemRow { TransactionDate = rm.TimeOfSale, Quantity = rm.Quantity, Description = rm.ItemName, UnitPrice = rm.Price, TotalPrice = rm.TotalPrice }); } string[] splitShopDetails = null; try { var shopDetails = ConfigurationManager.AppSettings["SHOPDETAILS"].ToString(); splitShopDetails = shopDetails.Split('@').ToArray(); if (splitShopDetails.Count() < 7) { splitShopDetails = null; } } catch (Exception) { } if (splitShopDetails == null) { splitShopDetails = new string[] { "AcademyVista Ltd. @ B03 Eleganza, V.G.C, @ Lagos State @ Nigeria @ 08105387515 @ www.academyvista.com @ 6543210" }; } string currency = "NGN", reference = gravm.ReceiptNumber + "_" + DateTime.Now.ToShortTimeString().Replace(":", ""), companyReg = splitShopDetails[6]; string[] companyDetails = splitShopDetails, clientDetails = new string[] { "Sir/Madam" }; List <ItemRow> itemsRows = new List <ItemRow>(); List <TotalRow> totalRows = new List <TotalRow>(); List <DetailRow> detailRows = new List <DetailRow>(); string footerWebsite = splitShopDetails[5]; string filename = new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, currency) .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(imagePath, 125, 27) .Reference(reference) .Company(Address.Make("FROM", companyDetails, companyReg, "")) .Client(Address.Make("BILLING TO", clientDetails)) .Items(guestItems) .Totals(new List <TotalRow> { TotalRow.Make("Sub Total", gravm.SubTotal), TotalRow.Make(gravm.TaxDetails, gravm.Tax), TotalRow.Make(gravm.DiscountDetails, gravm.Discount), TotalRow.Make("Total", gravm.Total, true), }) .Details(new List <DetailRow> { DetailRow.Make("PAYMENT INFORMATION", "A copy of this receipt will also be emailed to you.", "", "If you have any questions concerning this receipt, contact our front office or a duty manager.", "", "Thank you for your business."), }) .Footer(footerWebsite) .Save(path, 0); return(reference); }
public static string PrintInvoiceCheckingFuture(string path, Guest guest, string imagePath) { int qty = guest.GuestRooms.Count; string[] splitShopDetails = null; var termsAndConditions = GetTAC(); var acknowledge = GetAcknowledge(); var bottomDetailsRows = new List <DetailRow>(); bottomDetailsRows.Add(DetailRow.Make("RESERVATION INFORMATION", "A copy of this receipt will also be emailed to you.", "", "If you have any questions concerning this receipt, contact our front office or a duty manager.", "", "Thank you for your business.")); if (termsAndConditions.Any()) { bottomDetailsRows.Add(DetailRow.Make("TERMS && CONDITIONS", termsAndConditions.ToArray())); } if (acknowledge.Any()) { bottomDetailsRows.Add(DetailRow.Make("ACKNOWLEDGEMENT", acknowledge.ToArray())); } try { var shopDetails = ConfigurationManager.AppSettings["SHOPDETAILS"].ToString(); splitShopDetails = shopDetails.Split('@').ToArray(); if (splitShopDetails.Count() < 7) { splitShopDetails = null; } } catch (Exception) { } if (splitShopDetails == null) { splitShopDetails = new string[] { "AcademyVista Ltd. @ B03 Eleganza, V.G.C, @ Lagos State @ Nigeria @ 08105387515 @ www.academyvista.com @ 6543210" }; } string currency = "NGN ", reference = guest.Id.ToString() + "_" + DateTime.Now.ToShortTimeString().Replace(":", ""), companyReg = splitShopDetails[6]; string[] companyDetails = splitShopDetails, clientDetails = GetClientInformation(guest); List <ItemRow> itemsRows = new List <ItemRow>(); List <TotalRow> totalRows = new List <TotalRow>(); List <DetailRow> detailRows = new List <DetailRow>(); string footerWebsite = splitShopDetails[5]; var initialDeposit = guest.GuestRooms.SelectMany(x => x.GuestRoomAccounts).FirstOrDefault(x => x.PaymentTypeId == (int)RoomPaymentTypeEnum.ReservationDeposit); var gr = guest.GuestRooms.FirstOrDefault(); var noOfNights = gr.CheckoutDate.Subtract(gr.CheckinDate).Days; var roomDetails = "From " + gr.CheckinDate.ToShortDateString() + " To " + gr.CheckoutDate.ToShortDateString() + " Room Type - " + gr.Room.RoomType1.Name + " Room Price - (NGN " + decimal.Round(gr.RoomRate, 2) + " )"; var amountPaid = decimal.Zero; if (initialDeposit != null) { amountPaid = initialDeposit.Amount; } if (string.IsNullOrEmpty(reference)) { reference = DateTime.Now.ToString(); } string filename = new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, currency) .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(imagePath, 125, 32) .Reference(reference) .Company(Address.Make("FROM", companyDetails, companyReg, "")) .Client(Address.Make("BILLING TO", clientDetails)) .Items(new List <ItemRow> { ItemRow.Make("Resevation Deposit", roomDetails, (decimal)qty, 0, amountPaid, amountPaid) }) .Totals(new List <TotalRow> { TotalRow.Make("Sub Total", amountPaid), TotalRow.Make("TAX @ 0%", decimal.Zero), TotalRow.Make("Total", amountPaid, true), }) .Details(bottomDetailsRows) .Footer(footerWebsite) .Save(path, 0); return(reference); }
public static string PrintInvoicePayment(string path, GuestRoomAccount gra, string imagePath) { string[] splitShopDetails = null; var guest = gra.GuestRoom.Guest; try { var shopDetails = ConfigurationManager.AppSettings["SHOPDETAILS"].ToString(); splitShopDetails = shopDetails.Split('@').ToArray(); if (splitShopDetails.Count() < 7) { splitShopDetails = null; } } catch (Exception) { } if (splitShopDetails == null) { splitShopDetails = new string[] { "AcademyVista Ltd. @ B03 Eleganza, V.G.C, @ Lagos State @ Nigeria @ 08105387515 @ www.academyvista.com @ 6543210" }; } string currency = "NGN ", reference = gra.Id.ToString() + "_" + DateTime.Now.ToShortTimeString().Replace(":", ""), companyReg = splitShopDetails[6]; string[] companyDetails = splitShopDetails, clientDetails = GetClientInformation(guest); List <ItemRow> itemsRows = new List <ItemRow>(); List <TotalRow> totalRows = new List <TotalRow>(); List <DetailRow> detailRows = new List <DetailRow>(); string footerWebsite = splitShopDetails[5]; var initialDeposit = gra; var gr = guest.GuestRooms.FirstOrDefault(); var noOfNights = gr.CheckoutDate.Subtract(gr.CheckinDate).Days; var roomDetails = "Room " + gr.RoomNumber + "-" + gr.Room.RoomType1.Name + " Room Price - (NGN " + Decimal.Round(gr.RoomRate, 2) + ")"; var amountPaid = decimal.Zero; if (initialDeposit != null) { amountPaid = initialDeposit.Amount; } if (string.IsNullOrEmpty(reference)) { reference = DateTime.Now.ToString(); } string filename = new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, currency) .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(imagePath, 125, 32) .Reference(reference) .Company(Address.Make("FROM", companyDetails, companyReg, "")) .Client(Address.Make("BILLING TO", clientDetails)) .Items(new List <ItemRow> { ItemRow.Make(GetPaymementNote(initialDeposit), GetPaymementNote(initialDeposit), (decimal)1, 0, amountPaid, amountPaid) }) .Totals(new List <TotalRow> { TotalRow.Make("Sub Total", amountPaid), TotalRow.Make("TAX @ 0%", decimal.Zero), TotalRow.Make("Total", amountPaid, true), }) .Details(new List <DetailRow> { DetailRow.Make("PAYMENT INFORMATION", "A copy of this receipt will also be emailed to you.", "", "If you have any questions concerning this receipt, contact our front office or a duty manager.", "", "Thank you for your business.") }) .Footer(footerWebsite) .Save(path, 0); return(reference); }
public static string PrintInvoiceCheckout(string path, GuestRoomAccountViewModel gravm, string imagePath) { var guestItems = new List <ItemRow>(); foreach (var rm in gravm.DisplayList.OrderBy(x => x.TransactionDate)) { guestItems.Add(new ItemRow { TransactionDate = rm.TransactionDate, Amount = rm.Balance, Description = rm.Detail, Credit = rm.Credit, Debit = rm.Debit, Balance = rm.Balance }); } var guest = gravm.Guest; string[] splitShopDetails = null; try { var shopDetails = ConfigurationManager.AppSettings["SHOPDETAILS"].ToString(); splitShopDetails = shopDetails.Split('@').ToArray(); if (splitShopDetails.Count() < 7) { splitShopDetails = null; } } catch (Exception) { } if (splitShopDetails == null) { splitShopDetails = new string[] { "AcademyVista Ltd. @ B03 Eleganza, V.G.C, @ Lagos State @ Nigeria @ 08105387515 @ www.academyvista.com @ 6543210" }; } string currency = "NGN ", reference = guest.Id.ToString() + "_" + DateTime.Now.ToShortTimeString().Replace(":", ""), companyReg = splitShopDetails[6]; string[] companyDetails = splitShopDetails, clientDetails = GetClientInformation(gravm); List <ItemRow> itemsRows = new List <ItemRow>(); List <TotalRow> totalRows = new List <TotalRow>(); List <DetailRow> detailRows = new List <DetailRow>(); string footerWebsite = splitShopDetails[5]; var initialDeposit = guest.GuestRooms.SelectMany(x => x.GuestRoomAccounts).FirstOrDefault(x => x.PaymentTypeId == (int)RoomPaymentTypeEnum.InitialDeposit); var gr = guest.GuestRooms.FirstOrDefault(); var noOfNights = gr.CheckoutDate.Subtract(gr.CheckinDate).Days; var roomDetails = "Room " + gr.RoomNumber + "-" + gr.Room.RoomType1.Name + " Room Price - (NGN " + Decimal.Round(gr.RoomRate, 2) + ")"; var amountPaidCredit = decimal.Zero; var amountPaidDebit = decimal.Zero; var balance = decimal.Zero; amountPaidCredit = guestItems.Where(x => x.Credit > 0).Sum(x => x.Credit); amountPaidDebit = guestItems.Where(x => x.Debit > 0).Sum(x => x.Debit); balance = amountPaidCredit - amountPaidDebit; if (string.IsNullOrEmpty(reference)) { reference = DateTime.Now.ToString(); } var totalRowsTotal = new List <TotalRow>(); var taxRow = guestItems.FirstOrDefault(x => x.Description.ToUpper().Contains("TAX")); if (taxRow != null) { amountPaidDebit = amountPaidDebit - taxRow.Debit; } totalRowsTotal.Add(TotalRow.Make("Payments Total", amountPaidCredit)); //2347057706701 totalRowsTotal.Add(TotalRow.Make("Sub Total", amountPaidDebit)); if (taxRow != null) { totalRowsTotal.Add(TotalRow.Make(taxRow.Description, taxRow.Debit)); } totalRowsTotal.Add(TotalRow.Make("Balance", balance, true)); string filename = new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, currency) .TextColor("#CC0000") .BackColor("#FFD6CC") .Image(imagePath, 125, 32) .Reference(reference) .Company(Address.Make("FROM", companyDetails, companyReg, "")) .Client(Address.Make("BILLING TO", clientDetails)) .Items(guestItems) .Totals(totalRowsTotal) .Details(new List <DetailRow> { DetailRow.Make("CHECK-OUT INFORMATION", "A copy of this receipt will also be emailed to you.", "", "If you have any questions concerning this receipt, contact our front office or a duty manager.", "", "Thank you for your business."), DetailRow.Make("INFORMATION", "") }) .Footer(footerWebsite) .Save(path, 1); return(reference); }
public void MaasInvoice(Guid personalid) { Guid fatid = Guid.NewGuid(); Personeller personal = _personel.Find(personalid); SirketBilgiTB sirket = _sirket.Find(); IEnumerable <Izinler> izinler = CalcIzin(personalid); IEnumerable <Avanslar> avanslar = CalcAvans(personalid); decimal gunlukUcret = CalcGunlukUcret(personalid); DateTime sonMaasTarihi = CalcMaas(personalid); int toplamCalismaGunu = ( DateTime.Now - sonMaasTarihi).Days; decimal maas = toplamCalismaGunu * gunlukUcret; decimal kesintiler = 0; List <ItemRow> aciklamalar = new List <ItemRow>(); foreach (var item in izinler) { var izinSuresi = item.IzinSuresi - item.IzinTarihi; aciklamalar.Add( ItemRow.Make("İZİN", $"Izin kesintisi-{item.IzinTarihi.Date.ToShortDateString()} alından {izinSuresi.Days.ToString()} günlük izin ", izinSuresi.Days, 0, gunlukUcret, gunlukUcret * izinSuresi.Days)); kesintiler += gunlukUcret * izinSuresi.Days; } foreach (var item in avanslar) { aciklamalar.Add(ItemRow.Make("AVANS", $"Avans kesintisi - {item.AvansTarihi.Date.ToShortDateString()}", 1, 0, item.AvansTutari, item.AvansTutari)); kesintiler += item.AvansTutari; } aciklamalar.Add(ItemRow.Make("MAAŞ BİLGİSİ", $"Günlük çalışma ücreti {gunlukUcret}", toplamCalismaGunu, 0, gunlukUcret, maas)); new InvoicerApi(SizeOption.A4, OrientationOption.Landscape, "₺") .TextColor("#8C2234") .BackColor("#FFD6CC").Title($"{sirket.Name} Personel Maaş Faturası") .Image(sirket.Logo, 127, 85) .Company(Address.Make($"ÖDEME YAPAN", new string[] { sirket.Name, sirket.Phone, sirket.VATNo, sirket.Address }, sirket.Name, sirket.VATNo)) .Client(Address.Make("ÖDEME ALAN", new string[] { $"Adı Soyadı :{personal.AdSoyad}", $"Görevi :{personal.Gorevi}", $"Telefon :{personal.Telefon}" })) .Items(aciklamalar) .Totals(new List <TotalRow> { TotalRow.Make("KESİNTİLER", -kesintiler), TotalRow.Make("GÜN BAŞINA ÇALIŞMA", maas), TotalRow.Make("TOPLAM KESİN ÜCRET(MAAŞ)", maas - kesintiler, true), }) .Details(new List <DetailRow> { DetailRow.Make("Maaş ödeme faturası", "Personel maaş bordrosu yerine kullanılabilir.", "", $"Ek bu faturada,İkra yemek fabrikası çalışanı {personal.AdSoyad} 'ın maaş ödemesinin yapıldığını gösterir.Çeşitli nedenlerle kesintileri varsa bu faturada belirtilir.") }) .Footer("http://www.ikrayemek.com.tr").Reference(fatid.ToString().Substring(0, 32)) .Save(); Maaslar yeniMaasOdemesi = new Maaslar(); yeniMaasOdemesi.Id = fatid; yeniMaasOdemesi.PersonelId = personalid; yeniMaasOdemesi.OdemeTutari = maas - kesintiler; yeniMaasOdemesi.SonMaasDonemTarihi = DateTime.Now; yeniMaasOdemesi.FaturaId = fatid.ToString().Substring(0, 32); yeniMaasOdemesi.Odendi = true; Insert(yeniMaasOdemesi); _kasa.InsertMaas(yeniMaasOdemesi); foreach (var item in izinler) { item.MaastanDusurulduMu = true; _izin.Update(item); } foreach (var item in avanslar) { item.MaastanDusulduMu = true; _avans.Update(item); } }