Merge branch 'features/feature-group-facturation' into staging

This commit is contained in:
Tiavina 2025-01-23 16:55:00 +03:00
commit 97164496b8
2 changed files with 10 additions and 2 deletions

View File

@ -2673,6 +2673,7 @@ class Bdd {
devis.comment as devis_comment,
devis.id_client as devis_id_client,
client.nom as client_nom,
client.prenom as client_prenom,
client.entreprise as client_entreprise,
client.adresse as client_adresse,
defunt.nom as defunt_nom,
@ -2681,6 +2682,7 @@ class Bdd {
lieu.adresse as lieu_adresse,
thanato.nom as thanato_nom,
thanato.prenom as thanato_prenom,
client_group_facturation.group_facturation_name as group_facturation_name,
'group' as facture_type
FROM ".$this->tableprefix."facture as facture
LEFT JOIN ".$this->tableprefix."devis as devis on facture.id_devis = devis.id
@ -2688,6 +2690,7 @@ class Bdd {
LEFT JOIN ".$this->tableprefix."defunt as defunt on devis.id_defunt = defunt.id
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.id
LEFT JOIN ".$this->tableprefix."thanato as thanato on devis.id_thanato = thanato.id
LEFT JOIN ".$this->tableprefix."client_group_facturation as client_group_facturation on client.fk_client_group_facturation_id = client_group_facturation.id
WHERE client.id IN ($clientIdsSqlPlaceholder) AND
YEAR(facture.date_paiement) = ?";
@ -2724,6 +2727,7 @@ class Bdd {
devis.comment as devis_comment,
devis.id_client as devis_id_client,
client.nom as client_nom,
client.prenom as client_prenom,
client.entreprise as client_entreprise,
client.adresse as client_adresse,
defunt.nom as defunt_nom,

View File

@ -80,7 +80,7 @@ class InvoicePdfHandler extends FPDF {
$filename = mb_strtoupper($factureData["client_prenom"],'UTF-8');
}
else{
$filename = 'GROUP_'.mb_strtoupper($factureData["client_nom"],'UTF-8');
$filename = 'GROUPE_'.mb_strtoupper($factureData["group_facturation_name"],'UTF-8');
}
$filename .= $month != 0 ? '_'.DateHelpers::GetMonthPlainString($month) :'';
$filename .= "_".$year;
@ -97,10 +97,14 @@ class InvoicePdfHandler extends FPDF {
}
private function DrawInvoiceCompanyAndClientInfo(){
$clientName = $this->factureData['client_nom'];
if($this->factureData['facture_type'] == MultipleFactureTypeConstant::GROUP_FILTER_TYPE){
$clientName = $this->factureData['group_facturation_name'];
}
$this->SetY(40);
$this->SetFont('ComicSans', '', 12);
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->factureData['configuration']->entreprise), 0, 0);
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->factureData['client_nom']), 0, 1,'R');
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($clientName), 0, 1,'R');
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse']), 0, 0);
$this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_real_adress'])), 0, 1,'R');
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse_city']), 0, 0);border: