Merge pull request 'feat(pdfgen): Ajout des demi-repas dans le plan de tables pour le repas du soir' (#1) from feat/demi_repas into main
Reviewed-on: #1main
révision
e945178724
|
@ -52,7 +52,7 @@ $ref_repasMidiRestaurant = array("'".$allProductReferences[ref21]."'", "'".$allP
|
|||
$ref_repasMidiChambre = array("'".$allProductReferences[ref19]."'");
|
||||
|
||||
//Référence repas du soir
|
||||
$ref_repasSoir = array("'".$allProductReferences[ref2]."'", "'".$allProductReferences[ref20]."'");
|
||||
$ref_repasSoir = array("'".$allProductReferences[ref2]."'", "'".$allProductReferences[ref20]."'", "'".$allProductReferences[ref80]."'");
|
||||
|
||||
//Référence goûter
|
||||
$ref_gouter = array("'".$allProductReferences[ref10]."'");
|
||||
|
@ -196,9 +196,10 @@ $pdf->SetFillColor(205,205,193);
|
|||
* @param string $title
|
||||
* @param string $productRef
|
||||
* @param string $tableHead
|
||||
* @param bool $evening
|
||||
*/
|
||||
function planTablesRomList($title, $productRef, $tableHead){
|
||||
global $pdf, $NO_FOUND_ORDER_MESSAGE, $filtringDate;
|
||||
function planTablesRomList($title, $productRef, $tableHead, $evening=false){
|
||||
global $pdf, $NO_FOUND_ORDER_MESSAGE, $filtringDate, $db;
|
||||
//Titre
|
||||
$pdf->Ln(5);
|
||||
$pdf->Cell(30,8,utf8_decode("$title"),0,0,'L');
|
||||
|
@ -221,6 +222,9 @@ function planTablesRomList($title, $productRef, $tableHead){
|
|||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->Cell(80,6,utf8_decode($tableHead),1,0,'C',true);
|
||||
$pdf->Cell(50,6,utf8_decode("Numéro de chambre"),1,0,'C',true);
|
||||
if($evening){
|
||||
$pdf->Cell(50,6,utf8_decode("Demi-repas"),1,0,'C',true);
|
||||
}
|
||||
$pdf->Ln();
|
||||
|
||||
//Affichage des noms
|
||||
|
@ -245,14 +249,30 @@ function planTablesRomList($title, $productRef, $tableHead){
|
|||
$tableRowid_numRoom[1] = "";
|
||||
}
|
||||
//Numéro de chambre
|
||||
$roomCell = 1;
|
||||
if($evening){
|
||||
$roomCell = 0;
|
||||
}
|
||||
if($tableRowid_numRoom[1]==50 || $tableRowid_numRoom[1]==91){
|
||||
//Chambres d'accueil
|
||||
$pdf->Cell(50,6,utf8_decode($tableRowid_numRoom[1].$tableRowid_numRoom[2]." ".$tableRowid_numRoom[3]." ".$tableRowid_numRoom[4]),1,1,'C');
|
||||
$pdf->Cell(50,6,utf8_decode($tableRowid_numRoom[1].$tableRowid_numRoom[2]." ".$tableRowid_numRoom[3]." ".$tableRowid_numRoom[4]),1,$roomCell,'C');
|
||||
}
|
||||
else {
|
||||
//Chambres normales
|
||||
$pdf->Cell(50,6,utf8_decode($tableRowid_numRoom[1]),1,1,'C');
|
||||
$pdf->Cell(50,6,utf8_decode($tableRowid_numRoom[1]),1,$roomCell,'C');
|
||||
}
|
||||
// Si on est le soir, on ajoute une cellule avec le demi repas
|
||||
if($evening){
|
||||
$demiRepasQuery = $db->query("SELECT demi_repas FROM llx_socpeople, llx_socpeople_extrafields WHERE numero_de_chambre = $tableRowid_numRoom[1] and llx_socpeople.rowid = llx_socpeople_extrafields.fk_object and llx_socpeople.fk_soc IN ($matchedSocieteId) LIMIT 1");
|
||||
if($db->num_rows($demiRepasQuery) != 0){
|
||||
foreach($demiRepasQuery as $row){
|
||||
$demiRepas = $row['demi_repas'];
|
||||
if($demiRepas == 1){ $drValue = "Oui";}
|
||||
else{ $drValue = "Non";}
|
||||
}
|
||||
$pdf->Cell(50, 6, utf8_decode($drValue), 1, 1, 'C');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -392,7 +412,7 @@ planTablesRestaurantList("Repas de midi au restaurant", $ref_repasMidiRestaurant
|
|||
|
||||
/*************** Liste des personnes qui mange au soir *************************/
|
||||
$pdf->Ln(5);
|
||||
planTablesRomList("Repas du soir", $ref_repasSoir, "Nom");
|
||||
planTablesRomList("Repas du soir", $ref_repasSoir, "Nom", true);
|
||||
|
||||
//$pdf->Output();
|
||||
$pdf->Output("plan_tables.pdf", "D");
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket