Merge branch 'staging' into production-dv-thanato
This commit is contained in:
commit
4db0935d71
@ -365,7 +365,10 @@ class PageController extends Controller {
|
||||
$produits = json_decode($this->myDb->getListProduit($d->id, $this->idNextcloud));
|
||||
$d->dproduits = $produits;
|
||||
}
|
||||
$clients = json_decode($this->myDb->getClientsAndClientGroupFacturations(includeClientInsideGroup:false));
|
||||
$clients = json_decode($this->myDb->getClientsAndClientGroupFacturations(includeClientInsideGroup:false ));
|
||||
usort($clients, function($a, $b) {
|
||||
return strcmp($a->nom, $b->nom);
|
||||
});
|
||||
return new TemplateResponse('gestion', 'apercustousdevis', array('groups' => $this->groups, 'user' => $this->user, 'path' => $this->idNextcloud,
|
||||
'configuration'=> $this->getConfiguration(),
|
||||
'devis'=> $devis,
|
||||
@ -398,6 +401,9 @@ class PageController extends Controller {
|
||||
$facture->dproduits = $produits;
|
||||
}
|
||||
$clients = json_decode($this->myDb->getClientsAndClientGroupFacturations());
|
||||
usort($clients, function($a, $b) {
|
||||
return strcmp($a->nom, $b->nom);
|
||||
});
|
||||
return new TemplateResponse('gestion', 'apercustoutesfactures', array( 'groups' => $this->groups, 'user' => $this->user, 'path' => $this->idNextcloud,
|
||||
'configuration'=> $this->getConfiguration(),
|
||||
'factures'=> $factures,
|
||||
|
||||
@ -150,6 +150,31 @@ class DevisPdfService {
|
||||
$devisByYearFolder
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Genere simplement le dossier de defunt et client pour le devis pour le user connecter
|
||||
*/
|
||||
public function generateClientAndDefuntFolder($devisId,$idNextCloud){
|
||||
$storage = $this->rootFolder->getUserFolder($idNextCloud);
|
||||
$configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
|
||||
$currentConfig = $configs[0];
|
||||
$devisPdfData = $this->gestionBdd->getDevisPdfDataByDevisId($devisId);
|
||||
if($devisPdfData == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
$clean_folder = html_entity_decode(string: $currentConfig->path).'/';
|
||||
$devisPdfDataFormatted = $this->formatDevisDataToPdfDataFormat($devisPdfData,$currentConfig);
|
||||
$devisPdfFolders = $this->getDevisPdfFolder($devisPdfDataFormatted,$clean_folder);
|
||||
|
||||
foreach($devisPdfFolders as $folder){
|
||||
try {
|
||||
$storage->newFolder($folder);
|
||||
}
|
||||
catch(\OCP\Files\NotPermittedException $e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function GetMultipleDevisFilename($multipleDevisData,$month,$year,$type = DevisExportTypeConstant::TYPE_SINGLE){
|
||||
$filename = "";
|
||||
|
||||
@ -34,6 +34,7 @@ use OCA\Gestion\Db\Bdd;
|
||||
use OCP\IUserSession;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use OCA\Gestion\Helpers\VCalendarHelpers;
|
||||
use OCA\Gestion\Service\Devis\Pdf\DevisPdfService;
|
||||
|
||||
class GestionService
|
||||
{
|
||||
@ -48,15 +49,22 @@ class GestionService
|
||||
|
||||
private $userConnectedUuid;
|
||||
|
||||
/** @var DevisPdfService */
|
||||
private $devisPdfService;
|
||||
|
||||
public function __construct(
|
||||
Bdd $gestionBdd,
|
||||
LoggerInterface $logger,
|
||||
TalkService $talkService,
|
||||
IUserSession $userSession
|
||||
IUserSession $userSession,
|
||||
DevisPdfService $devisPdfService
|
||||
|
||||
) {
|
||||
$this->logger = $logger;
|
||||
$this->gestionBdd = $gestionBdd;
|
||||
$this->talkService = $talkService;
|
||||
$this->devisPdfService = $devisPdfService;
|
||||
|
||||
try {
|
||||
$this->userConnectedUuid = $userSession->getUser()->getUID();
|
||||
} catch (Exception) {
|
||||
@ -325,6 +333,7 @@ class GestionService
|
||||
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devisId, $userName);
|
||||
$this->talkService->sendDevisTalkNotifications($devisTalkMessage, $userName, $this->userConnectedUuid);
|
||||
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId, $userName);
|
||||
$this->devisPdfService->generateClientAndDefuntFolder($devisId , $this->userConnectedUuid);
|
||||
} catch (\OC\OCS\Exception $e) {
|
||||
$this->logger->debug("Error while handling created calendar object: " . $e->getMessage());
|
||||
} catch (\Throwable $e) {
|
||||
@ -332,6 +341,7 @@ class GestionService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function GetThanatoNameFromVCalendarString($vCalendarString)
|
||||
{
|
||||
$thanatoName = $this->getPrincipalUsernameFromVCalendarString($vCalendarString);
|
||||
|
||||
@ -334,7 +334,8 @@ class InvoiceGroupPdfHandler extends FPDF
|
||||
$totalTtc = 0;
|
||||
$totalTva = 0;
|
||||
$yValue = $this->startingYOfArticlesTable + 13;
|
||||
$maxDescriptionWidth = 102;
|
||||
// $maxDescriptionWidth = 102;
|
||||
$maxDescriptionWidth = 104.3;
|
||||
$currentIndexPosition = $this->currentIndexPosition;
|
||||
for ($currentIndexPosition; $currentIndexPosition < ($this->initialIndexPosition + $this->devisCountToGet); $currentIndexPosition++) {
|
||||
$currentDevis = $devisData[$currentIndexPosition];
|
||||
|
||||
13
gestion/lib/Sql/20250630-ADD-document_generated_date.sql
Normal file
13
gestion/lib/Sql/20250630-ADD-document_generated_date.sql
Normal file
@ -0,0 +1,13 @@
|
||||
alter table oc_gestion_facture
|
||||
add column document_generated_date DATE DEFAULT NULL,
|
||||
add column document_sent_date DATE DEFAULT NULL;
|
||||
|
||||
create table if not exists oc_gestion_recap_facture_state (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
fk_client_id INT,
|
||||
fk_client_group_facturation_id INT,
|
||||
month INT,
|
||||
year INT,
|
||||
document_generated_date DATE DEFAULT NULL,
|
||||
document_sent_date DATE DEFAULT NULL
|
||||
);
|
||||
Loading…
x
Reference in New Issue
Block a user