Merge branch 'hotfixes/hotfixes-certificate-folder' into staging
This commit is contained in:
commit
a24b9e613c
@ -1978,7 +1978,7 @@ class PageController extends Controller {
|
|||||||
* @param string $numdefunt
|
* @param string $numdefunt
|
||||||
*/
|
*/
|
||||||
public function saveRapportSoin($numdefunt){
|
public function saveRapportSoin($numdefunt){
|
||||||
$current_config = json_decode($this->myDb->getConfiguration($this->idNextcloud));
|
$defaultConfig = json_decode($this->myDb->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD));
|
||||||
$defunt = json_decode($this->myDb->getOneDefunt($numdefunt, $this->idNextcloud))[0];
|
$defunt = json_decode($this->myDb->getOneDefunt($numdefunt, $this->idNextcloud))[0];
|
||||||
$observations = json_decode($this->myDb->getListObservations($numdefunt, $this->idNextcloud));
|
$observations = json_decode($this->myDb->getListObservations($numdefunt, $this->idNextcloud));
|
||||||
$hypodermiques = json_decode($this->myDb->getListHypodermiques($numdefunt, $this->idNextcloud));
|
$hypodermiques = json_decode($this->myDb->getListHypodermiques($numdefunt, $this->idNextcloud));
|
||||||
@ -1998,7 +1998,12 @@ class PageController extends Controller {
|
|||||||
$date_devis = $formatter->format(DateTime::createFromFormat('d-m-Y', $date_devis_temp));
|
$date_devis = $formatter->format(DateTime::createFromFormat('d-m-Y', $date_devis_temp));
|
||||||
$today = $formatter->format(DateTime::createFromFormat('d-m-Y', $date_temp));
|
$today = $formatter->format(DateTime::createFromFormat('d-m-Y', $date_temp));
|
||||||
|
|
||||||
$folderDestination = html_entity_decode($current_config[0]->path).'/CLIENTS/'.strtoupper($defunt->entreprise).'/DEFUNTS/'.strtoupper($nomDefunt).'/RAPPORTS/';
|
$folderDestination = FileExportHelpers::GetDefuntsFolder(
|
||||||
|
$defunt->nom,
|
||||||
|
$defunt->nom_defunt,
|
||||||
|
$defaultConfig[0]->path.'/'
|
||||||
|
);
|
||||||
|
$folderDestination .= 'RAPPORTS/';
|
||||||
try {
|
try {
|
||||||
$this->storage->newFolder($folderDestination);
|
$this->storage->newFolder($folderDestination);
|
||||||
} catch(\OCP\Files\NotPermittedException $e) { }
|
} catch(\OCP\Files\NotPermittedException $e) { }
|
||||||
@ -2083,9 +2088,9 @@ class PageController extends Controller {
|
|||||||
$pdf->SetXY(($col_width*2)+15, $pdf->GetY()-8); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($defunt->drainage_etat)), 'LR', 'C');
|
$pdf->SetXY(($col_width*2)+15, $pdf->GetY()-8); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($defunt->drainage_etat)), 'LR', 'C');
|
||||||
$pdf->Line(15, $pdf->GetY(), $pdf->GetPageWidth()-15, $pdf->GetY());
|
$pdf->Line(15, $pdf->GetY(), $pdf->GetPageWidth()-15, $pdf->GetY());
|
||||||
|
|
||||||
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_one))), '', 'C');
|
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_one))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_two))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_two))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->telephone))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->telephone))), '', 'C');
|
||||||
|
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
|
||||||
@ -2150,9 +2155,9 @@ class PageController extends Controller {
|
|||||||
$col_width = round(($pdf->GetPageWidth()-30)/2);
|
$col_width = round(($pdf->GetPageWidth()-30)/2);
|
||||||
foreach ($observations as $key => $obs) {
|
foreach ($observations as $key => $obs) {
|
||||||
if($pdf->getY()>=($pdf->GetPageHeight()-45)) {
|
if($pdf->getY()>=($pdf->GetPageHeight()-45)) {
|
||||||
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_one))), '', 'C');
|
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_one))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_two))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_two))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->telephone))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->telephone))), '', 'C');
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
}
|
}
|
||||||
$pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($obs->designation)), 'LTRB', 'L');
|
$pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($obs->designation)), 'LTRB', 'L');
|
||||||
@ -2162,16 +2167,16 @@ class PageController extends Controller {
|
|||||||
$pdf->setY($pdf->GetY()+10);
|
$pdf->setY($pdf->GetY()+10);
|
||||||
|
|
||||||
if($pdf->getY()>=($pdf->GetPageHeight()-45)) {
|
if($pdf->getY()>=($pdf->GetPageHeight()-45)) {
|
||||||
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_one))), '', 'C');
|
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_one))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_two))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_two))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->telephone))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->telephone))), '', 'C');
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// signature
|
// signature
|
||||||
$pdf->SetFont('ComicSans','',11);
|
$pdf->SetFont('ComicSans','',11);
|
||||||
$pdf->setY($pdf->GetY()+10);
|
$pdf->setY($pdf->GetY()+10);
|
||||||
$pdf->Cell( $pdf->GetPageWidth()-30, 0, utf8_decode(html_entity_decode($current_config[0]->nom).' '.html_entity_decode($current_config[0]->prenom)), 0, 0, 'L');
|
$pdf->Cell( $pdf->GetPageWidth()-30, 0, utf8_decode(html_entity_decode($defaultConfig[0]->nom).' '.html_entity_decode($defaultConfig[0]->prenom)), 0, 0, 'L');
|
||||||
$pdf->setY($pdf->GetY()+5);
|
$pdf->setY($pdf->GetY()+5);
|
||||||
|
|
||||||
$signatureExist = $this->signatureImageExists('sign.png');
|
$signatureExist = $this->signatureImageExists('sign.png');
|
||||||
@ -2182,9 +2187,9 @@ class PageController extends Controller {
|
|||||||
$pdf->setY($pdf->GetY()-5);
|
$pdf->setY($pdf->GetY()-5);
|
||||||
$pdf->SetFont('ComicSans','',11); $pdf->Cell( $pdf->GetPageWidth()-80, 0, "Pour :", 0, 0, 'R');
|
$pdf->SetFont('ComicSans','',11); $pdf->Cell( $pdf->GetPageWidth()-80, 0, "Pour :", 0, 0, 'R');
|
||||||
|
|
||||||
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_one))), '', 'C');
|
$pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_one))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->legal_two))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->legal_two))), '', 'C');
|
||||||
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $current_config[0]->telephone))), '', 'C');
|
$pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, utf8_decode(html_entity_decode(iconv("UTF-8", "ISO-8859-1//TRANSLIT", $defaultConfig[0]->telephone))), '', 'C');
|
||||||
|
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
$pdf->Image($this->src_path.(($defunt->sexe=='m'?'facehomme.jpg':'facefemme.jpg')), 0, 0, $pdf->GetPageWidth(), $pdf->GetPageHeight());
|
$pdf->Image($this->src_path.(($defunt->sexe=='m'?'facehomme.jpg':'facefemme.jpg')), 0, 0, $pdf->GetPageWidth(), $pdf->GetPageHeight());
|
||||||
@ -2253,8 +2258,13 @@ class PageController extends Controller {
|
|||||||
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::LONG, IntlDateFormatter::NONE);
|
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::LONG, IntlDateFormatter::NONE);
|
||||||
$today = $formatter->format(DateTime::createFromFormat('d-m-Y', $date_temp));
|
$today = $formatter->format(DateTime::createFromFormat('d-m-Y', $date_temp));
|
||||||
|
|
||||||
$folderDestination = html_entity_decode($defaultConfig[0]->path).'/CLIENTS/'.strtoupper($defunt->entreprise).'/DEFUNTS/'.strtoupper($nomDefunt).'/RAPPORTS/';
|
// $folderDestination = html_entity_decode($defaultConfig[0]->path).'/CLIENTS/'.strtoupper($defunt->entreprise).'/DEFUNTS/'.strtoupper($nomDefunt).'/RAPPORTS/';
|
||||||
|
$folderDestination = FileExportHelpers::GetDefuntsFolder(
|
||||||
|
$defunt->nom,
|
||||||
|
$defunt->nom_defunt,
|
||||||
|
$defaultConfig[0]->path.'/'
|
||||||
|
);
|
||||||
|
$folderDestination .= 'RAPPORTS/';
|
||||||
try {
|
try {
|
||||||
$this->storage->newFolder($folderDestination);
|
$this->storage->newFolder($folderDestination);
|
||||||
} catch(\OCP\Files\NotPermittedException $e) { }
|
} catch(\OCP\Files\NotPermittedException $e) { }
|
||||||
|
|||||||
@ -535,12 +535,14 @@ class Bdd {
|
|||||||
$sql = "SELECT ".$this->tableprefix."facture.id," . $this->tableprefix . "facture.version," . $this->tableprefix . "facture.num, "
|
$sql = "SELECT ".$this->tableprefix."facture.id," . $this->tableprefix . "facture.version," . $this->tableprefix . "facture.num, "
|
||||||
.$this->tableprefix."facture.date, ".$this->tableprefix."devis.num as dnum, comment, date_paiement, type_paiement, id_devis, ".$this->tableprefix."client.nom, prenom, entreprise,"
|
.$this->tableprefix."facture.date, ".$this->tableprefix."devis.num as dnum, comment, date_paiement, type_paiement, id_devis, ".$this->tableprefix."client.nom, prenom, entreprise,"
|
||||||
.$this->tableprefix."devis.comment as dcomment,".$this->tableprefix."lieu.nom as lieu, ".$this->tableprefix."lieu.adresse as adresse_soin,"
|
.$this->tableprefix."devis.comment as dcomment,".$this->tableprefix."lieu.nom as lieu, ".$this->tableprefix."lieu.adresse as adresse_soin,"
|
||||||
.$this->tableprefix."defunt.nom as nom_defunt
|
.$this->tableprefix."defunt.nom as nom_defunt, "
|
||||||
|
.$this->tableprefix."facture_payment_type.facture_payment_type_label as facture_payment_type_label
|
||||||
FROM (".$this->tableprefix."facture
|
FROM (".$this->tableprefix."facture
|
||||||
LEFT JOIN ".$this->tableprefix."devis on ".$this->tableprefix."facture.id_devis = ".$this->tableprefix."devis.id
|
LEFT JOIN ".$this->tableprefix."devis on ".$this->tableprefix."facture.id_devis = ".$this->tableprefix."devis.id
|
||||||
LEFT JOIN ".$this->tableprefix."lieu on ".$this->tableprefix."devis.id_lieu = ".$this->tableprefix."lieu.id)
|
LEFT JOIN ".$this->tableprefix."lieu on ".$this->tableprefix."devis.id_lieu = ".$this->tableprefix."lieu.id)
|
||||||
LEFT JOIN ".$this->tableprefix."client on ".$this->tableprefix."devis.id_client = ".$this->tableprefix."client.id
|
LEFT JOIN ".$this->tableprefix."client on ".$this->tableprefix."devis.id_client = ".$this->tableprefix."client.id
|
||||||
LEFT JOIN ".$this->tableprefix."defunt on ".$this->tableprefix."devis.id_defunt = ".$this->tableprefix."defunt.id
|
LEFT JOIN ".$this->tableprefix."defunt on ".$this->tableprefix."devis.id_defunt = ".$this->tableprefix."defunt.id
|
||||||
|
LEFT JOIN ".$this->tableprefix."facture_payment_type on ".$this->tableprefix."facture.fk_facture_payment_type_id = ".$this->tableprefix."facture_payment_type.id
|
||||||
WHERE ".$this->tableprefix."facture.id = ?";
|
WHERE ".$this->tableprefix."facture.id = ?";
|
||||||
// return $this->execSQL($sql, array($numfacture, $idNextcloud));
|
// return $this->execSQL($sql, array($numfacture, $idNextcloud));
|
||||||
return $this->execSQL($sql, array($numfacture));
|
return $this->execSQL($sql, array($numfacture));
|
||||||
|
|||||||
@ -155,7 +155,7 @@ class CertificateService {
|
|||||||
|
|
||||||
private function getCareCertificateFolder($devisOfDefunt){
|
private function getCareCertificateFolder($devisOfDefunt){
|
||||||
$careCertificateFolder = 'CLIENTS/'
|
$careCertificateFolder = 'CLIENTS/'
|
||||||
.mb_strtoupper($devisOfDefunt["client_entreprise"],'UTF-8')
|
.mb_strtoupper($devisOfDefunt["client_nom"],'UTF-8')
|
||||||
.'/DEFUNTS/'
|
.'/DEFUNTS/'
|
||||||
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
||||||
.'ATTESTATION/';
|
.'ATTESTATION/';
|
||||||
@ -170,7 +170,7 @@ class CertificateService {
|
|||||||
|
|
||||||
private function getPacemakerCertificateFolder($devisOfDefunt){
|
private function getPacemakerCertificateFolder($devisOfDefunt){
|
||||||
$folder = 'CLIENTS/'
|
$folder = 'CLIENTS/'
|
||||||
.mb_strtoupper($devisOfDefunt["client_entreprise"],'UTF-8')
|
.mb_strtoupper($devisOfDefunt["client_nom"],'UTF-8')
|
||||||
.'/DEFUNTS/'
|
.'/DEFUNTS/'
|
||||||
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
||||||
.'ATTESTATION/';
|
.'ATTESTATION/';
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
<hr/>
|
<hr/>
|
||||||
<div class="col col-xl mb-3 text-center">
|
<div class="col col-xl mb-3 text-center">
|
||||||
<span>Date de facture : <b><?php echo (new DateTime($_['facture'][0]->date_paiement))->format('d-m-Y');?></b>, </span><span><?php p($l->t('Date of service'));?> : <b><?php echo (new DateTime($_['facture'][0]->date))->format('d-m-Y');?></b></span><br/>
|
<span>Date de facture : <b><?php echo (new DateTime($_['facture'][0]->date_paiement))->format('d-m-Y');?></b>, </span><span><?php p($l->t('Date of service'));?> : <b><?php echo (new DateTime($_['facture'][0]->date))->format('d-m-Y');?></b></span><br/>
|
||||||
<span id="devisid" data-id=<?php echo $_['facture'][0]->id_devis;?>>Defunt associé : <b><?php echo $_['facture'][0]->nom_defunt;?></b>, </span><span><?php p($l->t('Means of payment'));?> : <b><?php echo $_['facture'][0]->type_paiement;?></b></span><br/>
|
<span id="devisid" data-id=<?php echo $_['facture'][0]->id_devis;?>>Defunt associé : <b><?php echo $_['facture'][0]->nom_defunt;?></b>, </span><span><?php p($l->t('Means of payment'));?> : <b><?php echo $_['facture'][0]->facture_payment_type_label ?? "Aucun";?></b></span><br/>
|
||||||
<span>Lieu : <b><?php echo $_['facture'][0]->lieu;?> (<?php echo $_['facture'][0]->adresse_soin;?>)</b>
|
<span>Lieu : <b><?php echo $_['facture'][0]->lieu;?> (<?php echo $_['facture'][0]->adresse_soin;?>)</b>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user