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

@ -1,8 +1,7 @@
@model IBillable
<div class="bill">
@{ var fi = BillingHelpers.GetBillInfo(ViewBag.BillingCode,Model.Id); }
@if (fi.Exists) {
@if (ViewBag.BillFileInfo.Exists) {
<a class="btn btn-link" href="~/api/bill/facture-@(ViewBag.BillingCode)-@(Model.Id).pdf" >La facture au format Pdf</a>
} else {
<form action="~/api/bill/genpdf/@ViewBag.BillingCode/@Model.Id" method="POST">

View file

@ -15,12 +15,14 @@
<text> :
</text>
<label>
<input type="checkbox" checked="@Model.Regularisation.IsOk()" disabled/>
<label>@Model.GetIsAcquitted()
<input type="checkbox" checked="@Model.GetIsAcquitted()" disabled/>
<a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.Regularisation.CreationToken">@Model.Regularisation.CreationToken</a>
</label>
} else {
}
@if (!Model.GetIsAcquitted()) {
<div id="paypalzone"></div>
<script>
var CREATE_PAYMENT_URL = '@ViewBag.CreatePaymentUrl';

View file

@ -1,15 +1,4 @@
@model HairCutQuery
@{
var paid = false;
if (Model.PaymentId!=null) {
if (Model.Regularisation!=null) {
if (Model.Regularisation.IsOk()) {
paid=true;
}
}
}
}
<dl class="dl-horizontal">
<dt>@Html.DisplayNameFor(m=>m.Prestation)
</dt>
@ -33,7 +22,7 @@
</dd>
<dt>@SR["La facture"]
</dt>
<dd>@await Component.InvokeAsync("Bill", "Brush", Model, OutputFormat.Html, true, paid )
<dd>@await Component.InvokeAsync("Bill", "Brush", Model, OutputFormat.Html, true)
</dd>
<dt>@Html.DisplayNameFor(m=>m.Regularisation)</dt>
<dd>