[PageController] Add manulle debug ligne trajet for thanato by idNextcloud , name and year
This commit is contained in:
parent
db3fa63eea
commit
ad8b9fcf70
@ -207,7 +207,8 @@ return [
|
||||
|
||||
['name' => 'provider#moveAttachmentFile', 'url' => '/test-move', 'verb' => 'GET'],
|
||||
['name' => 'provider#sendEmailAttachment', 'url' => '/test-send-mail-attach', 'verb' => 'GET'],
|
||||
|
||||
|
||||
|
||||
['name' => 'page#updateDevisLigneTrajet', 'url' => '/updateDevisLigneTrajet', 'verb' => 'GET'],
|
||||
]
|
||||
];
|
||||
@ -1481,7 +1481,7 @@ class PageController extends Controller {
|
||||
$this->storage->newFolder($_clean_folder);
|
||||
} catch(\OCP\Files\NotPermittedException $e) { }
|
||||
|
||||
$trajetdetails = json_decode($this->myDb->getTrajetsdetails_orderByDate($numtrajet, $idNextcloud));
|
||||
$trajetdetails = json_decode($this->myDb->getTrajetsdetails_orderByDate($numtrajet, $this->idNextcloud));
|
||||
$distance_temp = 0;
|
||||
$distances = array();
|
||||
$last_point = NULL;
|
||||
@ -2920,4 +2920,51 @@ class PageController extends Controller {
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) { }
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param int $defuntId
|
||||
*/
|
||||
|
||||
public function updateDevisLigneTrajet($idNextcloud ,$mois , $annee){
|
||||
//get all devis id from month avril
|
||||
if(!$idNextcloud || !$mois || !$mois){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$all_devis = $this->myDb->getAllDevisByMonthAndYear($idNextcloud,$mois,$annee);
|
||||
|
||||
foreach($all_devis as $devis){
|
||||
|
||||
$ligne_trajet = json_decode($this->myDb->getOneTrajetdetails_byIdDevis($devis['id'], $idNextcloud))[0];
|
||||
|
||||
|
||||
if($ligne_trajet != NULL) {
|
||||
$this->myDb->gestion_delete('ligne_trajet', $ligne_trajet->id, $idNextcloud);
|
||||
$ligne_trajet = NULL;
|
||||
}
|
||||
$devisObject = json_decode($this->myDb->getOneDevis($devis['id'], $idNextcloud))[0];
|
||||
|
||||
$this->myDb->generate_ligneTrajet($devisObject, $idNextcloud);
|
||||
$ligne_trajet = json_decode( json: $this->myDb->getOneTrajetdetails_byIdDevis($devisObject->devisid, $idNextcloud))[0];
|
||||
$this->myDb->range_ligneTrajet($ligne_trajet->id_trajet, $idNextcloud);
|
||||
$this->myDb->calculer_distance_trajet(numtrajet: $ligne_trajet->id_trajet, idNextcloud: $idNextcloud);
|
||||
|
||||
}
|
||||
//foreach
|
||||
//$ligne_trajet = json_decode($this->getOneTrajetdetails_byIdDevis($devis->devisid, $idNextcloud))[0];
|
||||
/*
|
||||
if($ligne_trajet != NULL) {
|
||||
$this->gestion_delete('ligne_trajet', $ligne_trajet->id, $idNextcloud);
|
||||
$ligne_trajet = NULL;
|
||||
}
|
||||
$devis = $this->getOneDevis($devis->devisid, $idNextcloud))[0];
|
||||
$this->generate_ligneTrajet($updated_devis, $idNextcloud);
|
||||
$ligne_trajet = json_decode($this->getOneTrajetdetails_byIdDevis($devis->devisid, $idNextcloud))[0];
|
||||
$this->range_ligneTrajet($ligne_trajet->id_trajet, $idNextcloud);
|
||||
$this->calculer_distance_trajet($ligne_trajet->id_trajet, $idNextcloud);
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3685,4 +3685,15 @@ class Bdd {
|
||||
return $this->execSQLNoJsonReturn($sql, $devisIdList);
|
||||
}
|
||||
|
||||
//get all devis id from month avril
|
||||
public function getAllDevisByMonthAndYear($idNextcloud,$mois, $annee ){
|
||||
$thanato = $this->getThanatoByUserUuid($idNextcloud);
|
||||
if($thanato == null){
|
||||
return array();
|
||||
}
|
||||
$sql = "SELECT * FROM {$this->tableprefix}devis WHERE MONTH(date) = ? AND YEAR(date) = ? AND id_thanato = ?;";
|
||||
return $this->execSQLNoJsonReturn($sql,array( $mois , $annee, $thanato['id'] ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user