internal void PrintText(Selection selection) { String Text = null; if ((SchadeloosStelling == 0) && (Gerechtskosten != 0)) { Text = "Mag ik u vragen om de gerechtskosten ter waarde van " + Gerechtskosten.ToString("C", Variabelen.Cultuur) + " te betalen."; } else if (Gerechtskosten != 0) { Text = "Mag ik u vragen een bedrag van " + Totaal.ToString("C", Variabelen.Cultuur) + " te betalen." + Environment.NewLine + "Dit bedrag is als volgt samengesteld: Schadeloosstelling " + SchadeloosStelling.ToString("C", Variabelen.Cultuur) + " en gerechtskosten " + Gerechtskosten.ToString("C", Variabelen.Cultuur); } else { Text = "Mag ik u vragen om een schadeloosstelling ter waarde van " + SchadeloosStelling.ToString("C", Variabelen.Cultuur) + " te betalen."; } Text += Environment.NewLine + "U kunt dit bedrag overmaken op rekeningnummer BE96 0012 4751 7505 met als mededeling: " + OGMNummer + "."; selection.TypeText(Text); }
internal void PrintText(Selection selection) { String Text = null; if ((Ereloon == 0) && (Gerechtskosten != 0)) { Text = "Mag ik u vragen om in dit dossier een provisie van " + Gerechtskosten.ToString("C", Variabelen.Cultuur) + " te betalen. Dit om mij toe te laten de gerechtsdeurwaarder te betalen."; } else if (Gerechtskosten != 0) { Text = "Mag ik u vragen om in dit dossier een globale provisie te betalen van " + Totaal.ToString("C", Variabelen.Cultuur) + "." + Environment.NewLine + "Dit bedrag is als volgt samengesteld: Provisie erelonen en bureelkosten " + Ereloon.ToString("C", Variabelen.Cultuur); if (!InterCompany) { Text += "vermeerderd met 21% btw of" + BTW.ToString("C", Variabelen.Cultuur); } Text += "en een provisie voor de gerechtskosten van " + Gerechtskosten.ToString("C", Variabelen.Cultuur) + "."; } else { Text = "Mag ik u vragen om in dit dossier een globale provisie te betalen van " + Totaal.ToString("C", Variabelen.Cultuur) + "samengesteld als volgt " + Ereloon.ToString("C", Variabelen.Cultuur) + " aan erelonen en bureelkosten"; if (!InterCompany) { Text += " en" + BTW.ToString("C", Variabelen.Cultuur) + " aan BTW"; } Text += "."; } Text += Environment.NewLine + "U kunt dit bedrag overmaken op rekeningnummer BE96 0012 4751 7505 met als mededeling: " + OGMNummer + "."; selection.TypeText(Text); }
public Totaal BerekenTotaal() { MySqlConnection conn = new MySqlConnection(connStr); conn.Open(); string qry = "select(prijs* aantal) as totaalexcl,((prijs*aantal)*0.21) as btw, ((prijs * aantal)*1.21) as totaalincl " + "from tblartikel inner join tblartikel on tblartikel.artikelID = tblwinkelmand.artikelID"; MySqlCommand cmd = new MySqlCommand(qry, conn); MySqlDataReader dtr = cmd.ExecuteReader(); Totaal totaal = new Totaal(); while (dtr.Read()) { totaal.TotaalExcl = Convert.ToDouble(dtr["totaalexcl"]); totaal.BTW = Convert.ToDouble(dtr["btw"]); totaal.TotaalExcl = Convert.ToDouble(dtr["totaalincl"]); } conn.Close(); return(totaal); }
private void ProvisieNotaForm_Validated(object sender, EventArgs e) { if (IC) { BTW = 0; } else { BTW = Ereloon * 0.21; } EreloonBedrag.Text = Ereloon.ToString("C", Culture); BTWBedrag.Text = BTW.ToString("C", Culture); BTWTotaal.Text = BTWBedrag.Text; EreloonTotaal.Text = (BTW + Ereloon).ToString("C", Culture); GerechtskostenBedrag.Text = Gerechtskosten.ToString("C", Culture); GerechtskostenTotaal.Text = GerechtskostenBedrag.Text; BedragTotaal.Text = (Gerechtskosten + Ereloon).ToString("C"); Totaal = Gerechtskosten + BTW + Ereloon; TotaalBedrag.Text = (Totaal.ToString("C")); }
internal void PrintText(Selection selection) { Document document = selection.Application.Documents.Add(Properties.Settings.Default.FactuurTemplate); Application app = selection.Application; AddHeader(document); var table = document.Tables[2]; table.Range.ParagraphFormat.KeepWithNext = -1; table.Borders[WdBorderType.wdBorderVertical].LineStyle = WdLineStyle.wdLineStyleDot; table.Borders[WdBorderType.wdBorderHorizontal].LineStyle = WdLineStyle.wdLineStyleDot; AddWages(table); AddLitigation(table); // Remove border of second row table.Rows[2].Borders[WdBorderType.wdBorderBottom].Visible = false; // Add Total Row newRow = table.Rows.Add(); Row BottomRow = newRow; //insert if for not empty newRow.Cells.Borders[WdBorderType.wdBorderTop].Visible = false; newRow.Cells.Borders[WdBorderType.wdBorderBottom].Visible = false; newRow.Cells.Borders[WdBorderType.wdBorderLeft].Visible = false; newRow.Cells.Borders[WdBorderType.wdBorderRight].Visible = false; newRow.Cells.Borders[WdBorderType.wdBorderHorizontal].Visible = false; newRow.Cells.Borders[WdBorderType.wdBorderVertical].Visible = false; newRow.Range.ParagraphFormat.KeepWithNext = -1; if (Subtotal_ExVAT != 0) { newRow = table.Rows.Add(); newRow.Cells[2].Merge(newRow.Cells[5]); newRow.Cells[2].Range.InsertAfter("Subtotaal excl Btw"); newRow.Cells[2].Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLeft; newRow.Cells[3].Range.InsertAfter(Subtotal_ExVAT.ToString("C", Variabelen.Cultuur)); newRow.Range.ParagraphFormat.KeepWithNext = -1; newRow = table.Rows.Add(); newRow.Cells[2].Range.InsertAfter("Subtotaal Btw"); newRow.Cells[3].Range.InsertAfter((Subtotal_ExVAT * BTWpercentage).ToString("C", Variabelen.Cultuur)); newRow.Range.ParagraphFormat.KeepWithNext = -1; } if (Subtotal_NoVat != 0) { newRow = table.Rows.Add(); newRow.Cells[2].Range.InsertAfter("Subtotaal derden en gerechtskosten"); newRow.Cells[3].Range.InsertAfter((Subtotal_NoVat + Subtotal_Derden).ToString("C", Variabelen.Cultuur)); newRow.Range.ParagraphFormat.KeepWithNext = -1; } if (Subtotal_NoVat != 0 || Subtotal_ExVAT != 0) { newRow = table.Rows.Add(); newRow.Cells[2].Range.InsertAfter("Totaal"); newRow.Cells[2].Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter; newRow.Cells[3].Range.InsertAfter(Totaal.ToString("C", Variabelen.Cultuur)); newRow.Cells[3].Borders[WdBorderType.wdBorderTop].Visible = true; newRow.Cells[2].Range.Font.Bold = -1; newRow.Cells[3].Range.Font.Bold = -1; newRow.Range.ParagraphFormat.KeepWithNext = -1; } var newTable = table.Split(BottomRow); // add border under table table.Borders[WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle; //table.Borders[WdBorderType.wdBorderTop] BottomRow.Borders[WdBorderType.wdBorderTop].Visible = true; BottomRow.Delete(); table.Columns.SetWidth(app.CentimetersToPoints(2.5f), WdRulerStyle.wdAdjustNone); table.Columns[1].SetWidth(app.CentimetersToPoints(5.25f), WdRulerStyle.wdAdjustNone); table.Columns[2].SetWidth(app.CentimetersToPoints(1.5f), WdRulerStyle.wdAdjustNone); table.Columns[6].SetWidth(app.CentimetersToPoints(3f), WdRulerStyle.wdAdjustNone); newTable.Columns.SetWidth(app.CentimetersToPoints(0.47f), WdRulerStyle.wdAdjustNone); newTable.Columns[1].SetWidth(app.CentimetersToPoints(1.47f), WdRulerStyle.wdAdjustNone); newTable.Columns[2].SetWidth(app.CentimetersToPoints(9.5f), WdRulerStyle.wdAdjustNone); newTable.Columns[3].SetWidth(app.CentimetersToPoints(5.25f), WdRulerStyle.wdAdjustNone); document.PrintPreview(); document.SaveAs2(FileName: Properties.Settings.Default.InvoicePath + FactuurJaar.ToString() + FactuurID.ToString()); app.ActivePrinter = "Standaard"; document.PrintOut(Background: true); app.ActivePrinter = "Standaard"; document.Close(SaveChanges: true); }