files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions
5
src/Yavsc/Views/Shared/Components/Avatar/Default.cshtml
Normal file
5
src/Yavsc/Views/Shared/Components/Avatar/Default.cshtml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@model ShortUserInfo
|
||||
<div style="display: inline-block;">
|
||||
<img src="@Model.Avatar" class="smalltofhol" />
|
||||
@Model.UserName
|
||||
</div>
|
||||
22
src/Yavsc/Views/Shared/Components/Bill/Bill_pdf.cshtml
Normal file
22
src/Yavsc/Views/Shared/Components/Bill/Bill_pdf.cshtml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
@using System.Reflection
|
||||
@using System.IO
|
||||
@using Microsoft.Extensions.WebEncoders
|
||||
@using System.Diagnostics
|
||||
@using System.Text
|
||||
@using Yavsc.Formatters
|
||||
@using Yavsc.Helpers
|
||||
@model Yavsc.ViewModels.Gen.PdfGenerationViewModel
|
||||
|
||||
@{
|
||||
Model.GenerateEstimatePdf();
|
||||
}
|
||||
@if (Model.Generated) {
|
||||
<div>
|
||||
@(Model.BaseFileName).pdf was generated
|
||||
</div>
|
||||
} else {
|
||||
<div class="error">
|
||||
@Model.GenerationErrorMessage
|
||||
<p>Something went wrong ...</p>
|
||||
</div>
|
||||
}
|
||||
228
src/Yavsc/Views/Shared/Components/Bill/Bill_tex.cshtml
Normal file
228
src/Yavsc/Views/Shared/Components/Bill/Bill_tex.cshtml
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
@using Yavsc.Helpers
|
||||
@using System.IO
|
||||
@using System.Globalization
|
||||
@model IBillable
|
||||
@{
|
||||
Layout = null;
|
||||
var pro = ViewBag.PerformerProfile;
|
||||
var from = ViewBag.Performer;
|
||||
var to = ViewBag.Client;
|
||||
var PostalAddress = ViewBag.ClientAddress;
|
||||
var proaddr = ViewBag.PerformerOrganizationAddress;
|
||||
var isestimate = !ViewBag.AsBill;
|
||||
var prosign = new FileInfo($"{ViewBag.BillsDir}/sign-{ViewBag.BillingCode}-{Model.Id}.png");
|
||||
var clisign = new FileInfo($"{ViewBag.BillsDir}/sign-{ViewBag.BillingCode}-{Model.Id}.png");
|
||||
var activity = ViewBag.ActivityLabel;
|
||||
var bill = Model.GetBillItems();
|
||||
string validationDate = null ;
|
||||
if (Model.ValidationDate.HasValue) {
|
||||
validationDate = Model.ValidationDate.Value.ToString("dddd dd MMMM yyyy", CultureInfo.CreateSpecificCulture("fr-FR"));
|
||||
}
|
||||
}
|
||||
\documentclass[french,11pt]{article}
|
||||
\usepackage{eurosym}
|
||||
\usepackage{textcomp}
|
||||
\usepackage{babel}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[a4paper]{geometry}
|
||||
\usepackage{units}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{fp}
|
||||
\usepackage[space]{grffile}
|
||||
\def\TVA{20} % Taux de la TVA
|
||||
|
||||
\def\TotalHT{0}
|
||||
\def\TotalTVA{0}
|
||||
|
||||
\newcommand{\AjouterService}[3]{% Arguments : Désignation, quantité, prix
|
||||
\FPround{\prix}{#3}{2}
|
||||
\FPeval{\montant}{#2 * #3}
|
||||
\FPround{\montant}{\montant}{2}
|
||||
\FPadd{\TotalHT}{\TotalHT}{\montant}
|
||||
\eaddto\ListeProduits{#1 & \prix & #2 & \montant \cr}
|
||||
}
|
||||
|
||||
\newcommand{\AfficheResultat}{%
|
||||
\ListeProduits
|
||||
\FPeval{\TotalTVA}{\TotalHT * \TVA / 100}
|
||||
\FPadd{\TotalTTC}{\TotalHT}{\TotalTVA}
|
||||
\FPround{\TotalHT}{\TotalHT}{2}
|
||||
\FPround{\TotalTVA}{\TotalTVA}{2}
|
||||
\FPround{\TotalTTC}{\TotalTTC}{2}
|
||||
\global\let\TotalHT\TotalHT
|
||||
\global\let\TotalTVA\TotalTVA
|
||||
\global\let\TotalTTC\TotalTTC
|
||||
\cr
|
||||
\hline
|
||||
\textbf{Total} & & & \TotalHT
|
||||
}
|
||||
|
||||
\newcommand*\eaddto[2]{% version développée de \addto
|
||||
\edef\tmp{#2}%
|
||||
\expandafter\addto
|
||||
\expandafter#1%
|
||||
\expandafter{\tmp}%
|
||||
}
|
||||
|
||||
\newcommand{\ListeProduits}{}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
||||
\def\FactureAcquittee {@(ViewBag.Acquitted?"oui":"non")} % Facture acquittée : oui/non
|
||||
\def\FactureLieu {@proaddr} % Lieu de l'édition de la facture
|
||||
\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) en @TeXHelpers.ToTeX(activity)} % Objet du document
|
||||
% Description de la facture
|
||||
\def\FactureDescr {
|
||||
@TeXHelpers.ToTeX(Model.GetDescription())
|
||||
}
|
||||
|
||||
% Infos Client
|
||||
\def\ClientNom{@TeXHelpers.ToTeX(to.UserName)} % Nom du client
|
||||
|
||||
\def\ClientAdresse{
|
||||
% Adresse du client
|
||||
@PostalAddress @if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) {<text>\\
|
||||
@TeXHelpers.ToTeX(to.PhoneNumber)
|
||||
</text>}\\
|
||||
E-mail: @TeXHelpers.ToTeX(to.Email)
|
||||
}
|
||||
|
||||
% Liste des produits facturés : Désignation, prix
|
||||
@foreach (var line in bill) {
|
||||
<text>\AjouterService{@TeXHelpers.ToTeXCell(line.Description)}{@line.Count}{@line.UnitaryCost.ToString("F2",CultureInfo.InvariantCulture)}
|
||||
</text>}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
|
||||
\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
|
||||
\setlength{\parindent}{0pt}
|
||||
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
|
||||
|
||||
\thispagestyle{fancy}
|
||||
\pagestyle{fancy}
|
||||
\setlength{\parindent}{0pt}
|
||||
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
\cfoot{ @TeXHelpers.ToTeX(from.UserName) - @ViewBag.FooterPerformerOrganizationAddress \\
|
||||
\small{ E-mail: @TeXHelpers.ToTeX(from.Email) @if (!string.IsNullOrWhiteSpace(from.PhoneNumber)) { <text> - Téléphone : @TeXHelpers.ToTeX(from.PhoneNumber) </text> }
|
||||
}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Logo de la société
|
||||
@if (from.Avatar != null) {
|
||||
<text>\includegraphics[height=60pt]{@(ViewBag.AvatarsDir)/@(from.UserName).png}
|
||||
</text>
|
||||
} else {
|
||||
<text>%\includegraphics{logo.png}
|
||||
</text>
|
||||
}
|
||||
% Nom et adresse de la société
|
||||
@TeXHelpers.ToTeX(from.UserName) \\
|
||||
@proaddr
|
||||
|
||||
@(isestimate?"Devis":"Facture") n\textdegree\FactureNum
|
||||
|
||||
|
||||
{\addtolength{\leftskip}{10.5cm} %in ERT
|
||||
\textbf{\ClientNom} \\
|
||||
\ClientAdresse \\
|
||||
|
||||
} %in ERT
|
||||
|
||||
|
||||
\hspace*{10.5cm}
|
||||
\FactureLieu, le \today
|
||||
|
||||
~\\~\\
|
||||
|
||||
\textbf{Objet : \FactureObjet \\}
|
||||
|
||||
\textnormal{\FactureDescr}
|
||||
|
||||
~\\
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{lrrr}
|
||||
\textbf{Désignation ~~~~~~} & \textbf{Prix unitaire} & \textbf{Quantité} & \textbf{Montant (\euro)} \\
|
||||
\hline
|
||||
\AfficheResultat{}
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\begin{flushright}
|
||||
\textit{Auto entreprise en franchise de TVA}\\
|
||||
|
||||
\end{flushright}
|
||||
~\\
|
||||
@if (ViewBag.AsBill) {
|
||||
if (ViewBag.Acquitted) {
|
||||
<text>
|
||||
\ifthenelse{\equal{\FactureAcquittee}{oui}}{
|
||||
Facture acquittée.
|
||||
}
|
||||
</text>
|
||||
} else {
|
||||
var bi = from.BankInfo;
|
||||
if (bi==null){
|
||||
<text>À régler sur site, en utilisant le paiment PayPal:\\
|
||||
Le relevé d'identité bancaire de ce prestaire n'est pas renseigné.
|
||||
</text>
|
||||
} else {
|
||||
<text>À régler par chèque ou par virement bancaire :
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{|c c c c|}
|
||||
@if (!string.IsNullOrWhiteSpace(bi.BankCode) && !string.IsNullOrWhiteSpace(bi.WicketCode)
|
||||
&& !string.IsNullOrWhiteSpace(bi.AccountNumber) ) {
|
||||
<text>\hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N\textdegree de Compte} & \textbf{Clé RIB} \\
|
||||
@bi.BankCode & @bi.WicketCode & @bi.AccountNumber & @bi.BankedKey \\
|
||||
</text>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(@bi.IBAN) && !string.IsNullOrWhiteSpace(@bi.BIC)) {
|
||||
<text>
|
||||
\hline \textbf{IBAN N\textdegree} & \multicolumn{3}{|l|}{ @bi.IBAN } \\
|
||||
\hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ @bi.BIC }
|
||||
</text>
|
||||
} \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@if (validationDate!=null) {
|
||||
<text>
|
||||
\begin{flushright}
|
||||
@(new TeXString(isestimate?"Devis demandé le ":"Facture suite à la demande du ")+
|
||||
TeXHelpers.ToTeX(validationDate))
|
||||
\end{flushright}
|
||||
@if (prosign.Exists) {
|
||||
<text>
|
||||
\begin{center}
|
||||
\hspace{263pt}
|
||||
\includegraphics[height=60pt]{@(ViewBag.BillsDir)/{ViewBag.BillingCode}-prosign-@(Model.Id).png}
|
||||
\end{center}
|
||||
</text>
|
||||
}
|
||||
|
||||
@if (clisign.Exists) {
|
||||
<text>
|
||||
\begin{center}
|
||||
\hspace{263pt}
|
||||
\includegraphics[height=60pt]{@(ViewBag.BillsDir)/{ViewBag.BillingCode}-clisign-@(Model.Id).png}
|
||||
\end{center}
|
||||
</text>
|
||||
}
|
||||
|
||||
</text>
|
||||
}
|
||||
\end{document}
|
||||
33
src/Yavsc/Views/Shared/Components/Bill/Default.cshtml
Normal file
33
src/Yavsc/Views/Shared/Components/Bill/Default.cshtml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
@model IBillable
|
||||
<div class="bill">
|
||||
@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 {
|
||||
<script>
|
||||
var onGenerate = function () {
|
||||
var _btn = this;
|
||||
$.post('/api/bill/genpdf/@ViewBag.BillingCode/@Model.Id')
|
||||
.done(function(data){
|
||||
var res = JSON.parse(data);
|
||||
window.location.href = '/api/bill/' + res.Generated;
|
||||
_btn.disabled = true;
|
||||
})
|
||||
.fail(function( jqXHR, textStatus, errorThrown ) {
|
||||
$('#billgenerr').html('<em>La génération a échoué</em><p>'+textStatus+'</p>')
|
||||
})
|
||||
};
|
||||
|
||||
$(document).ready(function(){$('#btnGen').on('click',onGenerate)})
|
||||
|
||||
</script>
|
||||
<div id="billgen">
|
||||
<form action= method="POST">
|
||||
<input id="btnGen" class="btn btn-default" type="button" onclick="onGenerate" value="Générer la facture au format Pdf" />
|
||||
|
||||
<div id="billgenerr" class="error">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
64
src/Yavsc/Views/Shared/Components/BlogIndex/Default.cshtml
Normal file
64
src/Yavsc/Views/Shared/Components/BlogIndex/Default.cshtml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
@model IEnumerable<IGrouping<string,BlogPost>>
|
||||
|
||||
@if (User.IsSignedIn()) {
|
||||
|
||||
<label>
|
||||
<input type="checkbox" id="_cbv" checked/>Invisibles, posts privés</label>
|
||||
<script>
|
||||
$("#_cbv").change(function() {
|
||||
if (this.checked) {
|
||||
$("tr.hiddenpost").removeClass("hidden");
|
||||
} else {
|
||||
$("tr.hiddenpost").addClass("hidden");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
<table class="table">
|
||||
@foreach (var group in Model) {
|
||||
var title = group.Key ?? "@";
|
||||
string secondclass="";
|
||||
var first = group.First();
|
||||
string ftrclass = (first.Visible) ? "visiblepost" : "hiddenpost";
|
||||
|
||||
<tr><td colspan="3">
|
||||
<a asp-action="Title" asp-route-id="@group.Key" >@title</a></td></tr>
|
||||
@foreach (var item in group) {
|
||||
var trclass = (item.Visible)?"visiblepost":"hiddenpost";
|
||||
|
||||
<tr class="@trclass">
|
||||
<td><a asp-action="Details" asp-route-id="@item.Id" class="bloglink">
|
||||
<img src="@item.Photo" class="blogphoto"></a>
|
||||
</td>
|
||||
<td>
|
||||
<markdown>@((item.Content?.Length > 256) ? item.Content.Substring(0, 256) + " ..." : item.Content)</markdown>
|
||||
<span style="font-size:x-small;">(@item.Author.UserName </span>,
|
||||
<span style="font-size:xx-small;">
|
||||
posté le @item.DateCreated.ToString("dddd d MMM yyyy à H:mm")
|
||||
@if ((item.DateModified - item.DateCreated).Minutes > 0){
|
||||
@:- Modifié le @item.DateModified.ToString("dddd d MMM yyyy à H:mm")
|
||||
})
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="actiongroup">
|
||||
@if (await AuthorizationService.AuthorizeAsync(User, item, new ViewRequirement())) {
|
||||
<li>
|
||||
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-lg">@SR["Details"]</a>
|
||||
</li>
|
||||
}
|
||||
@if (await AuthorizationService.AuthorizeAsync(User, item, new EditRequirement())) {
|
||||
<li><a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-default">@SR["Edit"]</a>
|
||||
</li>
|
||||
<li><a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">@SR["Delete"]</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</table>
|
||||
|
||||
|
||||
23
src/Yavsc/Views/Shared/Components/Calendar/Default.cshtml
Normal file
23
src/Yavsc/Views/Shared/Components/Calendar/Default.cshtml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
@model DateTimeChooserViewModel
|
||||
@{
|
||||
var dtpid = $"dtpckr{Model.InputId}";
|
||||
var currentUICulture = System.Globalization.CultureInfo.CurrentUICulture;
|
||||
}
|
||||
|
||||
<div class='input-group date' data-provide="datepicker-inline" id="@dtpid">
|
||||
<input class="form-control " name="@Model.InputId" id="@Model.InputId" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$(@Html.Raw("'#"+dtpid+"'")).datetimepicker({
|
||||
locale: '@currentUICulture.Name',
|
||||
disabledDates: @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.BusyDates)),
|
||||
maxDate: '@Model.MaxDate.ToString("MM/dd/yyyy",currentUICulture)',
|
||||
minDate: '@Model.MinDate.ToString("MM/dd/yyyy",currentUICulture)',
|
||||
format: 'MM/DD/YYYY HH:mm'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
@model CirclesViewModel
|
||||
|
||||
@foreach (var cb in ViewBag.Access) {
|
||||
<label><input type="checkbox" class="@(Model.TargetTypeName)cirle" checked="@cb.Checked" value="@cb.Text"
|
||||
data-target-id="@Model.Target.Id" data-circle-id="@cb.Value" data-targe-type="">
|
||||
@cb.Text </label>
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
@model Comment
|
||||
44
src/Yavsc/Views/Shared/Components/Directory/Default.cshtml
Normal file
44
src/Yavsc/Views/Shared/Components/Directory/Default.cshtml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
@using Yavsc.ViewModels.UserFiles
|
||||
@model UserDirectoryInfo
|
||||
<div class="dirinfo">
|
||||
<strong>@Model.UserName / @Model.SubPath</strong>
|
||||
<div class="subdirs">
|
||||
@foreach (var subdir in Model.SubDirectories) {
|
||||
<a href="@subdir" class="subdir">@subdir.Name</a>
|
||||
}
|
||||
</div>
|
||||
<style>
|
||||
tr.fileheaders th {
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-style: italic;
|
||||
}
|
||||
tr.fileinfo td {
|
||||
padding: 1em;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
tr.fileinfo:nth-child(even) {background-color: #f2f2f2}
|
||||
tr.fileinfo:hover {background-color: #f5f5f5}
|
||||
|
||||
</style>
|
||||
<table >
|
||||
<tr class="fileheaders">
|
||||
<th>Nom
|
||||
</th>
|
||||
<th>Taille
|
||||
</th>
|
||||
<th>Modification
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var fileinfo in Model.Files) {
|
||||
<tr class="fileinfo">
|
||||
<td class="filename">
|
||||
<a href="@fileinfo.FileLink(Model.UserName,Model.SubPath)">
|
||||
@fileinfo.Name
|
||||
</a></td>
|
||||
<td class="filesize">@fileinfo.Size</td>
|
||||
<td class="filemdate">@fileinfo.LastModified</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
13
src/Yavsc/Views/Shared/Components/Estimate/Default.cshtml
Normal file
13
src/Yavsc/Views/Shared/Components/Estimate/Default.cshtml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
@model Estimate
|
||||
<div class="estimate">
|
||||
|
||||
<a href="~/api/pdfbill/estimate-@(Model.Id).tex" >Export au format LaTeX</a>
|
||||
|
||||
|
||||
<form action="~/api/pdfbill/gen/@Model.Id" method="POST">
|
||||
<input type="submit" value="Générer le Pdf"/>
|
||||
</form>
|
||||
|
||||
<a href="~/api/pdfbill/get/@(Model.Id)" >Télécharger le document généré</a>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
@using System.Reflection
|
||||
@using System.IO
|
||||
@using Microsoft.Extensions.WebEncoders
|
||||
@using System.Diagnostics
|
||||
@using System.Text
|
||||
@using Yavsc.Formatters
|
||||
@using Yavsc.Helpers
|
||||
@model Yavsc.ViewModels.Gen.PdfGenerationViewModel
|
||||
|
||||
@{
|
||||
Model.GenerateEstimatePdf();
|
||||
}
|
||||
@if (Model.Generated) {
|
||||
<div>
|
||||
@(Model.BaseFileName).pdf was generated
|
||||
</div>
|
||||
} else {
|
||||
<div class="error">
|
||||
@Model.GenerationErrorMessage
|
||||
<p>Something went wrong ...</p>
|
||||
</div>
|
||||
}
|
||||
206
src/Yavsc/Views/Shared/Components/Estimate/Estimate_tex.cshtml
Normal file
206
src/Yavsc/Views/Shared/Components/Estimate/Estimate_tex.cshtml
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
@using Yavsc.Helpers
|
||||
@using System.IO
|
||||
@using System.Globalization
|
||||
@model Estimate
|
||||
@{
|
||||
Layout = null;
|
||||
var pro = Model.Query.PerformerProfile;
|
||||
var from = Model.Query.PerformerProfile.Performer;
|
||||
var to = Model.Query.Client;
|
||||
var PostalAddress = to.PostalAddress?.Address.SplitAddressToTeX();
|
||||
var proaddr = Model.Query.PerformerProfile.OrganizationAddress.Address.SplitAddressToTeX();
|
||||
var proaddrm = new HtmlString(Model.Query.PerformerProfile.OrganizationAddress.Address);
|
||||
var isestimate = !ViewBag.AsBill;
|
||||
var prosign = new FileInfo($"{ViewBag.BillsDir}/estimate-prosign-{Model.Id}.png");
|
||||
|
||||
}
|
||||
\documentclass[french,11pt]{article}
|
||||
\usepackage{eurosym}
|
||||
\usepackage{babel}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[a4paper]{geometry}
|
||||
\usepackage{units}
|
||||
\usepackage{bera}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{fp}
|
||||
|
||||
\def\TVA{20} % Taux de la TVA
|
||||
|
||||
\def\TotalHT{0}
|
||||
\def\TotalTVA{0}
|
||||
|
||||
\newcommand{\AjouterService}[3]{% Arguments : Désignation, quantité, prix
|
||||
\FPround{\prix}{#3}{2}
|
||||
\FPeval{\montant}{#2 * #3}
|
||||
\FPround{\montant}{\montant}{2}
|
||||
\FPadd{\TotalHT}{\TotalHT}{\montant}
|
||||
\eaddto\ListeProduits{#1 & \prix & #2 & \montant \cr}
|
||||
}
|
||||
|
||||
\newcommand{\AfficheResultat}{%
|
||||
\ListeProduits
|
||||
\FPeval{\TotalTVA}{\TotalHT * \TVA / 100}
|
||||
\FPadd{\TotalTTC}{\TotalHT}{\TotalTVA}
|
||||
\FPround{\TotalHT}{\TotalHT}{2}
|
||||
\FPround{\TotalTVA}{\TotalTVA}{2}
|
||||
\FPround{\TotalTTC}{\TotalTTC}{2}
|
||||
\global\let\TotalHT\TotalHT
|
||||
\global\let\TotalTVA\TotalTVA
|
||||
\global\let\TotalTTC\TotalTTC
|
||||
\cr
|
||||
\hline
|
||||
\textbf{Total} & & & \TotalHT
|
||||
}
|
||||
|
||||
\newcommand*\eaddto[2]{% version développée de \addto
|
||||
\edef\tmp{#2}%
|
||||
\expandafter\addto
|
||||
\expandafter#1%
|
||||
\expandafter{\tmp}%
|
||||
}
|
||||
|
||||
\newcommand{\ListeProduits}{}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
||||
\def\FactureAcquittee {@ViewBag.Acquitted?"oui":"non"} % Facture acquittée : oui/non
|
||||
\def\FactureLieu {@proaddrm} % Lieu de l'édition de la facture
|
||||
\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) : @TeXHelpers.ToTeX(Model.Title)} % Objet du document
|
||||
% Description de la facture
|
||||
\def\FactureDescr {
|
||||
@TeXHelpers.ToTeX(Model.Description)
|
||||
}
|
||||
|
||||
% Infos Client
|
||||
\def\ClientNom{@TeXHelpers.ToTeX(to.UserName)} % Nom du client
|
||||
|
||||
\def\ClientAdresse{
|
||||
% Adresse du client
|
||||
@PostalAddress
|
||||
@if (PostalAddress!=null) {<text>@PostalAddress</text>}
|
||||
@if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) {<text>@TeXHelpers.ToTeX(to.PhoneNumber)<text>\\</text>
|
||||
</text>}
|
||||
E-mail: @TeXHelpers.ToTeX(to.Email)
|
||||
}
|
||||
|
||||
% Liste des produits facturés : Désignation, prix
|
||||
@if (Model.Bill!=null) { foreach (CommandLine line in Model.Bill) {
|
||||
<text>\AjouterService{@TeXHelpers.ToTeX(line.Description)}{@line.Count}{@line.UnitaryCost.ToString("F2",CultureInfo.InvariantCulture)}
|
||||
</text>} }
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
|
||||
\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
|
||||
\setlength{\parindent}{0pt}
|
||||
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
|
||||
|
||||
\thispagestyle{fancy}
|
||||
\pagestyle{fancy}
|
||||
\setlength{\parindent}{0pt}
|
||||
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
\cfoot{ @TeXHelpers.ToTeX(from.UserName) @if (proaddrm!=null) { <text> - @proaddrm </text> } \newline
|
||||
\small{ E-mail: @TeXHelpers.ToTeX(from.Email) @if (!string.IsNullOrWhiteSpace(from.PhoneNumber)) { <text> - Téléphone fixe: @TeXHelpers.ToTeX(from.PhoneNumber) </text> }
|
||||
}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Logo de la société
|
||||
@if (from.Avatar != null) {
|
||||
<text>\includegraphics[height=60pt]{@(ViewBag.AvatarsDir)/@(from.UserName).png}
|
||||
</text>
|
||||
} else {
|
||||
<text>%\includegraphics{logo.png}
|
||||
</text>
|
||||
}
|
||||
% Nom et adresse de la société
|
||||
@TeXHelpers.ToTeX(from.UserName) \\
|
||||
@proaddr
|
||||
|
||||
@(isestimate?"Devis":"Facture") n°\FactureNum
|
||||
|
||||
|
||||
{\addtolength{\leftskip}{10.5cm} %in ERT
|
||||
\textbf{\ClientNom} \\
|
||||
\ClientAdresse \\
|
||||
|
||||
} %in ERT
|
||||
|
||||
|
||||
\hspace*{10.5cm}
|
||||
\FactureLieu, le \today
|
||||
|
||||
~\\~\\
|
||||
|
||||
\textbf{Objet : \FactureObjet \\}
|
||||
|
||||
\textnormal{\FactureDescr}
|
||||
|
||||
~\\
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{lrrr}
|
||||
\textbf{Désignation ~~~~~~} & \textbf{Prix unitaire} & \textbf{Quantité} & \textbf{Montant (\euro)} \\
|
||||
\hline
|
||||
\AfficheResultat{}
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\begin{flushright}
|
||||
\textit{Auto entreprise en franchise de TVA}\\
|
||||
|
||||
\end{flushright}
|
||||
~\\
|
||||
@if (!isestimate) {
|
||||
<text>
|
||||
\ifthenelse{\equal{\FactureAcquittee}{oui}}{
|
||||
Facture acquittée.
|
||||
}{ </text>
|
||||
|
||||
var bi = from.BankInfo;
|
||||
if (bi!=null) {
|
||||
<text>À régler par chèque ou par virement bancaire :
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{|c c c c|}
|
||||
@if (!string.IsNullOrWhiteSpace(bi.BankCode) && !string.IsNullOrWhiteSpace(bi.WicketCode)
|
||||
&& !string.IsNullOrWhiteSpace(bi.AccountNumber) ) {
|
||||
<text>\hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB} \\
|
||||
@bi.BankCode & @bi.WicketCode & @bi.AccountNumber & @bi.BankedKey \\
|
||||
</text>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(@bi.IBAN) && !string.IsNullOrWhiteSpace(@bi.BIC)) {
|
||||
<text>
|
||||
\hline \textbf{IBAN N°} & \multicolumn{3}{|l|}{ @bi.IBAN } \\
|
||||
\hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ @bi.BIC }
|
||||
</text>
|
||||
} \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}</text>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@if (!(Model.ProviderValidationDate==null)) {
|
||||
<text>
|
||||
\begin{flushright}
|
||||
@(new HtmlString(isestimate?"Devis validé":"Facture validée")) le @TeXHelpers.ToTeX(Model.ProviderValidationDate.ToString("dddd dd MMMM yyyy"))
|
||||
\end{flushright}
|
||||
@if (prosign.Exists) {
|
||||
<text>
|
||||
\begin{center}
|
||||
\hspace{263pt}
|
||||
\includegraphics[height=60pt]{@(ViewBag.BillsDir)/estimate-prosign-@(Model.Id).png}
|
||||
\end{center}
|
||||
</text>
|
||||
}
|
||||
</text>
|
||||
}
|
||||
\end{document}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
@model NominativeServiceCommand
|
||||
@inject IOptions<PayPalSettings> PayPalSettings
|
||||
|
||||
@if (Model!=null && Model.PaymentId!=null) {
|
||||
|
||||
@if (Model.Regularisation.Executor.Id == User.GetUserId()) {
|
||||
<text>
|
||||
Votre paiment
|
||||
</text>
|
||||
} else {
|
||||
<text>
|
||||
Le paiment de @Html.DisplayFor(m=>m.Regularisation.Executor.UserName)
|
||||
</text>
|
||||
}
|
||||
<text> :
|
||||
|
||||
</text>
|
||||
<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>
|
||||
|
||||
}
|
||||
|
||||
@if (!Model.GetIsAcquitted()) {
|
||||
<div id="paypalzone"></div>
|
||||
<script>
|
||||
var CREATE_PAYMENT_URL = '@ViewBag.CreatePaymentUrl';
|
||||
var EXECUTE_PAYMENT_URL = '@ViewBag.ExecutePaymentUrl';
|
||||
var PAYPAL_ENV = '@PayPalSettings.Value.Mode';
|
||||
var MERCH_ID = '@PayPalSettings.Value.';
|
||||
|
||||
|
||||
paypal.checkout.setup(MERCH_ID, {
|
||||
environment: PAYPAL_ENV,
|
||||
container: '#paypalzone',
|
||||
click: function () {
|
||||
paypal.checkout.initXO();
|
||||
var action = $.post(CREATE_PAYMENT_URL)
|
||||
.done(function (data) {
|
||||
paypal.checkout.startFlow(data.token)
|
||||
})
|
||||
.fail(function () {
|
||||
paypal.checkout.closeFlow()
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
}
|
||||
17
src/Yavsc/Views/Shared/Components/Tagger/Default.cshtml
Normal file
17
src/Yavsc/Views/Shared/Components/Tagger/Default.cshtml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
@using Yavsc.Interfaces;
|
||||
@using System;
|
||||
@model ITaggable<long>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<ul>
|
||||
@foreach (string tag in (string[]) ViewData["Tags"]) {
|
||||
<li>@tag</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue