");
+ sb.Append("| Subtotal | ").Append(FormatMoney(invoice.SubTotal, currency)).Append(" |
");
+ if (invoice.DiscountAmount > 0)
+ sb.Append("| Discount").Append(invoice.DiscountPercent.HasValue ? $" ({invoice.DiscountPercent.Value.ToString("0.##", CultureInfo.InvariantCulture)}%)" : string.Empty).Append(" | -").Append(FormatMoney(invoice.DiscountAmount, currency)).Append(" |
");
+ if (model.TaxComponents != null && model.TaxComponents.Count > 0)
+ {
+ foreach (var component in model.TaxComponents)
+ {
+ sb.Append("| ").Append(E(component.Name)).Append(" (").Append(component.RatePercent.ToString("0.##", CultureInfo.InvariantCulture)).Append("%)");
+ if (!string.IsNullOrWhiteSpace(component.RegistrationNumber)) sb.Append(" ").Append(E(component.RegistrationNumber)).Append("");
+ sb.Append(" | ").Append(FormatMoney(component.Amount ?? 0m, currency)).Append(" |
");
+ }
+ }
+ else if (invoice.TaxAmount > 0)
+ sb.Append("| Tax | ").Append(FormatMoney(invoice.TaxAmount, currency)).Append(" |
");
+ sb.Append("| Total | ").Append(FormatMoney(invoice.Total, currency)).Append(" |
");
+ if (invoice.AmountPaid > 0)
+ {
+ sb.Append("| Paid | -").Append(FormatMoney(invoice.AmountPaid, currency)).Append(" |
");
+ sb.Append("| Balance due | ").Append(FormatMoney(invoice.Balance, currency)).Append(" |
");
+ }
+ sb.Append("
");
+
+ if (!string.IsNullOrWhiteSpace(invoice.TermsText)) sb.Append("