diff --git a/Yavsc/ApiControllers/BillingController.cs b/Yavsc/ApiControllers/BillingController.cs index 5af7ac17..848bc450 100644 --- a/Yavsc/ApiControllers/BillingController.cs +++ b/Yavsc/ApiControllers/BillingController.cs @@ -19,8 +19,8 @@ namespace Yavsc.ApiControllers using Models.Messaging; using ViewModels.Auth; - using Yavsc.ViewComponents; using Newtonsoft.Json; + using Yavsc.ViewModels; [Route("api/bill"), Authorize] public class BillingController : Controller @@ -54,7 +54,7 @@ namespace Yavsc.ApiControllers this.billingService=billingService; } - [HttpGet("pdf/facture-{billingCode}-{id}.pdf"), Authorize] + [HttpGet("facture-{billingCode}-{id}.pdf"), Authorize] public async Task GetPdf(string billingCode, long id) { var bill = await billingService.GetBillAsync(billingCode, id); @@ -71,12 +71,16 @@ namespace Yavsc.ApiControllers return File(fi.OpenRead(), "application/x-pdf", filename); ; } - [HttpGet("tex/{billingCode}-{id}.tex"), Authorize] + [HttpGet("facture-{billingCode}-{id}.tex"), Authorize] public async Task GetTex(string billingCode, long id) { + logger.LogWarning ( $"################################\n# Searching for bill {id} in {billingCode}"); var bill = await billingService.GetBillAsync(billingCode, id); - if (bill==null) return this.HttpNotFound(); + if (bill==null) { + logger.LogCritical ( $"# not found !! ##########\n################################"); + return this.HttpNotFound(); + } logger.LogVerbose(JsonConvert.SerializeObject(bill)); if (!await authorizationService.AuthorizeAsync(User, bill, new ViewRequirement())) diff --git a/Yavsc/ViewModels/OutputFormat.cs b/Yavsc/ViewModels/OutputFormat.cs new file mode 100644 index 00000000..d0e25964 --- /dev/null +++ b/Yavsc/ViewModels/OutputFormat.cs @@ -0,0 +1,9 @@ +namespace Yavsc.ViewModels +{ + public enum OutputFormat { + Html, + LaTeX, + Pdf + } + +} \ No newline at end of file diff --git a/Yavsc/Views/_ViewImports.cshtml b/Yavsc/Views/_ViewImports.cshtml index 81bbe5f5..4b2f68f3 100755 --- a/Yavsc/Views/_ViewImports.cshtml +++ b/Yavsc/Views/_ViewImports.cshtml @@ -26,6 +26,7 @@ @using Yavsc.Models.Calendar; @using Yavsc.Billing; +@using Yavsc.ViewModels; @using Yavsc.ViewModels.Account; @using Yavsc.ViewModels.Manage; @using Yavsc.ViewModels.Calendar;