restores the bill
This commit is contained in:
parent
1dea649d4a
commit
c8223c17ae
6 changed files with 23 additions and 19 deletions
|
|
@ -78,10 +78,16 @@ namespace Yavsc.Models.Haircut
|
||||||
bill.Add(new CommandLine { Name = "Shampoing", UnitaryCost = SelectedProfile.ShampooPrice });
|
bill.Add(new CommandLine { Name = "Shampoing", UnitaryCost = SelectedProfile.ShampooPrice });
|
||||||
|
|
||||||
// la coupe
|
// la coupe
|
||||||
if (Prestation.Cut)
|
if (Prestation.Cut) {
|
||||||
bill.Add(new CommandLine
|
bill.Add(new CommandLine
|
||||||
{
|
{
|
||||||
|
|
||||||
Name = "Coupe",
|
Name = "Coupe",
|
||||||
|
Description = $"Coupe "+Startup.GlobalLocalizer[Prestation.Gender.ToString()]+ " "+
|
||||||
|
(Prestation.Gender == HairCutGenders.Women ?
|
||||||
|
Prestation.Length == HairLength.Long ? longhairsuffix :
|
||||||
|
Prestation.Length == HairLength.HalfLong ? halflonghairsuffix :
|
||||||
|
shorthairsuffix: null),
|
||||||
UnitaryCost =
|
UnitaryCost =
|
||||||
Prestation.Gender == HairCutGenders.Women ?
|
Prestation.Gender == HairCutGenders.Women ?
|
||||||
Prestation.Length == HairLength.Long ? SelectedProfile.WomenLongCutPrice :
|
Prestation.Length == HairLength.Long ? SelectedProfile.WomenLongCutPrice :
|
||||||
|
|
@ -90,6 +96,8 @@ Prestation.Gender == HairCutGenders.Women ?
|
||||||
SelectedProfile.ManCutPrice : SelectedProfile.KidCutPrice
|
SelectedProfile.ManCutPrice : SelectedProfile.KidCutPrice
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Les techniques
|
// Les techniques
|
||||||
switch (Prestation.Tech)
|
switch (Prestation.Tech)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,7 @@ namespace Yavsc.Services
|
||||||
public async Task<IBillable> GetBillAsync(string billingCode, long queryId)
|
public async Task<IBillable> GetBillAsync(string billingCode, long queryId)
|
||||||
{
|
{
|
||||||
var dbFunc = Startup.Billing[billingCode];
|
var dbFunc = Startup.Billing[billingCode];
|
||||||
IBillable query = null;
|
IBillable query = await Task.Run(()=> dbFunc(DbContext, queryId));
|
||||||
await Task.Run(()=> dbFunc(DbContext, queryId));
|
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,12 @@ using Yavsc.Billing;
|
||||||
using Yavsc.Helpers;
|
using Yavsc.Helpers;
|
||||||
using Yavsc.Models;
|
using Yavsc.Models;
|
||||||
using Yavsc.Services;
|
using Yavsc.Services;
|
||||||
|
using Yavsc.ViewModels;
|
||||||
using Yavsc.ViewModels.Gen;
|
using Yavsc.ViewModels.Gen;
|
||||||
|
|
||||||
namespace Yavsc.ViewComponents
|
namespace Yavsc.ViewComponents
|
||||||
{
|
{
|
||||||
public enum OutputFormat {
|
|
||||||
Html,
|
|
||||||
LaTeX,
|
|
||||||
Pdf
|
|
||||||
}
|
|
||||||
public class BillViewComponent : ViewComponent
|
public class BillViewComponent : ViewComponent
|
||||||
{
|
{
|
||||||
ApplicationDbContext dbContext;
|
ApplicationDbContext dbContext;
|
||||||
|
|
|
||||||
|
|
@ -86,15 +86,15 @@
|
||||||
\def\ClientAdresse{
|
\def\ClientAdresse{
|
||||||
% Adresse du client
|
% Adresse du client
|
||||||
@PostalAddress
|
@PostalAddress
|
||||||
@if (PostalAddress!=null) {<text>@PostalAddress</text>}
|
@if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) {<text>\\
|
||||||
@if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) {<text>@TeXHelpers.ToTeX(to.PhoneNumber)<text>\\</text>
|
@TeXHelpers.ToTeX(to.PhoneNumber)
|
||||||
</text>}
|
</text>}\\
|
||||||
E-mail: @TeXHelpers.ToTeX(to.Email)
|
E-mail: @TeXHelpers.ToTeX(to.Email)
|
||||||
}
|
}
|
||||||
|
|
||||||
% Liste des produits facturés : Désignation, prix
|
% Liste des produits facturés : Désignation, prix
|
||||||
@foreach (var line in bill) {
|
@foreach (var line in bill) {
|
||||||
<text>\AjouterService{@TeXHelpers.ToTeX(line.Description)}{@line.Count}{@line.UnitaryCost.ToString("F2",CultureInfo.InvariantCulture)}
|
<text>\AjouterService{@TeXHelpers.ToTeXCell(line.Description)}{@line.Count}{@line.UnitaryCost.ToString("F2",CultureInfo.InvariantCulture)}
|
||||||
</text>}
|
</text>}
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
@model IBillable
|
@model IBillable
|
||||||
<div class="bill">
|
<div class="bill">
|
||||||
|
|
||||||
<a href="~/api/pdfbill/bill-@(Model.ActivityCode)-@(Model.Id).tex" >Export au format LaTeX</a>
|
<a class="btn btn-default" href="~/api/bill/facture-@(ViewBag.BillingCode)-@(Model.Id).tex" >Export au format LaTeX</a>
|
||||||
|
|
||||||
|
|
||||||
<form action="~/api/pdfbill/gen/@(Model.ActivityCode)-@Model.Id" method="POST">
|
<form action="~/api/bill/genpdf/@ViewBag.BillingCode-@Model.Id" method="POST">
|
||||||
<input type="submit" value="Générer le Pdf"/>
|
<input class="btn btn-default" type="submit" value="Générer le Pdf"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<a href="~/api/pdfbill/get/@(Model.Id)" >Télécharger le document généré</a>
|
<a class="btn btn-link" href="~/api/bill/facture-@(ViewBag.BillingCode)-@(Model.Id).pdf" >Télécharger le document généré</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
</dd>
|
</dd>
|
||||||
<dt>@SR["La facture"]
|
<dt>@SR["La facture"]
|
||||||
</dt>
|
</dt>
|
||||||
<dd>@await Component.InvokeAsync("Bill", "Brush", Model, "html", false, false )
|
<dd>@await Component.InvokeAsync("Bill", "Brush", Model, OutputFormat.Html, false, false )
|
||||||
</dd>
|
</dd>
|
||||||
<dt>@Html.DisplayNameFor(m=>m.Regularisation)</dt>
|
<dt>@Html.DisplayNameFor(m=>m.Regularisation)</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue