Merge branch 'fixes/fix-agenda-talk-quantity' into staging
This commit is contained in:
commit
268d14816e
@ -2323,6 +2323,19 @@ class Bdd {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getProduitDevisByDevisId($devisId){
|
||||
$sql = "SELECT *
|
||||
FROM ".$this->tableprefix ."produit_devis as produit_devis
|
||||
WHERE produit_devis.devis_id = ?;";
|
||||
|
||||
$produitDevisList = $this->execSQLNoJsonReturn(
|
||||
$sql,
|
||||
[$devisId]);
|
||||
|
||||
|
||||
return $produitDevisList;
|
||||
}
|
||||
|
||||
public function getDevisProduits($devisId){
|
||||
$sql = "SELECT
|
||||
produit_devis.id,
|
||||
@ -3201,7 +3214,7 @@ class Bdd {
|
||||
}
|
||||
$productMessage = ". ACTE A FAIRE : ";
|
||||
foreach($devisProducts as $product){
|
||||
$productMessage.= html_entity_decode($product->produit_reference). "(".$product->quantite."), ";
|
||||
$productMessage.= html_entity_decode($product->produit_reference).", ";
|
||||
}
|
||||
$productMessage = trim( $productMessage );
|
||||
$productMessage = rtrim($productMessage,",");
|
||||
|
||||
@ -155,31 +155,31 @@ class CertificateService {
|
||||
|
||||
private function getCareCertificateFolder($devisOfDefunt){
|
||||
$careCertificateFolder = 'CLIENTS/'
|
||||
.strtoupper($devisOfDefunt["client_entreprise"])
|
||||
.mb_strtoupper($devisOfDefunt["client_entreprise"],'UTF-8')
|
||||
.'/DEFUNTS/'
|
||||
.strtoupper($devisOfDefunt["defunt_nom"]).'/'
|
||||
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
||||
.'ATTESTATION/';
|
||||
|
||||
return $careCertificateFolder;
|
||||
}
|
||||
|
||||
private function GetCareCertificateFilename($devisOfDefunt){
|
||||
$filename = 'ATTESTATION_SOIN_'.strtoupper($devisOfDefunt['defunt_nom']);
|
||||
$filename = 'ATTESTATION_SOIN_'.mb_strtoupper($devisOfDefunt['defunt_nom'],'UTF-8');
|
||||
return $filename;
|
||||
}
|
||||
|
||||
private function getPacemakerCertificateFolder($devisOfDefunt){
|
||||
$folder = 'CLIENTS/'
|
||||
.strtoupper($devisOfDefunt["client_entreprise"])
|
||||
.mb_strtoupper($devisOfDefunt["client_entreprise"],'UTF-8')
|
||||
.'/DEFUNTS/'
|
||||
.strtoupper($devisOfDefunt["defunt_nom"]).'/'
|
||||
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
||||
.'ATTESTATION/';
|
||||
|
||||
return $folder;
|
||||
}
|
||||
|
||||
private function getPacemakerCertificateFilename($devisOfDefunt){
|
||||
$filename = 'ATTESTATION_PACEMAKER_'.strtoupper($devisOfDefunt['defunt_nom']);
|
||||
$filename = 'ATTESTATION_PACEMAKER_'.mb_strtoupper($devisOfDefunt['defunt_nom'],'UTF-8');
|
||||
return $filename;
|
||||
}
|
||||
|
||||
|
||||
@ -157,11 +157,41 @@ class GestionService {
|
||||
}
|
||||
}
|
||||
|
||||
private function CheckIfDevisIsAlreadyUpdated($devis,$vCalendarString){
|
||||
$requestedDefuntName = $this->GetCalendarSummaryFromVCalendarString($vCalendarString);
|
||||
$requestedClientId = $this->GetClientIdFromVCalendarString($vCalendarString);
|
||||
$requestLocationId = $this->GetLocationIdFromVCalendarString($vCalendarString);
|
||||
$requestedDevisComment = $this->GetDevisCommentFromVCalendarString($vCalendarString);
|
||||
$requestedArticleReferences = $this->GetArticlesNameFromVCalendarString($vCalendarString);
|
||||
$requestedArticleIds = $this->gestionBdd->getArticleIdsByArticleReferences($requestedArticleReferences);
|
||||
$articleDevis = $this->gestionBdd->getProduitDevisByDevisId($devis['id']);
|
||||
$articleDevisIds = [];
|
||||
foreach($articleDevis as $currentArticleDevis){
|
||||
$articleDevisIds[] = $currentArticleDevis['produit_id'];
|
||||
}
|
||||
sort($requestedArticleIds);
|
||||
sort($articleDevisIds);
|
||||
|
||||
return
|
||||
$devis['defunt_nom'] == $requestedDefuntName &&
|
||||
$devis['client_id'] == $requestedClientId &&
|
||||
$devis['lieu_id'] == $requestLocationId &&
|
||||
$devis['comment'] == $requestedDevisComment &&
|
||||
$requestedArticleIds == $articleDevisIds;
|
||||
}
|
||||
|
||||
public function HandleUpdatedCalendarObject(string $vCalendarString){
|
||||
$calendarUuid = $this->GetCalendarUuidFromVCalendarString($vCalendarString);
|
||||
$devis = $this->gestionBdd->getDevisByCalendarUuid($calendarUuid);
|
||||
if($devis != null){
|
||||
$isDevisAlreadyUpdated = $this->CheckIfDevisIsAlreadyUpdated($devis,$vCalendarString);
|
||||
if($isDevisAlreadyUpdated){
|
||||
return true;
|
||||
}
|
||||
$this->UpdateDevisDataByVCalendarString($devis,$vCalendarString);
|
||||
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
|
||||
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devis['id'],$userName);
|
||||
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -77,10 +77,10 @@ class InvoicePdfHandler extends FPDF {
|
||||
foreach($this->multipleFactureData as $factureData){
|
||||
$factureType = $factureData["facture_type"];
|
||||
if($factureType == MultipleFactureTypeConstant::CLIENT_FILTER_TYPE){
|
||||
$filename = strtoupper($factureData["client_entreprise"]);
|
||||
$filename = mb_strtoupper($factureData["client_entreprise"],'UTF-8');
|
||||
}
|
||||
else{
|
||||
$filename = 'GROUP_'.strtoupper($factureData["client_entreprise"]);
|
||||
$filename = 'GROUP_'.mb_strtoupper($factureData["client_entreprise"],'UTF-8');
|
||||
}
|
||||
$filename .= $month != 0 ? '_'.DateHelpers::GetMonthPlainString($month) :'';
|
||||
$filename .= "_".$year;
|
||||
@ -93,7 +93,7 @@ class InvoicePdfHandler extends FPDF {
|
||||
$factureNum = $this->factureData['num'];
|
||||
$factureNum = str_replace('/','-',$factureNum);
|
||||
$defuntNom = str_replace(' ',' ',$this->factureData['defunt_nom']);
|
||||
return $this->factureData['configuration']->facture_prefixe.'_'.$factureNum.'_'.strtoupper($defuntNom);
|
||||
return $this->factureData['configuration']->facture_prefixe.'_'.$factureNum.'_'.mb_strtoupper($defuntNom,'UTF-8');
|
||||
}
|
||||
|
||||
private function DrawInvoiceCompanyAndClientInfo(){
|
||||
|
||||
@ -101,8 +101,8 @@ class InvoicePdfService {
|
||||
}
|
||||
|
||||
private function getFacturesFolder(array $factureData,$racinePath){
|
||||
$clientRacineFolder = $racinePath.'CLIENTS/'.strtoupper($factureData["client_entreprise"]).'/';
|
||||
$defuntsFolder = $clientRacineFolder.'DEFUNTS/'.strtoupper($factureData['defunt_nom']).'/'.'FACTURES'.'/';
|
||||
$clientRacineFolder = $racinePath.'CLIENTS/'.mb_strtoupper($factureData["client_entreprise"],'UTF-8').'/';
|
||||
$defuntsFolder = $clientRacineFolder.'DEFUNTS/'.mb_strtoupper($factureData['defunt_nom'],'UTF-8').'/'.'FACTURES'.'/';
|
||||
$devisDate = $factureData['devis_date'];
|
||||
$devisDatetime = new DateTime($devisDate);
|
||||
$devisDateYear = $devisDatetime->format('Y');
|
||||
@ -135,7 +135,7 @@ class InvoicePdfService {
|
||||
$pdf->MutlipleInvoicePdfFactory($invoiceData,$logo);
|
||||
$pdf->SetMultipleFactureContent();
|
||||
$racinePath = html_entity_decode(string: $currentConfig->path).'/';
|
||||
$clientRacineFolder = $racinePath.'CLIENTS/'.strtoupper($invoiceData[0]["client_entreprise"]).'/';
|
||||
$clientRacineFolder = $racinePath.'CLIENTS/'.mb_strtoupper($invoiceData[0]["client_entreprise"],'UTF-8').'/';
|
||||
$filename = $currentConfig->facture_prefixe.'_'.$pdf->GetMultipleInvoiceFilename($month,$year);
|
||||
$filenamePath = $clientRacineFolder.$filename.'.pdf';
|
||||
$pdfContent = $pdf->Output('','S');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user