33 lines
727 B
C#
33 lines
727 B
C#
using zero.Commerce.Entities;
|
|
using zero.Core.Validation;
|
|
|
|
namespace zero.TestData
|
|
{
|
|
public class InvoiceDocument : DocumentTemplate
|
|
{
|
|
public string Text { get; set; }
|
|
|
|
|
|
public InvoiceDocument()
|
|
{
|
|
Alias = "invoice";
|
|
Name = "Invoice";
|
|
Description = "Document containing invoice data";
|
|
Filename = "invoice_{number}_{date}.pdf";
|
|
TemplatePath = "~/Views/Pdf/Invoice.pdf";
|
|
HasEditor = true;
|
|
|
|
Condition = order => !order.IsRequest;
|
|
|
|
AutoAttach = (order, mail) => mail.Alias == "order_confirmation";
|
|
|
|
AutoGenerateData = order =>
|
|
{
|
|
Text = "Thanks you for your order " + order.Id;
|
|
};
|
|
|
|
Validator = new ApplicationValidator();
|
|
}
|
|
}
|
|
}
|