finish facture requirements (add nom defunt and sexe detunt add the last product in the table , add date to the last product in the table)
This commit is contained in:
parent
fca12c05dc
commit
0fcbc2c0c9
@ -2322,6 +2322,7 @@ class Bdd {
|
|||||||
client.entreprise as client_entreprise,
|
client.entreprise as client_entreprise,
|
||||||
client.adresse as client_adresse,
|
client.adresse as client_adresse,
|
||||||
defunt.nom as defunt_nom,
|
defunt.nom as defunt_nom,
|
||||||
|
defunt.sexe as defunt_sexe,
|
||||||
lieu.nom as lieu_nom,
|
lieu.nom as lieu_nom,
|
||||||
lieu.adresse as lieu_adresse,
|
lieu.adresse as lieu_adresse,
|
||||||
thanato.nom as thanato_nom,
|
thanato.nom as thanato_nom,
|
||||||
|
|||||||
@ -27,4 +27,8 @@ class FileExportHelpers
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function GetSexeLabel(string $sexeKey){
|
||||||
|
return $sexeKey === 'f' ? 'Mme' : 'Mr';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@ namespace OCA\Gestion\Service;
|
|||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use \FPDF;
|
use \FPDF;
|
||||||
|
use OCA\Gestion\Helpers\FileExportHelpers;
|
||||||
use OCA\Gestion\Helpers\PriceHelpers;
|
use OCA\Gestion\Helpers\PriceHelpers;
|
||||||
|
|
||||||
class InvoicePdfHandler extends FPDF {
|
class InvoicePdfHandler extends FPDF {
|
||||||
@ -133,17 +134,24 @@ sera due sur présentation de justificatifs ( articles L.441-3 et L.441-6 du cod
|
|||||||
|
|
||||||
$totalHt = 0;
|
$totalHt = 0;
|
||||||
$totalTtc = 0;
|
$totalTtc = 0;
|
||||||
foreach($this->factureData["products"] as $product){
|
$products = $this->factureData["products"];
|
||||||
|
foreach($products as $product){
|
||||||
$valueHt = $product['produit_price'];
|
$valueHt = $product['produit_price'];
|
||||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||||
$totalHt+=$valueHt;
|
$totalHt+=$valueHt;
|
||||||
$totalTtc+=$valueTtc;
|
$totalTtc+=$valueTtc;
|
||||||
$descriptionLineNumber = $this->NbLines(90,$product["produit_description"]);
|
$descriptionLineNumber = $this->NbLines(90,$product["produit_description"]);
|
||||||
$articleListMaxHeight = $descriptionLineNumber * 10;
|
$productDescription = $product["produit_description"];
|
||||||
|
$dateValue = "";
|
||||||
|
if($product === end($products)){
|
||||||
|
$dateValue = $devisDate;
|
||||||
|
$productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->factureData['defunt_sexe']) . ' '. $this->factureData["defunt_nom"];
|
||||||
|
}
|
||||||
|
$articleListMaxHeight = $descriptionLineNumber * 6;
|
||||||
$tvaAmount = $valueTtc - $valueHt;
|
$tvaAmount = $valueTtc - $valueHt;
|
||||||
$this->SetFont('Arial', '', 10);
|
$this->SetFont('Arial', '', 10);
|
||||||
$this->Cell(20, $articleListMaxHeight, $devisDate, 'LR',0);
|
$this->Cell(20, $articleListMaxHeight, $dateValue, 'LR',0);
|
||||||
$this->MultiAlignCell(90, $articleListMaxHeight, utf8_decode(html_entity_decode($product["produit_description"])),'LR','0',);
|
$this->MultiAlignCell(90, $articleListMaxHeight, utf8_decode(html_entity_decode($productDescription)),'LR','0',);
|
||||||
$this->Cell(30, $articleListMaxHeight, number_format($valueHt,2,'.','').chr(128), 'LR', 0, 'C');
|
$this->Cell(30, $articleListMaxHeight, number_format($valueHt,2,'.','').chr(128), 'LR', 0, 'C');
|
||||||
$this->Cell(20, $articleListMaxHeight, number_format($tvaAmount,2,'.','').chr(128), 'LR', 0, 'C');
|
$this->Cell(20, $articleListMaxHeight, number_format($tvaAmount,2,'.','').chr(128), 'LR', 0, 'C');
|
||||||
$this->Cell(30, $articleListMaxHeight, number_format($valueTtc,2,'.','').chr(128), 'LR', 1, 'C');
|
$this->Cell(30, $articleListMaxHeight, number_format($valueTtc,2,'.','').chr(128), 'LR', 1, 'C');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user