Merge branch 'staging' into releases/release-hytha-prod

This commit is contained in:
Tiavina 2025-03-04 11:41:39 +03:00
commit 00d7bc6478
29 changed files with 394 additions and 333 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2566,6 +2566,7 @@ class Bdd {
produit.prix_unitaire as produit_price,
produit.reference as produit_reference,
produit.description as produit_description,
produit.fk_product_type_id as fk_product_type_id,
produit.vat as produit_vat,
devis.id_client as devis_client_id
FROM ".$this->tableprefix ."produit_devis as produit_devis
@ -2855,6 +2856,17 @@ class Bdd {
}
}
$products = $this->getDevisProduits($devis["devis_id"]);
if(count($products) > 1){
usort($products, function ($a, $b) {
if ($a["fk_product_type_id"] === null && $b["fk_product_type_id"] !== null) {
return -1;
}
if ($a["fk_product_type_id"] !== null && $b["fk_product_type_id"] === null) {
return 1;
}
return 0;
});
}
foreach($products as $product){
$valueHt = $product['produit_price'] * $product['quantite'];
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);

View File

@ -59,7 +59,7 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($subcontractorCaseNumberText),0,'0',);
$yValue += 6;
foreach($products as $product){
$valueHt = $product['produit_price'];
$valueHt = $product['produit_price'] * $product["quantite"];
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
$totalHt+=$valueHt;
$totalTtc+=$valueTtc;
@ -69,15 +69,26 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
$dateValue = $devisDate;
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
}
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionIsMultiline = $productDescriptionWidth > $maxDescriptionWidth;
$tvaAmount = $valueTtc - $valueHt;
$this->SetXY( 8,$yValue );
$this->Cell(20, 6, $dateValue, 0,0);
$this->SetXY( 35,$yValue );
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($productDescription),0,'0',);
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
$productDescriptionIsMultiline = false;
if ($productDescriptionWidthIsGreaterThanMaxWidth) {
$yBefore = $this->GetY();
$this->MultiCell($maxDescriptionWidth, 6, $productDescription,0,'L');
$yAfter = $this->GetY();
$productDescriptionIsMultiline = ($yAfter - $yBefore) > 6;
if($productDescriptionIsMultiline){
$this->SetXY($this->GetX(),$yBefore);
}
} else {
$this->Cell($maxDescriptionWidth, 6, $productDescription);
}
$this->SetXY( 138,$yValue );
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');

View File

@ -219,7 +219,7 @@ class InvoiceGroupPdfHandler extends FPDF {
$totalTtc = 0;
$totalTva = 0;
$yValue = $this->startingYOfArticlesTable + 11;
$maxDescriptionWidth = 104;
$maxDescriptionWidth = 98;
$currentIndexPosition = $this->currentIndexPosition;
for($currentIndexPosition;$currentIndexPosition<($this->initialIndexPosition + $this->devisCountToGet);$currentIndexPosition++){
$currentDevis = $devisData[$currentIndexPosition];
@ -227,29 +227,37 @@ class InvoiceGroupPdfHandler extends FPDF {
$devisDate = DateTime::createFromFormat('Y-m-d',$devisDate);
$devisDate = $devisDate->format('d-m-Y');
$products = $currentDevis["products"];
$productIncrement = 0;
foreach($products as $product){
$valueHt = $product['produit_price'];
$valueHt = $product['produit_price'] * $product["quantite"];
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
$totalHt+=$valueHt;
$totalTtc+=$valueTtc;
$productDescription = $product["produit_description"] ?? "";
$dateValue = "";
if($product === end($products)){
if($productIncrement == 0){
$dateValue = $devisDate;
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
}
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionIsMultiline = $productDescriptionWidth > $maxDescriptionWidth;
$tvaAmount = $valueTtc - $valueHt;
$this->SetXY( 8,$yValue );
$this->Cell(20, 6, $dateValue, 0,0);
$this->SetXY( 35,$yValue );
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
$productDescriptionIsMultiline = false;
if ($productDescriptionWidthIsGreaterThanMaxWidth) {
$yBefore = $this->GetY();
$this->MultiCell($maxDescriptionWidth, 6, $productDescription,0,'L');
$yAfter = $this->GetY();
$productDescriptionIsMultiline = ($yAfter - $yBefore) > 6;
if($productDescriptionIsMultiline){
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($productDescription),0,'0',);
$this->SetXY($this->GetX(),$yBefore);
}
else{
$this->Cell(100,6,FileExportHelpers::FormatTextForExport($productDescription),0,0);
} else {
$this->Cell($maxDescriptionWidth, 6, $productDescription);
}
$this->SetXY( 138,$yValue );
@ -262,9 +270,10 @@ class InvoiceGroupPdfHandler extends FPDF {
$this->Cell(25, 6, number_format($valueTtc,2,'.','').chr(128), 0, 1, 'C');
$yValue += 6;
$totalTva += $tvaAmount;
if($productDescriptionIsMultiline){
if($productDescriptionWidthIsGreaterThanMaxWidth){
$yValue += 6;
}
$productIncrement++;
}
}
$this->currentIndexPosition = $currentIndexPosition;

View File

@ -127,3 +127,19 @@ table.dataTable.display tbody tr.even > [class*="sorting_"] {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
#additionalDefuntData {
opacity: 0;
transform: scaleY(0);
transform-origin: top;
overflow: hidden;
height: 0; /* Initially hidden with no height */
transition: opacity 0.5s ease, transform 0.5s ease, height 0.5s ease;
}
/* Visible state (smooth transition when showing) */
#additionalDefuntData.visibleContent {
opacity: 1;
transform: scaleY(1);
height: auto; /* Automatically adjusts the height when showing */
}

View File

@ -39,6 +39,7 @@ window.addEventListener("DOMContentLoaded", function () {
let lavageInput = document.getElementById("lavage-input");
let cosmetiquesInput = document.getElementById("cosmetiques-input");
let surInput = document.getElementById("sur-input");
let buttonEditCareRapport = this.document.getElementById("buttonEditCareRapport");
accesInput.addEventListener("keyup", (e) => autocomplete("acces"));
rigiditeInput.addEventListener("keyup", (e) => autocomplete("rigidite"));
@ -55,6 +56,11 @@ window.addEventListener("DOMContentLoaded", function () {
cosmetiquesInput.addEventListener("keyup", (e) => autocomplete("cosmetiques"));
surInput.addEventListener("keyup", (e) => autocomplete("sur"));
buttonEditCareRapport.addEventListener("click",function(){
var div = document.getElementById("additionalDefuntData");
div.classList.toggle("visibleContent");
})
observations.addEventListener("keyup", (e) => {
if(e.target.className.includes("editable-obs")) {
autocompleteObs(e.target.id);

View File

@ -136,6 +136,12 @@
</div>
</div>
</div>
<div>
<button id="buttonEditCareRapport" class="btn btn-secondary" type="button">
Editer rapport de soin
</button>
</div>
<div id="additionalDefuntData" class="hiddenContent pt-2">
<div class="col-6" style="margin-bottom: 32px">
<h6>ÉTATS DU CORPS</h6>
<hr>
@ -445,6 +451,7 @@
</div>
</div>
</div>
</div>
<div class="col-12" style="margin-bottom: 32px">
<div class="d-flex flex-row justify-content-between">
<div><h6>OBSERVATIONS</h6></div>