refactorise la génération de la facture au format Pdf, presente la facture aquittée.

This commit is contained in:
Paul Schneider 2017-07-08 03:23:21 +02:00
commit fb0fbae077
9 changed files with 41 additions and 30 deletions

View file

@ -27,14 +27,14 @@ namespace Yavsc.ViewComponents
logger = loggerFactory.CreateLogger<BillViewComponent>();
}
public async Task<IViewComponentResult> InvokeAsync(string code, IBillable billable, OutputFormat format, bool asBill, bool acquitted)
public async Task<IViewComponentResult> InvokeAsync(string code, IBillable billable, OutputFormat format, bool asBill)
{
var di = new DirectoryInfo(Startup.SiteSetup.UserFiles.Bills);
var dia = new DirectoryInfo(Startup.SiteSetup.UserFiles.Avatars);
ViewBag.BillsDir = di.FullName;
ViewBag.AvatarsDir = dia.FullName;
ViewBag.AsBill = asBill; // vrai pour une facture, sinon, c'est un devis
ViewBag.Acquitted = acquitted;
ViewBag.Acquitted = billable.GetIsAcquitted();
ViewBag.BillingCode = code;
var client = await dbContext.Users
@ -81,9 +81,10 @@ namespace Yavsc.ViewComponents
Temp = Startup.Temp,
TeXSource = tex,
DestDir = Startup.UserBillsDirName,
BaseFileName = $"facture-{code}-{billable.Id}"
BaseFileName = billable.GetFileBaseName()
} );
}
ViewBag.BillFileInfo = billable.GetBillInfo();
return View("Default",billable);
}