Merge branch 'fixes/fix-case-and-order-number' into staging
This commit is contained in:
commit
ee1e9b0db9
@ -661,7 +661,7 @@ class Bdd {
|
|||||||
|
|
||||||
public function getOneDevis($numdevis,$idNextcloud){
|
public function getOneDevis($numdevis,$idNextcloud){
|
||||||
$sql = "SELECT ".$this->tableprefix."devis.id as devisid, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.comment, ".$this->tableprefix."devis.date, num,"
|
$sql = "SELECT ".$this->tableprefix."devis.id as devisid, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.comment, ".$this->tableprefix."devis.date, num,"
|
||||||
.$this->tableprefix."devis.id_nextcloud as didnextcloud,".$this->tableprefix."devis.id_client, id_lieu, id_thanato,"
|
.$this->tableprefix."devis.id_nextcloud as didnextcloud,".$this->tableprefix."devis.id_client, id_lieu, id_thanato,case_number,order_number,"
|
||||||
.$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt,"
|
.$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt,"
|
||||||
.$this->tableprefix."client.id as clientid, ".$this->tableprefix."client.nom, "
|
.$this->tableprefix."client.id as clientid, ".$this->tableprefix."client.nom, "
|
||||||
.$this->tableprefix."client.prenom, legal_one, entreprise, telephone, mail, ".$this->tableprefix."client.adresse,"
|
.$this->tableprefix."client.prenom, legal_one, entreprise, telephone, mail, ".$this->tableprefix."client.adresse,"
|
||||||
|
|||||||
@ -39,6 +39,9 @@ class InvoicePdfHandler extends FPDF {
|
|||||||
private $factureData = [];
|
private $factureData = [];
|
||||||
private $logo = null;
|
private $logo = null;
|
||||||
private $logoPath = "/var/www/html/data/admin/files/.gestion/";
|
private $logoPath = "/var/www/html/data/admin/files/.gestion/";
|
||||||
|
|
||||||
|
private $thereIsOrderOrCaseNumber = false;
|
||||||
|
private $startingYOfArticlesTable = 95;
|
||||||
function Header()
|
function Header()
|
||||||
{
|
{
|
||||||
if($this->logo != "nothing"){
|
if($this->logo != "nothing"){
|
||||||
@ -164,53 +167,58 @@ class InvoicePdfHandler extends FPDF {
|
|||||||
$this->Cell(40, 7, $this->factureData['num'], 1, 0, 'C');
|
$this->Cell(40, 7, $this->factureData['num'], 1, 0, 'C');
|
||||||
$this->Cell(40, 7, $factureDateEcheance, 1, 1, 'C');
|
$this->Cell(40, 7, $factureDateEcheance, 1, 1, 'C');
|
||||||
|
|
||||||
$this->Ln(2);
|
|
||||||
$orderNumberIsProvided = (trim($this->factureData['order_number']) !== "" && trim($this->factureData['order_number']) !== "-" );
|
$orderNumberIsProvided = (trim($this->factureData['order_number']) !== "" && trim($this->factureData['order_number']) !== "-" );
|
||||||
$caseNumberIsProvided = (trim($this->factureData['case_number']) !== "" && trim($this->factureData['case_number']) !== "-");
|
$caseNumberIsProvided = (trim($this->factureData['case_number']) !== "" && trim($this->factureData['case_number']) !== "-");
|
||||||
if($orderNumberIsProvided){
|
if($orderNumberIsProvided){
|
||||||
|
$this->thereIsOrderOrCaseNumber = true;
|
||||||
|
$this->Ln(2);
|
||||||
if($caseNumberIsProvided == false){
|
if($caseNumberIsProvided == false){
|
||||||
$this->Ln(3);
|
$this->Ln(3);
|
||||||
}
|
}
|
||||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport("Bon de commande: ".$this->factureData['order_number']),0,1,'C');
|
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport("Bon de commande: ".$this->factureData['order_number']),0,1,'C');
|
||||||
}
|
}
|
||||||
if($caseNumberIsProvided){
|
if($caseNumberIsProvided){
|
||||||
|
$this->thereIsOrderOrCaseNumber = true;
|
||||||
if($orderNumberIsProvided == false){
|
if($orderNumberIsProvided == false){
|
||||||
$this->Ln(3);
|
$this->Ln(5);
|
||||||
}
|
}
|
||||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport("Numéro de dossier: ".$this->factureData['case_number']),0,1,'C');
|
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport("Numéro de dossier: ".$this->factureData['case_number']),0,1,'C');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->Ln(8);
|
$this->startingYOfArticlesTable = $this->thereIsOrderOrCaseNumber ? 95 : 85;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function DrawArticlesTable(){
|
private function DrawArticlesTable(){
|
||||||
$this->SetLineWidth(0.2);
|
$this->SetLineWidth(0.2);
|
||||||
$this->Rect(3, 95, 204, 137, "D");
|
$gapBetweenStartingOfArticlesTableAndColumnName = 10;
|
||||||
|
$tableHeight = $this->thereIsOrderOrCaseNumber ? 137 : 137 + 10;
|
||||||
|
$this->Rect(3, $this->startingYOfArticlesTable, 204, $tableHeight, "D");
|
||||||
// cadre titre des colonnes
|
// cadre titre des colonnes
|
||||||
$this->Line(3, 105, 207,105);
|
$this->Line(3, $this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName, 207,$this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName);
|
||||||
// les traits verticaux colonnes
|
// les traits verticaux colonnes
|
||||||
$this->Line(35, 95, 35, 232);
|
$this->Line(35, $this->startingYOfArticlesTable, 35, 232);
|
||||||
$this->Line(135, 95, 135, 232);
|
$this->Line(135, $this->startingYOfArticlesTable, 135, 232);
|
||||||
$this->Line(160, 95, 160, 232);
|
$this->Line(160, $this->startingYOfArticlesTable, 160, 232);
|
||||||
$this->Line(180, 95, 180, 232);
|
$this->Line(180, $this->startingYOfArticlesTable, 180, 232);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function DrawArticlesTableHeader(){
|
private function DrawArticlesTableHeader(){
|
||||||
$tvaValue = $this->factureData["configuration"]->tva_default;
|
$tvaValue = $this->factureData["configuration"]->tva_default;
|
||||||
|
$columnNameY = $this->startingYOfArticlesTable + 1;
|
||||||
$this->SetFont('ComicSans','',10);
|
$this->SetFont('ComicSans','',10);
|
||||||
$this->SetXY( 9,96 );
|
$this->SetXY( 9,$columnNameY );
|
||||||
$this->Cell( 20, 8, "Date", 0, 0, 'C');
|
$this->Cell( 20, 8, "Date", 0, 0, 'C');
|
||||||
|
|
||||||
$this->SetXY( 35,96 );
|
$this->SetXY( 35,$columnNameY );
|
||||||
$this->Cell( 100, 8, "Description", 0, 0, 'C');
|
$this->Cell( 100, 8, "Description", 0, 0, 'C');
|
||||||
|
|
||||||
$this->SetXY( 138,96 );
|
$this->SetXY( 138,$columnNameY );
|
||||||
$this->Cell( 20, 8, "Prix Uni. HT", 0, 0, 'C');
|
$this->Cell( 20, 8, "Prix Uni. HT", 0, 0, 'C');
|
||||||
|
|
||||||
$this->SetXY( 160,96 );
|
$this->SetXY( 160,$columnNameY );
|
||||||
$this->Cell( 20, 8, 'TVA ' . $tvaValue . '%', 0, 0, 'C');
|
$this->Cell( 20, 8, 'TVA ' . $tvaValue . '%', 0, 0, 'C');
|
||||||
|
|
||||||
$this->SetXY( 181,96 );
|
$this->SetXY( 181,$columnNameY );
|
||||||
$this->Cell( 25, 8, "Prix Uni. TTC", 0, 0, 'C');
|
$this->Cell( 25, 8, "Prix Uni. TTC", 0, 0, 'C');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -225,7 +233,7 @@ class InvoicePdfHandler extends FPDF {
|
|||||||
$totalTtc = 0;
|
$totalTtc = 0;
|
||||||
$totalTva = 0;
|
$totalTva = 0;
|
||||||
$products = $this->factureData["products"];
|
$products = $this->factureData["products"];
|
||||||
$yValue = 106;
|
$yValue = $this->startingYOfArticlesTable + 11;
|
||||||
foreach($products as $product){
|
foreach($products as $product){
|
||||||
$valueHt = $product['produit_price'];
|
$valueHt = $product['produit_price'];
|
||||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||||
|
|||||||
@ -56,14 +56,32 @@
|
|||||||
<span>Date de soin : <b><?php echo (new DateTime($_['devis'][0]->date))->format('d-m-Y');?></b>,</span> <span id="devisid" data-id=<?php echo $_['devis'][0]->devisid;?>>Défunt associé : <b><?php echo $_['devis'][0]->nom_defunt;?></b></span><br/>
|
<span>Date de soin : <b><?php echo (new DateTime($_['devis'][0]->date))->format('d-m-Y');?></b>,</span> <span id="devisid" data-id=<?php echo $_['devis'][0]->devisid;?>>Défunt associé : <b><?php echo $_['devis'][0]->nom_defunt;?></b></span><br/>
|
||||||
<span>Lieu : <b><?php echo $_['devis'][0]->lieu;?> (<?php echo $_['devis'][0]->adresse_soin;?>)</b>
|
<span>Lieu : <b><?php echo $_['devis'][0]->lieu;?> (<?php echo $_['devis'][0]->adresse_soin;?>)</b>
|
||||||
</div>
|
</div>
|
||||||
|
<hr/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-md">
|
<div class="col col-md">
|
||||||
<hr />
|
<label class="fw-bold">Commande :</label>
|
||||||
<div class="col col-xl mb-3 text-center editable" id="deviscomment" style="display:inline" data-table="devis" data-column="comment" data-id="<?php echo $_['devis'][0]->devisid; ?>"><?php echo ($_['devis'][0]->comment == "" ) ? "-" : $_['devis'][0]->comment ; ?></div>
|
<div class="col col-xl mb-3 text-center editable"
|
||||||
<hr />
|
style="display:inline"
|
||||||
|
data-table="devis" data-column="order_number"
|
||||||
|
data-id="<?php echo $_['devis'][0]->devisid;?>">
|
||||||
|
<?php echo ($_['devis'][0]->order_number == "" ) ? "-" : $_['devis'][0]->order_number ; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col col-md">
|
||||||
|
<label class="fw-bold">Numéro de dossier :</label>
|
||||||
|
<div class="col col-xl mb-3 text-center editable"
|
||||||
|
style="display:inline"
|
||||||
|
data-table="devis" data-column="case_number"
|
||||||
|
data-id="<?php echo $_['devis'][0]->devisid;?>">
|
||||||
|
<?php echo ($_['devis'][0]->case_number == "" ) ? "-" : $_['devis'][0]->case_number ; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div><h2>Articles</h2></div>
|
<div><h2>Articles</h2></div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user