Merge branch 'fixes/fix-order-and-case-devis' into releases/release-hytha-prod

This commit is contained in:
Tiavina 2025-03-07 09:57:01 +03:00
commit d0f9cd08f9
2 changed files with 42 additions and 26 deletions

View File

@ -263,7 +263,8 @@ class Bdd {
.$this->tableprefix."client.adresse as adresse_cli,".$this->tableprefix."client.mail as mail_cli,".$this->tableprefix."client.telephone as telephone_cli,".$this->tableprefix."client.legal_one as legalone_cli,"
.$this->tableprefix."client.fk_client_group_facturation_id as fk_client_group_facturation_id,"
.$this->tableprefix."thanato.nom as nom_thanato, ".$this->tableprefix."thanato.prenom as prenom_thanato, ".$this->tableprefix."thanato.id as tid, "
.$this->tableprefix."devis.num, ".$this->tableprefix."devis.date, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.mentions, "
.$this->tableprefix."devis.num, ".$this->tableprefix."devis.date, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.mentions, "
.$this->tableprefix."devis.order_number, ".$this->tableprefix."devis.case_number, "
.$this->tableprefix."lieu.id as lid, ".$this->tableprefix."lieu.nom as lieu,".$this->tableprefix."lieu.adresse as adresse_soin,".$this->tableprefix."devis.id_lieu, "
.$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt, "
.$this->tableprefix."devis.devis_full_number as devis_full_number

View File

@ -115,16 +115,16 @@
}
;
foreach ($devis as $key => $d) {
foreach ($devis as $key => $currentDevis) {
?>
<div class="bootstrap-iso d-flex flex-column justify-content-between">
<div class="d-flex flex-column w-100">
<h2 class="mt-3 mb-3 text-center"> <?php p($l->t('Quote')); ?>
<div id="devisid" style="display:inline" data-table="devis" data-column="num"
data-id="<?php echo $d->id; ?>">sur le defunt <?php echo $d->nom_defunt; ?></div>
data-id="<?php echo $currentDevis->id; ?>">sur le defunt <?php echo $currentDevis->nom_defunt; ?></div>
<span data-html2canvas-ignore>(</span>
<div data-html2canvas-ignore id="devisversion" style="display:inline" data-table="devis"
data-column="version" data-id="<?php echo $d->id; ?>"><?php echo $d->lieu; ?>)</div>
data-column="version" data-id="<?php echo $currentDevis->id; ?>"><?php echo $currentDevis->lieu; ?>)</div>
</h2>
<hr />
<div class="row">
@ -152,21 +152,21 @@
</div>
<div class="col-5 h-100 m-0" style="min-height:250px;">
<h5 class="p-3 m-0 text-dark text-center border border-2 border-dark"><?php p($l->t('TO')); ?>
<span id="entreprise"><?php echo $d->entreprise ?></span></h6>
<span id="entreprise"><?php echo $currentDevis->entreprise ?></span></h6>
<p
class="p-3 m-0 h-auto text-center text-dark text-center border border-top-0 border-2 border-dark">
<span id="nomprenom" data-id="0" data-table="devis"
data-column="id_client"><?php echo $d->prenom . ' ' . $d->nom ?></span><br />
<span id="adresse"><?php echo $d->adresse_cli ?></span><br />
<span id="mail"><?php echo $d->mail_cli ?></span><br />
<span id="telephone"><?php echo $d->telephone_cli ?></span><br />
<span id="legal_one"><?php echo $d->legalone_cli ?></span><br />
data-column="id_client"><?php echo $currentDevis->prenom . ' ' . $currentDevis->nom ?></span><br />
<span id="adresse"><?php echo $currentDevis->adresse_cli ?></span><br />
<span id="mail"><?php echo $currentDevis->mail_cli ?></span><br />
<span id="telephone"><?php echo $currentDevis->telephone_cli ?></span><br />
<span id="legal_one"><?php echo $currentDevis->legalone_cli ?></span><br />
<span id="dateContext" style="display: none"><?php echo $facture->date ?></span>
<span id="nomcli" style="display: none"><?php echo $d->prenom . ' ' . $d->nom ?></span>
<span id="idcli" style="display: none"><?php echo $d->id_cli ?></span>
<span id="etp" style="display: none"><?php echo $d->entreprise ?></span>
<span id="nomcli" style="display: none"><?php echo $currentDevis->prenom . ' ' . $currentDevis->nom ?></span>
<span id="idcli" style="display: none"><?php echo $currentDevis->id_cli ?></span>
<span id="etp" style="display: none"><?php echo $currentDevis->entreprise ?></span>
<span class="pdf"
style="display: none"><?php echo $d->entreprise . "_" . $d->id . "_v" . $d->version ?></span>
style="display: none"><?php echo $currentDevis->entreprise . "_" . $currentDevis->id . "_v" . $currentDevis->version ?></span>
</p>
</div>
</div>
@ -175,7 +175,7 @@
<hr />
<div class="col col-xl mb-3 text-center">
<b><span><?php p($l->t('Offer valid for 1 month from')); ?> :
</span><span><?php echo (new DateTime($d->date))->format('d-m-Y'); ?></span></b></div>
</span><span><?php echo (new DateTime($currentDevis->date))->format('d-m-Y'); ?></span></b></div>
<hr />
</div>
</div>
@ -183,21 +183,36 @@
<div class="col col-md">
<div class="col col-xl text-center">
<span>Date de soin :
<b><?php echo (new DateTime($d->date))->format('d-m-Y'); ?></b>,</span>&nbsp;<span
id="devisid" data-id=<?php echo $d->id; ?>>Defunt associé :
<b><?php echo $d->num; ?></b></span><br />
<span>Lieu : <b><?php echo $d->lieu; ?> (<?php echo $d->adresse_soin; ?>)</b>
<b><?php echo (new DateTime($currentDevis->date))->format('d-m-Y'); ?></b>,</span>&nbsp;<span
id="devisid" data-id=<?php echo $currentDevis->id; ?>>Defunt associé :
<b><?php echo $currentDevis->nom_defunt; ?></b></span><br />
<span>Lieu : <b><?php echo $currentDevis->lieu; ?> (<?php echo $currentDevis->adresse_soin; ?>)</b>
</div>
</div>
</div>
<div class="row">
<div class="col col-md">
<hr />
<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 $d->id; ?>">
<?php echo ($d->comment == "") ? "-" : $d->comment; ?></div>
<hr />
<label class="fw-bold">Commande :</label>
<div class="col col-xl mb-3 text-center editable"
style="display:inline"
data-table="devis" data-column="order_number"
data-id="<?php echo $currentDevis->id;?>">
<?php echo ($currentDevis->order_number == "" ) ? "-" : $currentDevis->order_number ; ?>
</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 $currentDevis->id;?>">
<?php echo ($currentDevis->case_number == "" ) ? "-" : $currentDevis->case_number ; ?>
</div>
</div>
<hr />
</div>
<div class="table-responsive">
<table id="produits" data-type="facture" class="table table-striped">
@ -212,7 +227,7 @@
</tr>
</thead>
<tbody>
<?php foreach ($d->dproduits as $key => $produit) { ?>
<?php foreach ($currentDevis->dproduits as $key => $produit) { ?>
<tr>
<td><?php echo $produit->reference ?></td>
<td><?php echo $produit->description ?></td>
@ -242,7 +257,7 @@
$tva = json_decode($_['configuration'])[0]->tva_default;
$totalttc = 0;
$totalprice = 0;
foreach ($d->dproduits as $key => $produit) {
foreach ($currentDevis->dproduits as $key => $produit) {
$totalhtc = $totalhtc + ($produit->quantite * $produit->prix_unitaire);
}
$totalttc = ($totalhtc * $tva) / 100;