Merge branch 'staging' into releases/release-hytha-prod
This commit is contained in:
commit
bfe7a4d4f0
@ -65,6 +65,7 @@ return [
|
||||
['name' => 'page#getFactures', 'url' => '/getFactures', 'verb' => 'PROPFIND'],
|
||||
['name' => 'page#getFacturesWithProduits', 'url' => '/getFacturesWithProduits', 'verb' => 'PROPFIND'],
|
||||
['name' => 'page#factureshow', 'url' => '/facture/{numfacture}/show', 'verb' => 'GET'],
|
||||
['name' => 'page#factureGroupDetails', 'url' => '/facture/{numfacture}/groupDetails', 'verb' => 'GET'],
|
||||
['name' => 'page#apercustoutesfactures', 'url' => '/factures/apercus', 'verb' => 'GET'],
|
||||
['name' => 'page#apercustousdevis', 'url' => '/devis/apercus', 'verb' => 'GET'],
|
||||
['name' => 'page#insertFacture', 'url' => '/facture/insert', 'verb' => 'POST'],
|
||||
@ -169,5 +170,9 @@ return [
|
||||
['name' => 'page#payInvoices','url' => '/facture/payInvoices', 'verb' => 'POST'],
|
||||
//relation of user and thanato
|
||||
['name' => 'page#getUsersNotLinkedToThanato','url' => '/user/getUsersNotLinkedToThanato', 'verb' => 'PROPFIND'],
|
||||
|
||||
//group of devis and facture
|
||||
['name' => 'page#exportGroupOfDevisIntoFacture','url' => '/devis/exportGroupOfDevisIntoFacture', 'verb' => 'POST'],
|
||||
['name' => 'page#getClientTemplateTypes','url' => '/client/getClientTemplateTypes', 'verb' => 'PROPFIND'],
|
||||
]
|
||||
];
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
gestion/js/factureGroupDetails.app.js
Normal file
2
gestion/js/factureGroupDetails.app.js
Normal file
File diff suppressed because one or more lines are too long
46
gestion/js/factureGroupDetails.app.js.LICENSE.txt
Normal file
46
gestion/js/factureGroupDetails.app.js.LICENSE.txt
Normal file
@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* Sizzle CSS Selector Engine v2.3.9
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright JS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://js.foundation/
|
||||
*
|
||||
* Date: 2022-12-19
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Toastify js 1.12.0
|
||||
* https://github.com/apvarun/toastify-js
|
||||
* @license MIT licensed
|
||||
*
|
||||
* Copyright (C) 2018 Varun A P
|
||||
*/
|
||||
|
||||
/*!
|
||||
* escape-html
|
||||
* Copyright(c) 2012-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2015 Andreas Lubbe
|
||||
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.6.3
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2022-12-20T21:28Z
|
||||
*/
|
||||
|
||||
/*! @license DOMPurify 2.4.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.4/LICENSE */
|
||||
|
||||
/*! DataTables 1.13.2
|
||||
* ©2008-2023 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
10
gestion/lib/Constants/ClientTemplateTypeConstant.php
Normal file
10
gestion/lib/Constants/ClientTemplateTypeConstant.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Gestion\Constants;
|
||||
abstract class ClientTemplateTypeConstant
|
||||
{
|
||||
const PRIVEES = "PRIVEES";
|
||||
const FUNECAP = "FUNECAP";
|
||||
const OGF = "OGF";
|
||||
}
|
||||
9
gestion/lib/Constants/FactureTypeConstant.php
Normal file
9
gestion/lib/Constants/FactureTypeConstant.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Gestion\Constants;
|
||||
abstract class FactureTypeConstant
|
||||
{
|
||||
const TYPE_SINGLE = "SINGLE";
|
||||
const TYPE_GROUP = "GROUP";
|
||||
}
|
||||
@ -3,6 +3,8 @@ namespace OCA\Gestion\Controller;
|
||||
|
||||
use Exception;
|
||||
use OCA\Gestion\Constants\BddConstant;
|
||||
use OCA\Gestion\Constants\DevisMentionConstant;
|
||||
use OCA\Gestion\Constants\FactureTypeConstant;
|
||||
use OCA\Gestion\Service\InvoicePdfHandler;
|
||||
defined("TAB1") or define("TAB1", "\t");
|
||||
|
||||
@ -341,13 +343,19 @@ class PageController extends Controller {
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function apercustousdevis() {
|
||||
$devis = json_decode($this->myDb->getDevis($this->idNextcloud));
|
||||
$devisMentionsFilter = [
|
||||
DevisMentionConstant::FACTURED,
|
||||
DevisMentionConstant::FACTURED_FORMATTED,
|
||||
DevisMentionConstant::MENTION,
|
||||
DevisMentionConstant::NEW
|
||||
];
|
||||
$devis = json_decode($this->myDb->getDevis($this->idNextcloud,$devisMentionsFilter));
|
||||
foreach ($devis as $key => $d) {
|
||||
$d->dproduits = [];
|
||||
$produits = json_decode($this->myDb->getListProduit($d->id, $this->idNextcloud));
|
||||
$d->dproduits = $produits;
|
||||
}
|
||||
$clients = json_decode($this->myDb->getClients($this->idNextcloud));
|
||||
$clients = json_decode($this->myDb->getClientsAndClientGroupFacturations(includeClientInsideGroup:false));
|
||||
return new TemplateResponse('gestion', 'apercustousdevis', array('groups' => $this->groups, 'user' => $this->user, 'path' => $this->idNextcloud,
|
||||
'configuration'=> $this->getConfiguration(),
|
||||
'devis'=> $devis,
|
||||
@ -1500,11 +1508,22 @@ class PageController extends Controller {
|
||||
* @param array $devisToFacture
|
||||
* @param string $paymentDate
|
||||
*/
|
||||
public function exportDevisToFacture($devisToFacture,$paymentDate) {
|
||||
$factureIdsGenerated = $this->myDb->insertFactureForeEachDevisId($this->idNextcloud,$devisToFacture,$paymentDate);
|
||||
public function exportDevisToFacture($devisToFacture,$paymentDate,$type = FactureTypeConstant::TYPE_SINGLE) {
|
||||
$response = true;
|
||||
$factureIdsGenerated = [];
|
||||
if($type == FactureTypeConstant::TYPE_GROUP){
|
||||
$doDevisIdsListIdsBelongsToTheSameClientFacturationGroup = $this->myDb->doDevisIdsListIdsBelongsToTheSameClientFacturationGroup($devisToFacture);
|
||||
if($doDevisIdsListIdsBelongsToTheSameClientFacturationGroup == false){
|
||||
return "Les devis fournis ne sont pas dans la même groupe de facturation";
|
||||
}
|
||||
$factureIdsGenerated = $this->myDb->generateGroupFactureForMultipleDevis($devisToFacture,$paymentDate);
|
||||
}
|
||||
else{
|
||||
$factureIdsGenerated = $this->myDb->insertFactureForeEachDevisId($this->idNextcloud,$devisToFacture,$paymentDate);
|
||||
}
|
||||
$this->invoicePdfService->generateFacturePdfByFactureIds($factureIdsGenerated,$this->idNextcloud);
|
||||
$this->refreshFEC();
|
||||
return true;
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2475,8 +2494,6 @@ class PageController extends Controller {
|
||||
|
||||
public function exportFactureToPdf($factureId){
|
||||
try{
|
||||
//for HYTHA 35 , the default admin idnextcloud is Johann, for H2F it is Emmanuelle
|
||||
// $this->idNextcloud = self::HYTHA_35_DEFAULT_ADMIN;
|
||||
$factureFilenames = $this->invoicePdfService->generateFacturePdfByFactureId($factureId,$this->idNextcloud);
|
||||
return json_encode($factureFilenames);
|
||||
}
|
||||
@ -2916,4 +2933,51 @@ class PageController extends Controller {
|
||||
return json_encode([]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function exportGroupOfDevisIntoFacture($clientId,$clientType,$month,$year,$facturationDate){
|
||||
try{
|
||||
$result = $this->invoicePdfService->exportGroupOfDevisIntoFacture(
|
||||
$clientId,
|
||||
$clientType,
|
||||
$month,
|
||||
$year,
|
||||
$facturationDate,
|
||||
$this->idNextcloud
|
||||
);
|
||||
return json_encode($result);
|
||||
}
|
||||
catch(Exception $e) {
|
||||
return json_encode([]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function getClientTemplateTypes(){
|
||||
return $this->myDb->getClientTemplateTypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function factureGroupDetails($numfacture){
|
||||
$this->denyIfNotAdmin();
|
||||
$facture = $this->myDb->getFactureGroupByFactureIdWithDetails($numfacture);
|
||||
return new TemplateResponse('gestion', 'factureGroupDetails', array('groups' => $this->groups, 'user' => $this->user, 'path' => $this->idNextcloud,
|
||||
'configuration'=> $this->getConfiguration(),
|
||||
'facture'=>json_decode(json_encode($facture)),
|
||||
'url' => $this->getNavigationLink(),
|
||||
'logo' => $this->getLogo()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
<?php
|
||||
namespace OCA\Gestion\Db;
|
||||
|
||||
use OCA\Gestion\Constants\ClientTemplateTypeConstant;
|
||||
use OCA\Gestion\Constants\FactureStatusConstant;
|
||||
use OCA\Gestion\Constants\FactureTypeConstant;
|
||||
use OCA\Gestion\Helpers\DateHelpers;
|
||||
use OCA\Gestion\Helpers\PriceHelpers;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
use \Datetime;
|
||||
@ -48,7 +51,8 @@ class Bdd {
|
||||
"product_brand","product_reference",
|
||||
"fk_user_uuid",
|
||||
"phone_number","address",'postal_code','city','email','siret_number','tva_intracommu',
|
||||
'order_number','case_number');
|
||||
'order_number','case_number','fk_template_type_key',
|
||||
'facture_case_number','facture_order_number');
|
||||
$this->whiteTable = array(
|
||||
"client", "lieu", "trajet", "devis", "produit_devis", "facture", "produit", "configuration", "ligne_trajet", "thanato", "article", "defunt", "article_devis", "bibliotheque", "bijou_defunt", "obs_defunt", "hypo_defunt",
|
||||
"client_group_discount","client_group",
|
||||
@ -257,6 +261,7 @@ class Bdd {
|
||||
$sql = "SELECT ".$this->tableprefix."devis.id, ".$this->tableprefix."devis.id as devisid, ".$this->tableprefix."devis.user_id,".$this->tableprefix."devis.id_nextcloud ,".$this->tableprefix."devis.comment ,"
|
||||
.$this->tableprefix."client.nom, ".$this->tableprefix."client.prenom, ".$this->tableprefix."client.id as cid, ".$this->tableprefix."client.id as id_client, "
|
||||
.$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."lieu.id as lid, ".$this->tableprefix."lieu.nom as lieu,".$this->tableprefix."lieu.adresse as adresse_soin,".$this->tableprefix."devis.id_lieu, "
|
||||
@ -326,14 +331,18 @@ class Bdd {
|
||||
return $this->execSQL($sql, array());
|
||||
}
|
||||
|
||||
private function getClientsWithClientType(){
|
||||
$sql = "SELECT client.*,'client' as client_type FROM ".$this->tableprefix."client as client;";
|
||||
private function getClientsWithClientType(bool $includeClientInsideGroup = true){
|
||||
$sql = "SELECT client.*,'client' as client_type FROM ".$this->tableprefix."client as client";
|
||||
if($includeClientInsideGroup == false){
|
||||
$sql .= " WHERE client.fk_client_group_facturation_id IS NULL";
|
||||
}
|
||||
$sql .= ";";
|
||||
$clientsWithClientType = $this->execSQLNoJsonReturn($sql,[]);
|
||||
return $clientsWithClientType;
|
||||
}
|
||||
|
||||
public function getClientsAndClientGroupFacturations(){
|
||||
$clients = $this->getClientsWithClientType();
|
||||
public function getClientsAndClientGroupFacturations(bool $includeClientInsideGroup = true){
|
||||
$clients = $this->getClientsWithClientType($includeClientInsideGroup);
|
||||
$clientGroupFacturations = $this->getClientGroupFacturationsWithType();
|
||||
$result = [...$clientGroupFacturations,...$clients];
|
||||
return json_encode($result);
|
||||
@ -344,6 +353,9 @@ class Bdd {
|
||||
.$this->tableprefix."facture.fk_facture_status_key, ".$this->tableprefix."facture.fk_facture_payment_type_id, ".$this->tableprefix."facture.payment_date, "
|
||||
.$this->tableprefix."facture_payment_type.facture_payment_type_label, "
|
||||
.$this->tableprefix."facture_status.facture_status_label, "
|
||||
.$this->tableprefix."facture.facture_type, "
|
||||
.$this->tableprefix."facture.fk_client_id as facture_client_id, "
|
||||
.$this->tableprefix."facture.fk_client_group_facturation_id as facture_client_group_facturation_id, "
|
||||
.$this->tableprefix."devis.num as dnum, ".$this->tableprefix."devis.comment as dcomment, date_paiement, type_paiement, id_devis, entreprise, "
|
||||
.$this->tableprefix."facture.version, status_paiement,"
|
||||
.$this->tableprefix."client.nom, ".$this->tableprefix."client.prenom, "
|
||||
@ -1291,7 +1303,6 @@ class Bdd {
|
||||
}
|
||||
$placeholders = implode(',', array_fill(0, count($devisListId), '?'));
|
||||
$mentionsFilterPlaceholders = implode(',', array_fill(0, count($mentionsFilter), '?'));
|
||||
$this->logger->debug('Placeholders : ' . $placeholders);
|
||||
$sql = "SELECT devis.id as id,devis.date as devis_date
|
||||
FROM ".$this->tableprefix."devis as devis
|
||||
WHERE devis.id IN ($placeholders) AND
|
||||
@ -1444,12 +1455,16 @@ class Bdd {
|
||||
|
||||
if(in_array($table, $this->whiteTable) && in_array($column, $this->whiteColumn)){
|
||||
if(strcmp($table, "facture")==0 && strcmp($column, "date_paiement")==0) {
|
||||
|
||||
$facture = json_decode($this->getOneFacture($id, $idNextcloud))[0];
|
||||
$numfacture = explode('/', $facture->num)[2];
|
||||
$datesplit = explode('-', $data);
|
||||
$sql = "UPDATE ".$this->tableprefix.$table." SET $column = ?, `num`= ? WHERE `id` = ?";
|
||||
$this->execSQLNoData($sql, array(htmlentities(rtrim($data)), "ETS".$datesplit[0]."/".$datesplit[1]."/".$numfacture, $id));
|
||||
$facture = $this->getFactureByFactureId($id);
|
||||
if($facture['date_paiement'] != $data){
|
||||
$facturationDatetime = Datetime::createFromFormat('Y-m-d',$data);
|
||||
$factureNumber = $this->getFactureNumberByDate($facturationDatetime);
|
||||
$fullFactureNumber = DateHelpers::GetFullFactureOrDevisNumberByDate($facturationDatetime,$factureNumber,"FAC");
|
||||
$sql = "UPDATE ".$this->tableprefix.$table." SET `facture_number`= ? WHERE `id` = ?";
|
||||
$this->execSQLNoData($sql, array($factureNumber, $id));
|
||||
$sql = "UPDATE ".$this->tableprefix.$table." SET $column = ?, `num`= ? WHERE `id` = ?";
|
||||
$this->execSQLNoData($sql, array($data, $fullFactureNumber, $id));
|
||||
}
|
||||
|
||||
} else if(strcmp($table, "facture")==0 && strcmp($column, "id_devis")==0) {
|
||||
|
||||
@ -2698,6 +2713,9 @@ class Bdd {
|
||||
client.nom as client_nom,
|
||||
client.prenom as client_prenom,
|
||||
client.entreprise as client_entreprise,
|
||||
client.legal_one as client_legal_one,
|
||||
client.adresse as client_address,
|
||||
client.mail as client_mail,
|
||||
client.fk_client_group_id as fk_client_group_id
|
||||
FROM ".$this->tableprefix."client as client
|
||||
WHERE client.id = ?;";
|
||||
@ -2732,6 +2750,139 @@ class Bdd {
|
||||
return $clientList;
|
||||
}
|
||||
|
||||
private function getInvoiceGroupDevisDatasByFactureId($factureId){
|
||||
$sql = "SELECT
|
||||
devis_facture.id as devis_facture_id,
|
||||
devis.id as devis_id,
|
||||
devis.date as devis_date,
|
||||
devis.num as calendar_uuid,
|
||||
devis.comment as devis_comment,
|
||||
devis.order_number as order_number,
|
||||
devis.case_number as case_number,
|
||||
client.nom as client_nom,
|
||||
client.entreprise as client_entreprise,
|
||||
client.adresse as client_adresse,
|
||||
client.mail as client_mail,
|
||||
client.legal_one as client_legal_one,
|
||||
defunt.nom as defunt_nom,
|
||||
defunt.sexe as defunt_sexe,
|
||||
lieu.nom as lieu_nom,
|
||||
lieu.adresse as lieu_adresse,
|
||||
thanato.nom as thanato_nom,
|
||||
thanato.prenom as thanato_prenom,
|
||||
client_group_facturation.id as group_id,
|
||||
client_group_facturation.group_facturation_name as group_name,
|
||||
client_group_facturation.phone_number as group_phone_number,
|
||||
client_group_facturation.address as group_address,
|
||||
client_group_facturation.postal_code as group_postal_code,
|
||||
client_group_facturation.city as group_city,
|
||||
client_group_facturation.email as group_email,
|
||||
client_group_facturation.siret_number as group_siret_number,
|
||||
client_group_facturation.tva_intracommu as group_tva_intracommu
|
||||
FROM ".$this->tableprefix."devis_facture as devis_facture
|
||||
LEFT JOIN ".$this->tableprefix."devis as devis on devis_facture.fk_devis_id = devis.id
|
||||
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
|
||||
LEFT JOIN ".$this->tableprefix."defunt as defunt on devis.id_defunt = defunt.id
|
||||
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.id
|
||||
LEFT JOIN ".$this->tableprefix."thanato as thanato on devis.id_thanato = thanato.id
|
||||
LEFT JOIN ".$this->tableprefix."client_group_facturation as client_group_facturation on client.fk_client_group_facturation_id = client_group_facturation.id
|
||||
WHERE devis_facture.fk_facture_id = ?
|
||||
;";
|
||||
$devis = $this->execSQLNoJsonReturn(
|
||||
$sql,
|
||||
[$factureId]);
|
||||
|
||||
return $devis;
|
||||
}
|
||||
|
||||
public function getFactureByFactureId($factureId){
|
||||
$sql = "SELECT * FROM ".$this->tableprefix."facture as facture
|
||||
WHERE facture.id = ? LIMIT 1;
|
||||
";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[$factureId]);
|
||||
if(!empty($result)){
|
||||
return $result[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getInvoiceGroupPdfData($factureId,$configuration){
|
||||
$tvaValue = $configuration->tva_default;
|
||||
$factureData = $this->getFactureByFactureId($factureId);
|
||||
$isFactureForSingleClient = $factureData['fk_client_id'] != null && $factureData['fk_client_id'] != 0;
|
||||
$devisMentionFilters = [
|
||||
DevisMentionConstant::FACTURED_FORMATTED,
|
||||
DevisMentionConstant::FACTURED
|
||||
];
|
||||
if($isFactureForSingleClient){
|
||||
$factureDevisList = $this->getDevisDataByClientIdAndMonthYear(
|
||||
$factureData['fk_client_id'],
|
||||
$factureData['month'],
|
||||
$factureData['year'],$devisMentionFilters
|
||||
);
|
||||
}
|
||||
else{
|
||||
$factureDevisList = $this->getDevisDataByClientGroupFacturationIdAndMonthYear(
|
||||
$factureData['fk_client_group_facturation_id'],
|
||||
$factureData['month'],
|
||||
$factureData['year'],$devisMentionFilters
|
||||
);
|
||||
}
|
||||
$factureIncrement = 0;
|
||||
$productsCount = 0;
|
||||
$totalHt = 0;
|
||||
$totalTtc = 0;
|
||||
$totalTva = 0;
|
||||
$templateType = ClientTemplateTypeConstant::PRIVEES;
|
||||
foreach($factureDevisList as &$devis){
|
||||
if($factureIncrement == 0){
|
||||
if($isFactureForSingleClient){
|
||||
$clientAddresses = FileExportHelpers::GetAddressAndCityFromAddress($devis['client_adresse']);
|
||||
$factureData["client_real_adress"] = $clientAddresses['address'];
|
||||
$factureData["client_adress_city"] = $clientAddresses['city'];
|
||||
$factureData["client_mail"] = $devis["client_mail"];
|
||||
$factureData["siret"] = $devis["client_legal_one"];
|
||||
$factureData["group_name"] = $devis["client_nom"] ?? "";
|
||||
}
|
||||
else{
|
||||
$factureData["client_real_adress"] = $devis["group_address"] ?? "";
|
||||
$factureData["client_adress_city"] = $devis["group_postal_code"]." ".$devis["group_city"];
|
||||
$factureData["client_mail"] = $devis["group_email"];
|
||||
$factureData["siret"] = $devis["group_siret_number"];
|
||||
$factureData["group_name"] = $devis["group_name"] ?? "";
|
||||
$templateType = $devis['fk_template_type_key'] ?? ClientTemplateTypeConstant::PRIVEES;
|
||||
}
|
||||
}
|
||||
$products = $this->getDevisProduits($devis["devis_id"]);
|
||||
foreach($products as $product){
|
||||
$valueHt = $product['produit_price'] * $product['quantite'];
|
||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||
$totalHt+=$valueHt;
|
||||
$totalTtc+=$valueTtc;
|
||||
$tvaAmount = $valueTtc - $valueHt;
|
||||
$totalTva += $tvaAmount;
|
||||
}
|
||||
$productsCount += count($products);
|
||||
$devis['products'] = $products;
|
||||
$factureIncrement++;
|
||||
}
|
||||
$totaPricesArray = [
|
||||
"TOTAL HT" => $totalHt,
|
||||
"TVA ".$tvaValue. "%" => $totalTva,
|
||||
"TOTAL TTC" => $totalTtc
|
||||
];
|
||||
$factureData["devis"] = $factureDevisList;
|
||||
$factureData["configuration"] = $configuration;
|
||||
$configurationAdresses = FileExportHelpers::GetAddressAndCityFromAddress($configuration->adresse);
|
||||
$factureData["configuration_adresse"] = $configurationAdresses["address"];
|
||||
$factureData["configuration_adresse_city"] = $configurationAdresses["city"];
|
||||
$factureData["productsCount"] = $productsCount;
|
||||
$factureData["totalPrices"] = $totaPricesArray;
|
||||
$factureData["template_type_key"] = $templateType;
|
||||
return $factureData;
|
||||
}
|
||||
|
||||
public function getInvoicePdfData($factureId,$configuration){
|
||||
$factureData = $this->getFactureByIdWithDevis($factureId);
|
||||
if($factureData == null){
|
||||
@ -3894,4 +4045,450 @@ class Bdd {
|
||||
|
||||
return $this->execSQL($sql,[BddConstant::DEFAULT_THANATOS_GROUP_NAME]);
|
||||
}
|
||||
|
||||
public function doDevisIdsListIdsBelongsToTheSameClientFacturationGroup(array $devisIds){
|
||||
if(empty($devisIds)){
|
||||
return [];
|
||||
}
|
||||
$sqlPlacholders = implode(',', array_fill(0, count($devisIds), '?'));
|
||||
$sql = "SELECT
|
||||
devis.id,
|
||||
client.fk_client_group_facturation_id
|
||||
FROM ".$this->tableprefix."devis as devis
|
||||
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
|
||||
WHERE
|
||||
devis.id_client IS NOT NULL AND
|
||||
devis.id IN($sqlPlacholders);";
|
||||
|
||||
$results = $this->execSQLNoJsonReturn($sql,$devisIds);
|
||||
$clientGroupFacturationsIds = [];
|
||||
foreach($results as $currentResult){
|
||||
if($currentResult['fk_client_group_facturation_id'] == null){
|
||||
return false;
|
||||
}
|
||||
$clientGroupFacturationsIds[] = $currentResult['fk_client_group_facturation_id'];
|
||||
}
|
||||
$uniqueClientGroupFacturation = array_unique($clientGroupFacturationsIds);
|
||||
return $uniqueClientGroupFacturation > 1;
|
||||
|
||||
}
|
||||
|
||||
private function doesDevisFactureGroupAlreadyExist($factureId,$devisId){
|
||||
$sql = "SELECT count(*) as DEVIS_FACTURE_COUNT
|
||||
FROM ".$this->tableprefix."devis_facture as devis_facture
|
||||
WHERE devis_facture.fk_devis_id = ? AND devis_facture.fk_facture_id = ?";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[$devisId,$factureId]);
|
||||
if(!empty($result)){
|
||||
return $result[0]["DEVIS_FACTURE_COUNT"] > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function createFactureGroupDevis($factureId,$devisId){
|
||||
$doesDevisFactureGroupAlreadyExist = $this->doesDevisFactureGroupAlreadyExist($factureId,$devisId);
|
||||
if(!$doesDevisFactureGroupAlreadyExist){
|
||||
$sql = "INSERT INTO `".$this->tableprefix."devis_facture` (`fk_devis_id`,`fk_facture_id`) VALUES (?,?);";
|
||||
$this->execSQLNoData($sql, [$devisId,$factureId]);
|
||||
$this->gestion_update('devis','mentions',DevisMentionConstant::FACTURED_FORMATTED,$devisId,BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD);
|
||||
}
|
||||
}
|
||||
|
||||
public function createFactureGroupForDevisList($factureId,$devisIds){
|
||||
foreach($devisIds as $devis){
|
||||
$this->createFactureGroupDevis($factureId,$devis['id']);
|
||||
}
|
||||
}
|
||||
|
||||
private function getFactureIdByFactureNumber($factureNumber){
|
||||
$sql = "SELECT max(facture.id) AS FACTURE_ID
|
||||
FROM ".$this->tableprefix."facture as facture
|
||||
WHERE facture.num = ? ;";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[$factureNumber]);
|
||||
if(!empty($result)){
|
||||
return $result[0]['FACTURE_ID'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function createFactureAndReturnFactureId($facturationDate,$type,$month = null,$year = null,$fkClientId = null,$fkClientGroupFacturationId = null){
|
||||
$datetimeNow = new Datetime();
|
||||
$month = $month ?? $datetimeNow->format('m');
|
||||
$year = $year ?? $datetimeNow->format('Y');
|
||||
if($facturationDate == null || $facturationDate == ""){
|
||||
$facturationDatetime = DateHelpers::GetLastDayOfTheMonthOfADate($datetimeNow);
|
||||
}
|
||||
else{
|
||||
$facturationDatetime = Datetime::createFromFormat('Y-m-d',$facturationDate);
|
||||
}
|
||||
$facturationDate = $facturationDatetime->format('Y-m-d');
|
||||
$factureDate = $facturationDate;
|
||||
$factureNumber = $this->getFactureNumberByDate($facturationDatetime);
|
||||
$fullFactureNumber = DateHelpers::GetFullFactureOrDevisNumberByDate($facturationDatetime,$factureNumber,"FAC");
|
||||
$last = 0;
|
||||
$last = $this->lastNumFacture(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD);
|
||||
$sql = "INSERT INTO `".$this->tableprefix."facture` (`date`,`id_nextcloud`,`num`,`date_paiement`,`type_paiement`,`id_devis`,`user_id`, `version`,`facture_number`,`facture_type`,`month`,`year`,`fk_client_id`,`fk_client_group_facturation_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
|
||||
$this->execSQLNoData($sql, array(
|
||||
$factureDate,
|
||||
BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD,
|
||||
$fullFactureNumber,
|
||||
$facturationDate,
|
||||
"",
|
||||
0,
|
||||
$last+1,
|
||||
"",
|
||||
$factureNumber,
|
||||
$type,
|
||||
$month,
|
||||
$year,
|
||||
$fkClientId,
|
||||
$fkClientGroupFacturationId)
|
||||
);
|
||||
|
||||
return $this->getFactureIdByFactureNumber($fullFactureNumber);
|
||||
|
||||
}
|
||||
|
||||
public function generateGroupFactureForMultipleDevis($devisToFacture,$paymentDate){
|
||||
$mentionsFilter = [
|
||||
DevisMentionConstant::NEW,
|
||||
DevisMentionConstant::MENTION
|
||||
];
|
||||
$devisIdListFiltered = $this->getDevisIdListFilteredByMentionAndDevisListId($mentionsFilter,$devisToFacture);
|
||||
$factureId = $this->createFactureAndReturnFactureId($paymentDate,FactureTypeConstant::TYPE_GROUP);
|
||||
$this->createFactureGroupForDevisList($factureId,$devisIdListFiltered);
|
||||
return [$factureId];
|
||||
}
|
||||
|
||||
public function getFactureTypeByFactureId($factureId): mixed{
|
||||
$sql = "SELECT
|
||||
facture.facture_type
|
||||
FROM ".$this->tableprefix."facture as facture
|
||||
WHERE facture.id = ? LIMIT 1;";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[$factureId]);
|
||||
if(!empty($result)){
|
||||
return $result[0]['facture_type'];
|
||||
}
|
||||
return FactureTypeConstant::TYPE_SINGLE;
|
||||
}
|
||||
|
||||
public function getDevisIdsByClientGroupFacturationIdAndMonthYear($clientGroupFacturationId,$month,$year,$mentionFilters = []){
|
||||
$sql = "SELECT devis.id
|
||||
FROM ".$this->tableprefix."devis as devis
|
||||
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
|
||||
WHERE
|
||||
client.fk_client_group_facturation_id = ? AND
|
||||
YEAR(devis.date) = ? AND
|
||||
MONTH(devis.date) = ?
|
||||
";
|
||||
|
||||
$conditions = [$clientGroupFacturationId,$year,$month];
|
||||
if(!empty($mentionFilters)){
|
||||
$mentionsFilterPlaceholders = implode(',', array_fill(0, count($mentionFilters), '?'));
|
||||
$sql .= " AND ". $this->tableprefix."devis.mentions IN ($mentionsFilterPlaceholders)";
|
||||
$conditions = array_merge($conditions, $mentionFilters);
|
||||
}
|
||||
$sql.= ";";
|
||||
$result = $this->execSQLNoJsonReturn($sql,$conditions);
|
||||
|
||||
$devisIds = [];
|
||||
foreach($result as $currentResult){
|
||||
$devisIds[] = $currentResult['id'];
|
||||
}
|
||||
return $devisIds;
|
||||
}
|
||||
|
||||
public function getDevisIdsByClientIdAndMonthYear($clientId,$month,$year,$mentionFilters = []){
|
||||
$sql = "SELECT devis.id
|
||||
FROM ".$this->tableprefix."devis as devis
|
||||
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
|
||||
WHERE
|
||||
client.id = ? AND
|
||||
YEAR(devis.date) = ? AND
|
||||
MONTH(devis.date) = ?";
|
||||
|
||||
$conditions = [$clientId,$year,$month];
|
||||
if(!empty($mentionFilters)){
|
||||
$mentionsFilterPlaceholders = implode(',', array_fill(0, count($mentionFilters), '?'));
|
||||
$sql .= " AND devis.mentions IN ($mentionsFilterPlaceholders)";
|
||||
$conditions = array_merge($conditions, $mentionFilters);
|
||||
}
|
||||
$sql.= ";";
|
||||
$result = $this->execSQLNoJsonReturn($sql,$conditions);
|
||||
|
||||
$devisIds = [];
|
||||
foreach($result as $currentResult){
|
||||
$devisIds[] = $currentResult['id'];
|
||||
}
|
||||
return $devisIds;
|
||||
|
||||
}
|
||||
|
||||
public function getFactureIdByClientIdAndMonthYear($clientId,$month,$year){
|
||||
$sql = "SELECT
|
||||
facture.id as facture_id
|
||||
FROM ".$this->tableprefix."facture as facture
|
||||
WHERE
|
||||
facture.fk_client_id = ? AND
|
||||
facture.year = ? AND
|
||||
facture.month = ? AND
|
||||
facture.facture_type = ?";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[
|
||||
$clientId,
|
||||
$year,
|
||||
$month,
|
||||
FactureTypeConstant::TYPE_GROUP
|
||||
]);
|
||||
|
||||
if(!empty($result)){
|
||||
return $result[0]['facture_id'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getFactureIdByClientGroupFacturationIdAndMonthYear($clientId,$month,$year){
|
||||
$sql = "SELECT
|
||||
facture.id as facture_id
|
||||
FROM ".$this->tableprefix."facture as facture
|
||||
WHERE
|
||||
facture.fk_client_group_facturation_id = ? AND
|
||||
facture.year = ? AND
|
||||
facture.month = ? AND
|
||||
facture.facture_type = ?";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[
|
||||
$clientId,
|
||||
$year,
|
||||
$month,
|
||||
FactureTypeConstant::TYPE_GROUP
|
||||
]);
|
||||
|
||||
if(!empty($result)){
|
||||
return $result[0]['facture_id'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function invoiceListOfDevisIds($devisIds){
|
||||
$sqlConditionsPlaceholder = implode(',', array_fill(0, count($devisIds), '?'));
|
||||
$sql = "UPDATE ".$this->tableprefix."devis as devis
|
||||
SET devis.mentions = ?
|
||||
WHERE devis.id IN ($sqlConditionsPlaceholder);";
|
||||
|
||||
$conditions = array_merge(
|
||||
[DevisMentionConstant::FACTURED_FORMATTED],
|
||||
$devisIds
|
||||
);
|
||||
|
||||
$this->execSQLNoData($sql,$conditions);
|
||||
}
|
||||
|
||||
private function getDevisDataByClientGroupFacturationIdAndMonthYear($clientGroupFacturationId,$month,$year,$mentionFilters = []){
|
||||
$sql = "SELECT
|
||||
devis.id as devis_id,
|
||||
devis.date as devis_date,
|
||||
devis.num as calendar_uuid,
|
||||
devis.comment as devis_comment,
|
||||
devis.order_number as order_number,
|
||||
devis.case_number as case_number,
|
||||
devis.devis_full_number as devis_full_number,
|
||||
client.nom as client_nom,
|
||||
client.entreprise as client_entreprise,
|
||||
client.adresse as client_adresse,
|
||||
client.mail as client_mail,
|
||||
client.legal_one as client_legal_one,
|
||||
defunt.nom as defunt_nom,
|
||||
defunt.sexe as defunt_sexe,
|
||||
lieu.nom as lieu_nom,
|
||||
lieu.adresse as lieu_adresse,
|
||||
thanato.nom as thanato_nom,
|
||||
thanato.prenom as thanato_prenom,
|
||||
client_group_facturation.id as group_id,
|
||||
client_group_facturation.group_facturation_name as group_name,
|
||||
client_group_facturation.phone_number as group_phone_number,
|
||||
client_group_facturation.address as group_address,
|
||||
client_group_facturation.postal_code as group_postal_code,
|
||||
client_group_facturation.city as group_city,
|
||||
client_group_facturation.email as group_email,
|
||||
client_group_facturation.siret_number as group_siret_number,
|
||||
client_group_facturation.tva_intracommu as group_tva_intracommu,
|
||||
client_group_facturation.fk_template_type_key as fk_template_type_key
|
||||
FROM ".$this->tableprefix."devis as devis
|
||||
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
|
||||
LEFT JOIN ".$this->tableprefix."defunt as defunt on devis.id_defunt = defunt.id
|
||||
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.id
|
||||
LEFT JOIN ".$this->tableprefix."thanato as thanato on devis.id_thanato = thanato.id
|
||||
LEFT JOIN ".$this->tableprefix."client_group_facturation as client_group_facturation on client.fk_client_group_facturation_id = client_group_facturation.id
|
||||
WHERE
|
||||
client.fk_client_group_facturation_id = ? AND
|
||||
YEAR(devis.date) = ? AND
|
||||
MONTH(devis.date) = ?";
|
||||
|
||||
$conditions = [$clientGroupFacturationId,$year,$month];
|
||||
if(!empty($mentionFilters)){
|
||||
$mentionsFilterPlaceholders = implode(',', array_fill(0, count($mentionFilters), '?'));
|
||||
$sql .= " AND devis.mentions IN ($mentionsFilterPlaceholders)";
|
||||
$conditions = array_merge($conditions, $mentionFilters);
|
||||
}
|
||||
$sql.= " ORDER BY devis.date ASC;";
|
||||
$devisList = $this->execSQLNoJsonReturn($sql,$conditions);
|
||||
|
||||
return $devisList;
|
||||
}
|
||||
|
||||
private function getDevisDataByClientIdAndMonthYear($clientId,$month,$year,$mentionFilters = []){
|
||||
$sql = "SELECT
|
||||
devis.id as devis_id,
|
||||
devis.date as devis_date,
|
||||
devis.num as calendar_uuid,
|
||||
devis.comment as devis_comment,
|
||||
devis.order_number as order_number,
|
||||
devis.case_number as case_number,
|
||||
devis.devis_full_number as devis_full_number,
|
||||
client.nom as client_nom,
|
||||
client.entreprise as client_entreprise,
|
||||
client.adresse as client_adresse,
|
||||
client.mail as client_mail,
|
||||
client.legal_one as client_legal_one,
|
||||
defunt.nom as defunt_nom,
|
||||
defunt.sexe as defunt_sexe,
|
||||
lieu.nom as lieu_nom,
|
||||
lieu.adresse as lieu_adresse,
|
||||
thanato.nom as thanato_nom,
|
||||
thanato.prenom as thanato_prenom,
|
||||
client_group_facturation.id as group_id,
|
||||
client_group_facturation.group_facturation_name as group_name,
|
||||
client_group_facturation.phone_number as group_phone_number,
|
||||
client_group_facturation.address as group_address,
|
||||
client_group_facturation.postal_code as group_postal_code,
|
||||
client_group_facturation.city as group_city,
|
||||
client_group_facturation.email as group_email,
|
||||
client_group_facturation.siret_number as group_siret_number,
|
||||
client_group_facturation.tva_intracommu as group_tva_intracommu,
|
||||
client_group_facturation.fk_template_type_key as fk_template_type_key
|
||||
FROM ".$this->tableprefix."devis as devis
|
||||
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
|
||||
LEFT JOIN ".$this->tableprefix."defunt as defunt on devis.id_defunt = defunt.id
|
||||
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.id
|
||||
LEFT JOIN ".$this->tableprefix."thanato as thanato on devis.id_thanato = thanato.id
|
||||
LEFT JOIN ".$this->tableprefix."client_group_facturation as client_group_facturation on client.fk_client_group_facturation_id = client_group_facturation.id
|
||||
WHERE
|
||||
client.id = ? AND
|
||||
YEAR(devis.date) = ? AND
|
||||
MONTH(devis.date) = ?";
|
||||
|
||||
$conditions = [$clientId,$year,$month];
|
||||
if(!empty($mentionFilters)){
|
||||
$mentionsFilterPlaceholders = implode(',', array_fill(0, count($mentionFilters), '?'));
|
||||
$sql .= " AND devis.mentions IN ($mentionsFilterPlaceholders)";
|
||||
$conditions = array_merge($conditions, $mentionFilters);
|
||||
}
|
||||
$sql.= " ORDER BY devis.date ASC;";
|
||||
$devisList = $this->execSQLNoJsonReturn($sql,$conditions);
|
||||
|
||||
return $devisList;
|
||||
}
|
||||
|
||||
public function getClientTemplateTypes(){
|
||||
$sql = "SELECT * FROM ".$this->tableprefix."client_template_type as client_template_type";
|
||||
return $this->execSQL($sql,[]);
|
||||
}
|
||||
|
||||
public function getFactureGroupById($factureId){
|
||||
$sql = "SELECT
|
||||
facture.id,
|
||||
facture.date,
|
||||
facture.date_paiement,
|
||||
facture.num,
|
||||
facture.fk_client_id,
|
||||
facture.fk_client_group_facturation_id,
|
||||
facture.month,
|
||||
facture.year
|
||||
FROM ".$this->tableprefix."facture as facture
|
||||
WHERE facture.id = ? AND
|
||||
facture.facture_type = ?
|
||||
;";
|
||||
|
||||
$result = $this->execSQLNoJsonReturn($sql,[$factureId,FactureTypeConstant::TYPE_GROUP]);
|
||||
if(!empty($result)){
|
||||
return $result[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getFactureGroupByFactureIdWithDetails($factureId){
|
||||
$facture = $this->getFactureGroupById($factureId);
|
||||
$configuration = $this->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD);
|
||||
$configuration = json_decode($configuration);
|
||||
$currentConfig = $configuration[0];
|
||||
$tvaValue = $currentConfig->tva_default;
|
||||
$isFactureSingleClient = $facture['fk_client_id'] != null
|
||||
&& $facture['fk_client_id'] != 0;
|
||||
|
||||
$devisMentionFilters = [
|
||||
DevisMentionConstant::FACTURED,
|
||||
DevisMentionConstant::FACTURED_FORMATTED
|
||||
];
|
||||
|
||||
if($isFactureSingleClient){
|
||||
$client = $this->getClientById($facture['fk_client_id']);
|
||||
$facture['group_name'] = $client["client_nom"];
|
||||
$facture['client_name'] = $client["client_prenom"];
|
||||
$facture['client_address'] = $client["client_address"];
|
||||
$facture['siret'] = $client["client_legal_one"];
|
||||
$facture['mail'] = $client["client_mail"];
|
||||
$devisList = $this->getDevisDataByClientIdAndMonthYear(
|
||||
$facture['fk_client_id'],
|
||||
$facture['month'],
|
||||
$facture['year'],
|
||||
$devisMentionFilters
|
||||
);
|
||||
}
|
||||
else{
|
||||
$clientGroupFacturation = $this->getClientGroupFacturationById($facture['fk_client_group_facturation_id']);
|
||||
$facture['group_name'] = $clientGroupFacturation["group_facturation_name"];
|
||||
$facture['client_name'] = $clientGroupFacturation["group_facturation_name"];
|
||||
$facture['client_address'] = $clientGroupFacturation["address"] . ' - ' .$clientGroupFacturation["postal_code"] . ' ' . $clientGroupFacturation['city'];
|
||||
$facture['siret'] = $clientGroupFacturation["siret_number"];
|
||||
$facture['mail'] = $clientGroupFacturation["email"];
|
||||
$devisList = $this->getDevisDataByClientGroupFacturationIdAndMonthYear(
|
||||
$facture['fk_client_group_facturation_id'],
|
||||
$facture['month'],
|
||||
$facture['year'],
|
||||
$devisMentionFilters
|
||||
);
|
||||
}
|
||||
$factureTotalHt= 0;
|
||||
$factureTotalTva = 0;
|
||||
$factureTotalTtc = 0;
|
||||
foreach($devisList as &$currentDevis){
|
||||
$totalHt = 0;
|
||||
$totalTva = 0;
|
||||
$totalTtc = 0;
|
||||
$devisProducts = $this->getDevisProduits($currentDevis['devis_id']);
|
||||
foreach($devisProducts as $currentProduct){
|
||||
$valueHt = $currentProduct['produit_price'] * $currentProduct['quantite'];
|
||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||
$totalHt+=$valueHt;
|
||||
$totalTtc+=$valueTtc;
|
||||
$tvaAmount = $valueTtc - $valueHt;
|
||||
$totalTva += $tvaAmount;
|
||||
}
|
||||
$currentDevis["totalHt"] = $totalHt;
|
||||
$currentDevis["totalTtc"] = $totalTtc;
|
||||
$currentDevis["totalTva"] = $totalTva;
|
||||
$factureTotalHt += $totalHt;
|
||||
$factureTotalTtc += $totalTtc;
|
||||
$factureTotalTva += $totalTva;
|
||||
$facture["devisList"][] = $currentDevis;
|
||||
}
|
||||
$facture["totalHt"] = $factureTotalHt;
|
||||
$facture["totalTtc"] = $factureTotalTtc;
|
||||
$facture["totalTva"] = $factureTotalTva;
|
||||
$facture["isFactureClientGroup"] = !$isFactureSingleClient;
|
||||
return $facture;
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,4 +13,8 @@ class PriceHelpers
|
||||
return ($price * (1 + ($vat / 100)));
|
||||
}
|
||||
|
||||
public static function formatDecimalPrice($price){
|
||||
return number_format($price,2,'.','');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Calendar App
|
||||
*
|
||||
* @copyright 2021 Anna Larch <anna.larch@gmx.net>
|
||||
*
|
||||
* @author Anna Larch <anna.larch@gmx.net>
|
||||
* @author Richard Steinmetz <richard@steinmetz.cloud>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Gestion\Service\InvoiceGroupPdfHandler;
|
||||
|
||||
use DateTime;
|
||||
use OCA\Gestion\Helpers\FileExportHelpers;
|
||||
use OCA\Gestion\Helpers\PriceHelpers;
|
||||
|
||||
class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
|
||||
public int $maxArticlePerPage = 6;
|
||||
|
||||
public function DrawArticlesTableValue(){
|
||||
$this->SetFont('ComicSans','',10);
|
||||
$devisData = $this->factureData['devis'];
|
||||
$tvaValue = $this->factureData["configuration"]->tva_default;
|
||||
$totalHt = 0;
|
||||
$totalTtc = 0;
|
||||
$totalTva = 0;
|
||||
$yValue = $this->startingYOfArticlesTable + 11;
|
||||
$maxDescriptionWidth = 98;
|
||||
$currentIndexPosition = $this->currentIndexPosition;
|
||||
for($currentIndexPosition;$currentIndexPosition<($this->initialIndexPosition + $this->devisCountToGet);$currentIndexPosition++){
|
||||
$currentDevis = $devisData[$currentIndexPosition];
|
||||
$devisDate = $currentDevis['devis_date'];
|
||||
$devisDate = DateTime::createFromFormat('Y-m-d',$devisDate);
|
||||
$devisDate = $devisDate->format('d-m-Y');
|
||||
$products = $currentDevis["products"];
|
||||
$subcontractorOrderNumberText = "Numéro de sous traitance ".$currentDevis["order_number"];
|
||||
$subcontractorCaseNumberText = "Numéro de dossier ".$currentDevis["case_number"];
|
||||
$this->SetXY( 35,$yValue );
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($subcontractorOrderNumberText),0,'0',);
|
||||
$yValue += 6;
|
||||
|
||||
$this->SetXY( 35,$yValue );
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($subcontractorCaseNumberText),0,'0',);
|
||||
$yValue += 6;
|
||||
foreach($products as $product){
|
||||
$valueHt = $product['produit_price'];
|
||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||
$totalHt+=$valueHt;
|
||||
$totalTtc+=$valueTtc;
|
||||
$productDescription = $product["produit_description"] ?? "";
|
||||
$dateValue = "";
|
||||
if($product === end($products)){
|
||||
$dateValue = $devisDate;
|
||||
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
|
||||
}
|
||||
$productDescriptionWidth = $this->GetStringWidth($productDescription);
|
||||
$productDescriptionIsMultiline = $productDescriptionWidth > $maxDescriptionWidth;
|
||||
$tvaAmount = $valueTtc - $valueHt;
|
||||
|
||||
$this->SetXY( 8,$yValue );
|
||||
$this->Cell(20, 6, $dateValue, 0,0);
|
||||
|
||||
$this->SetXY( 35,$yValue );
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($productDescription),0,'0',);
|
||||
|
||||
$this->SetXY( 138,$yValue );
|
||||
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 160,$yValue );
|
||||
$this->Cell(20, 6, number_format($tvaAmount,2,'.','').chr(128), 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 181,$yValue );
|
||||
$this->Cell(25, 6, number_format($valueTtc,2,'.','').chr(128), 0, 1, 'C');
|
||||
$yValue += 6;
|
||||
$totalTva += $tvaAmount;
|
||||
if($productDescriptionIsMultiline){
|
||||
$yValue += 6;
|
||||
}
|
||||
}
|
||||
$yValue += 2;
|
||||
}
|
||||
$this->currentIndexPosition = $currentIndexPosition;
|
||||
$this->initialIndexPosition = $this->currentIndexPosition;
|
||||
$chargedDevisCount = $this->currentIndexPosition + 1;
|
||||
$devisLeftToGet = $this->devisCount - $chargedDevisCount;
|
||||
$this->devisCountToGet = ($devisLeftToGet <= $this->maxArticlePerPage) ? $devisLeftToGet + 1 : $this->maxArticlePerPage;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,385 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Calendar App
|
||||
*
|
||||
* @copyright 2021 Anna Larch <anna.larch@gmx.net>
|
||||
*
|
||||
* @author Anna Larch <anna.larch@gmx.net>
|
||||
* @author Richard Steinmetz <richard@steinmetz.cloud>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Gestion\Service\InvoiceGroupPdfHandler;
|
||||
|
||||
use DateTime;
|
||||
use \FPDF;
|
||||
use OCA\Gestion\Helpers\FileExportHelpers;
|
||||
use OCA\Gestion\Helpers\PriceHelpers;
|
||||
|
||||
class InvoiceGroupPdfHandler extends FPDF {
|
||||
public $factureData = [];
|
||||
public $logo = null;
|
||||
|
||||
public $productsCount = 0;
|
||||
|
||||
public $totalPrices = [];
|
||||
public $devisCount = 0;
|
||||
public $logoPath = "/var/www/html/data/admin/files/.gestion/";
|
||||
|
||||
public $currentIndexPosition = 0;
|
||||
public $initialIndexPosition = 0;
|
||||
|
||||
public $devisCountToGet = 0;
|
||||
public $devisList = [];
|
||||
|
||||
public $thereIsOrderOrCaseNumber = false;
|
||||
public $startingYOfArticlesTable = 95;
|
||||
public int $maxArticlePerPage = 19;
|
||||
public $additionalArticlesLineBasedOnMultiline = 0;
|
||||
function Header()
|
||||
{
|
||||
if($this->logo != "nothing"){
|
||||
$this->Image($this->logoPath."logo.png", 2, 2, 75,25);
|
||||
}
|
||||
else{
|
||||
$this->Cell(55,30,'');
|
||||
}
|
||||
$this->SetMargins(3,0,3);
|
||||
$this->DrawInvoiceCompanyAndClientInfo();
|
||||
$this->DrawInvoiceInfoTable();
|
||||
}
|
||||
function Footer()
|
||||
{
|
||||
$this->SetY(-35);
|
||||
$this->SetFont('ComicSans', '', size: 7);
|
||||
$this->MultiCell(0,5,utf8_decode(html_entity_decode('Tout retard de paiement entraînera de plein droit une pénalité de retard de 3 fois le taux légal ( Loi 2008-776 du 4 août 2008) et une indemnité forfaitaire de 40 EUR pour frais de recouvrement sera appliquée.')));
|
||||
$this->Ln(1);
|
||||
$this->MultiCell(0,5,utf8_decode(html_entity_decode('Si les frais de recouvrement sont supérieurs à ce montant forfaitaire, une indemnisation complémentaire sera due sur présentation de justificatifs ( articles L.441-3 et L.441-6 du code de commerce ).
|
||||
')));
|
||||
|
||||
$this->SetY(-15);
|
||||
$this->SetFont('ComicSans', 'B', 8);
|
||||
$this->Cell(0, 10, utf8_decode(html_entity_decode($this->factureData['configuration']->legal_one)), 0, 0, 'C');
|
||||
}
|
||||
|
||||
public function InvoicePdfFactory(array $factureData,$logo = null){
|
||||
$this->factureData = $factureData;
|
||||
$this->productsCount = $this->factureData["productsCount"];
|
||||
$this->devisCount = count($this->factureData['devis']);
|
||||
$this->totalPrices = $this->factureData["totalPrices"];
|
||||
$this->devisCountToGet = ($this->devisCount <= $this->maxArticlePerPage ) ? $this->devisCount : $this->maxArticlePerPage;
|
||||
$this->devisList = $this->factureData['devis'];
|
||||
$this->logo = $logo;
|
||||
}
|
||||
|
||||
public function GetInvoiceFilename(){
|
||||
$factureNum = $this->factureData['num'];
|
||||
$factureNum = str_replace('/','-',$factureNum);
|
||||
$clientName = str_replace(' ',' ',$this->factureData['group_name'] ?? '');
|
||||
return $this->factureData['configuration']->facture_prefixe.'_'.$factureNum.'_'.mb_strtoupper($clientName,'UTF-8');
|
||||
}
|
||||
|
||||
public function DrawPageNumbersText($pageNumber,$pageCount){
|
||||
$this->SetXY( 120, 5 );
|
||||
$this->Cell( 160, 8, $pageNumber . '/' . $pageCount, 0, 0, 'C');
|
||||
}
|
||||
|
||||
public function DrawArticlesTable(){
|
||||
$pageCount = ceil($this->devisCount / $this->maxArticlePerPage);
|
||||
$pageNumber = 1;
|
||||
while($pageNumber <= $pageCount){
|
||||
if($pageNumber > 1){
|
||||
$this->AddPage();
|
||||
$this->DrawPageNumbersText($pageNumber,$pageCount);
|
||||
}
|
||||
$this->DrawArticlesTableRect();
|
||||
$this->DrawArticlesTableHeader();
|
||||
$this->DrawArticlesTableValue();
|
||||
$pageNumber++;
|
||||
}
|
||||
}
|
||||
|
||||
public function DrawInvoiceCompanyInfo(){
|
||||
$this->SetY(40);
|
||||
$this->SetFont('ComicSans', '', 10);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport($this->factureData['configuration']->entreprise), 0, 1);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse']), 0, 1);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse_city']), 0, 1);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport('Tél : ') . FileExportHelpers::FormatTextForExport($this->factureData['configuration']->telephone),0,1);
|
||||
$this->Cell(0, 5, 'Mail : ' . $this->factureData['configuration']->mail, 0, 1);
|
||||
}
|
||||
public function DrawInvoiceClientInfo(){
|
||||
$this->SetFont('ComicSans', '', 10);
|
||||
$clientName = $this->factureData['group_name'];
|
||||
$clientInfoXAxis = 125;
|
||||
|
||||
$clientAddress = $this->factureData['client_real_adress'];
|
||||
$clientAdressWidth = $this->GetStringWidth($clientAddress);
|
||||
$maxWidth = $this->GetPageWidth();
|
||||
$availableWidhtForClientInfo = $maxWidth - 10 - $clientInfoXAxis;
|
||||
$clientAdressIsMultiline = $clientAdressWidth > $availableWidhtForClientInfo;
|
||||
|
||||
$clientInfoYAxis = $clientAdressIsMultiline ? 35 : 40;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport($clientName));
|
||||
$clientInfoYAxis += 5;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->MultiCell( 0, 5, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
||||
if($clientAdressIsMultiline){
|
||||
$clientInfoYAxis += 5;
|
||||
}
|
||||
$clientInfoYAxis += 5;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 5, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city'])));
|
||||
}
|
||||
|
||||
public function DrawInvoiceCompanyAndClientInfo(){
|
||||
$this->DrawInvoiceCompanyInfo();
|
||||
$this->DrawInvoiceClientInfo();
|
||||
}
|
||||
|
||||
public function DrawInvoiceInfoTable(){
|
||||
$this->setY(67);
|
||||
$factureDatePaiement = $this->factureData['date_paiement'];
|
||||
$factureDatePaiement = DateTime::createFromFormat('Y-m-d',$factureDatePaiement);
|
||||
$factureDateEcheance = $factureDatePaiement;
|
||||
$factureDatePaiement = $factureDatePaiement->format('d-m-Y');
|
||||
$factureDateEcheance->modify('last day of next month');
|
||||
$factureDateEcheance = $factureDateEcheance->format('d-m-Y');
|
||||
$this->SetFont('ComicSans', 'B', 11);
|
||||
$this->Cell(30, 7, 'DATE', 1, 0, 'C');
|
||||
$this->Cell(94, 7, 'CLIENT', 1, 0, 'C');
|
||||
$this->Cell(40, 7, 'FACTURE', 1, 0, 'C');
|
||||
$this->Cell(40, 7, 'ECHEANCE', 1, 1, 'C');
|
||||
|
||||
$this->SetFont('ComicSans', '', 10);
|
||||
$this->Cell(30, 7, $factureDatePaiement, 1, 0, 'C');
|
||||
$this->Cell(94, 7, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C');
|
||||
$this->Cell(40, 7, $this->factureData['num'], 1, 0, 'C');
|
||||
$this->Cell(40, 7, $factureDateEcheance, 1, 1, 'C');
|
||||
|
||||
$this->startingYOfArticlesTable = 85;
|
||||
}
|
||||
|
||||
public function DrawArticlesTableRect(){
|
||||
$this->SetLineWidth(0.2);
|
||||
$gapBetweenStartingOfArticlesTableAndColumnName = 10;
|
||||
$tableHeight = $this->thereIsOrderOrCaseNumber ? 137 : 137 + 10;
|
||||
$this->Rect(3, $this->startingYOfArticlesTable, 204, $tableHeight, "D");
|
||||
// cadre titre des colonnes
|
||||
$this->Line(3, $this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName, 207,$this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName);
|
||||
// les traits verticaux colonnes
|
||||
$this->Line(35, $this->startingYOfArticlesTable, 35, 232);
|
||||
$this->Line(135, $this->startingYOfArticlesTable, 135, 232);
|
||||
$this->Line(160, $this->startingYOfArticlesTable, 160, 232);
|
||||
$this->Line(180, $this->startingYOfArticlesTable, 180, 232);
|
||||
}
|
||||
|
||||
public function DrawArticlesTableHeader(){
|
||||
$tvaValue = $this->factureData["configuration"]->tva_default;
|
||||
$columnNameY = $this->startingYOfArticlesTable + 1;
|
||||
$this->SetFont('ComicSans','',10);
|
||||
$this->SetXY( 9,$columnNameY );
|
||||
$this->Cell( 20, 8, "Date", 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 35,$columnNameY );
|
||||
$this->Cell( 100, 8, "Description", 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 138,$columnNameY );
|
||||
$this->Cell( 20, 8, "Prix Uni. HT", 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 160,$columnNameY );
|
||||
$this->Cell( 20, 8, 'TVA ' . $tvaValue . '%', 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 181,$columnNameY );
|
||||
$this->Cell( 25, 8, "Prix Uni. TTC", 0, 0, 'C');
|
||||
|
||||
}
|
||||
|
||||
public function DrawArticlesTableValue(){
|
||||
$this->SetFont('ComicSans','',10);
|
||||
$devisData = $this->factureData['devis'];
|
||||
$tvaValue = $this->factureData["configuration"]->tva_default;
|
||||
$totalHt = 0;
|
||||
$totalTtc = 0;
|
||||
$totalTva = 0;
|
||||
$yValue = $this->startingYOfArticlesTable + 11;
|
||||
$maxDescriptionWidth = 104;
|
||||
$currentIndexPosition = $this->currentIndexPosition;
|
||||
for($currentIndexPosition;$currentIndexPosition<($this->initialIndexPosition + $this->devisCountToGet);$currentIndexPosition++){
|
||||
$currentDevis = $devisData[$currentIndexPosition];
|
||||
$devisDate = $currentDevis['devis_date'];
|
||||
$devisDate = DateTime::createFromFormat('Y-m-d',$devisDate);
|
||||
$devisDate = $devisDate->format('d-m-Y');
|
||||
$products = $currentDevis["products"];
|
||||
foreach($products as $product){
|
||||
$valueHt = $product['produit_price'];
|
||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||
$totalHt+=$valueHt;
|
||||
$totalTtc+=$valueTtc;
|
||||
$productDescription = $product["produit_description"] ?? "";
|
||||
$dateValue = "";
|
||||
if($product === end($products)){
|
||||
$dateValue = $devisDate;
|
||||
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
|
||||
}
|
||||
$productDescriptionWidth = $this->GetStringWidth($productDescription);
|
||||
if($currentDevis["defunt_nom"] == "LANGLEMENT Catherine"){
|
||||
var_dump($productDescriptionWidth);
|
||||
}
|
||||
$productDescriptionIsMultiline = $productDescriptionWidth > $maxDescriptionWidth;
|
||||
$tvaAmount = $valueTtc - $valueHt;
|
||||
$this->SetXY( 8,$yValue );
|
||||
$this->Cell(20, 6, $dateValue, 0,0);
|
||||
|
||||
$this->SetXY( 35,$yValue );
|
||||
if($productDescriptionIsMultiline){
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($productDescription),0,'0',);
|
||||
}
|
||||
else{
|
||||
$this->Cell(100,6,FileExportHelpers::FormatTextForExport($productDescription),0,0);
|
||||
}
|
||||
|
||||
$this->SetXY( 138,$yValue );
|
||||
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 160,$yValue );
|
||||
$this->Cell(20, 6, number_format($tvaAmount,2,'.','').chr(128), 0, 0, 'C');
|
||||
|
||||
$this->SetXY( 181,$yValue );
|
||||
$this->Cell(25, 6, number_format($valueTtc,2,'.','').chr(128), 0, 1, 'C');
|
||||
$yValue += 6;
|
||||
$totalTva += $tvaAmount;
|
||||
if($productDescriptionIsMultiline){
|
||||
$yValue += 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->currentIndexPosition = $currentIndexPosition;
|
||||
$this->initialIndexPosition = $this->currentIndexPosition;
|
||||
$chargedDevisCount = $this->currentIndexPosition + 1;
|
||||
$devisLeftToGet = $this->devisCount - $chargedDevisCount;
|
||||
$this->devisCountToGet = ($devisLeftToGet <= $this->maxArticlePerPage) ? $devisLeftToGet + 1 : $this->maxArticlePerPage;
|
||||
}
|
||||
|
||||
public function DrawBankAndTotalPriceInfo(){
|
||||
$this->SetY(235);
|
||||
$this->SetFont('ComicSans', '', 7);
|
||||
$this->MultiCell(0,5,utf8_decode(html_entity_decode("Paiement à votre convenance par chèque à l'ordre de ". $this->factureData['configuration']->entreprise)));
|
||||
$this->MultiCell(0,5,utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :")));
|
||||
|
||||
$this->Ln(1);
|
||||
|
||||
//Table IBAN
|
||||
$this->SetFont('ComicSans', '', 9);
|
||||
$ibanWidth = 90;
|
||||
$ibanCursorY = $this->GetY();
|
||||
$this->Cell($ibanWidth, 5, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C');
|
||||
$ibanCursorX = $this->GetX();
|
||||
$this->Cell($ibanWidth, 5, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C');
|
||||
|
||||
//TABLE HT
|
||||
$ibanLastPositionX = $ibanCursorX+$ibanWidth + 54;
|
||||
$startOfArrayX = $ibanLastPositionX;
|
||||
$startOfArrayY = $ibanCursorY - 10;
|
||||
$totalPriceArray = $this->totalPrices;
|
||||
foreach($totalPriceArray as $label => $price){
|
||||
$this->SetXY($startOfArrayX,$startOfArrayY);
|
||||
$this->Cell(30, 5, $label, 1, 1, 'C');
|
||||
$this->SetXY($startOfArrayX + 30,$startOfArrayY);
|
||||
$this->Cell(30, 5, number_format($price,2,'.','').chr(128), 1, 1, 'C');
|
||||
$startOfArrayY += 5;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetFactureContent(){
|
||||
$this->AddPage();
|
||||
$this->SetMargins(3,0,3);
|
||||
$this->DrawArticlesTable();
|
||||
$this->DrawBankAndTotalPriceInfo();
|
||||
}
|
||||
|
||||
function MultiAlignCell($w,$h,$text,$border=0,$ln=0,$align='L',$fill=false)
|
||||
{
|
||||
// Store reset values for (x,y) positions
|
||||
$x = $this->GetX() + $w;
|
||||
$y = $this->GetY();
|
||||
|
||||
// Make a call to FPDF's MultiCell
|
||||
$this->MultiCell($w,$h,$text,$border,$align,$fill);
|
||||
|
||||
// Reset the line position to the right, like in Cell
|
||||
if( $ln==0 )
|
||||
{
|
||||
$this->SetXY($x,$y);
|
||||
}
|
||||
}
|
||||
|
||||
function NbLines($w, $txt)
|
||||
{
|
||||
// Compute the number of lines a MultiCell of width w will take
|
||||
if(!isset($this->CurrentFont))
|
||||
$this->Error('No font has been set');
|
||||
$cw = $this->CurrentFont['cw'];
|
||||
if($w==0)
|
||||
$w = $this->w-$this->rMargin-$this->x;
|
||||
$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
|
||||
$s = str_replace("\r",'',(string)$txt);
|
||||
$nb = strlen($s);
|
||||
if($nb>0 && $s[$nb-1]=="\n")
|
||||
$nb--;
|
||||
$sep = -1;
|
||||
$i = 0;
|
||||
$j = 0;
|
||||
$l = 0;
|
||||
$nl = 1;
|
||||
while($i<$nb)
|
||||
{
|
||||
$c = $s[$i];
|
||||
if($c=="\n")
|
||||
{
|
||||
$i++;
|
||||
$sep = -1;
|
||||
$j = $i;
|
||||
$l = 0;
|
||||
$nl++;
|
||||
continue;
|
||||
}
|
||||
if($c==' ')
|
||||
$sep = $i;
|
||||
$l += $cw[$c];
|
||||
if($l>$wmax)
|
||||
{
|
||||
if($sep==-1)
|
||||
{
|
||||
if($i==$j)
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
$i = $sep+1;
|
||||
$sep = -1;
|
||||
$j = $i;
|
||||
$l = 0;
|
||||
$nl++;
|
||||
}
|
||||
else
|
||||
$i++;
|
||||
}
|
||||
return $nl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Calendar App
|
||||
*
|
||||
* @copyright 2021 Anna Larch <anna.larch@gmx.net>
|
||||
*
|
||||
* @author Anna Larch <anna.larch@gmx.net>
|
||||
* @author Richard Steinmetz <richard@steinmetz.cloud>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Gestion\Service\InvoiceGroupPdfHandler;
|
||||
|
||||
use DateTime;
|
||||
use OCA\Gestion\Helpers\FileExportHelpers;
|
||||
use OCA\Gestion\Helpers\PriceHelpers;
|
||||
|
||||
class InvoiceOgfPdfHandler extends InvoiceGroupPdfHandler {
|
||||
|
||||
public function DrawInvoiceClientInfo(){
|
||||
$this->SetFont('ComicSans', '', 10);
|
||||
$clientName = $this->factureData['group_name'];
|
||||
$clientInfoXAxis = 125;
|
||||
|
||||
$clientAddress = $this->factureData['client_real_adress'];
|
||||
$clientAdressWidth = $this->GetStringWidth($clientAddress);
|
||||
$maxWidth = $this->GetPageWidth();
|
||||
$availableWidhtForClientInfo = $maxWidth - 10 - $clientInfoXAxis;
|
||||
$clientAdressIsMultiline = $clientAdressWidth > $availableWidhtForClientInfo;
|
||||
|
||||
$clientInfoYAxis = $clientAdressIsMultiline ? 35 : 40;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport($clientName));
|
||||
$clientInfoYAxis += 5;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->MultiCell( 0, 5, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
||||
if($clientAdressIsMultiline){
|
||||
$clientInfoYAxis += 5;
|
||||
}
|
||||
$clientInfoYAxis += 5;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 5, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city'])));
|
||||
$clientInfoYAxis += 5;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport('Numéro') . ' Siret: ' . $this->factureData['siret']);
|
||||
$clientInfoYAxis += 5;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport('Mail : ') . $this->factureData['client_mail']);
|
||||
}
|
||||
|
||||
public function DrawInvoiceInfoTable(){
|
||||
$this->setY(67);
|
||||
$factureDatePaiement = $this->factureData['date_paiement'];
|
||||
$factureDatePaiement = DateTime::createFromFormat('Y-m-d',$factureDatePaiement);
|
||||
$factureDateEcheance = $factureDatePaiement;
|
||||
$factureDatePaiement = $factureDatePaiement->format('d-m-Y');
|
||||
$factureDateEcheance->modify('last day of next month');
|
||||
$factureDateEcheance = $factureDateEcheance->format('d-m-Y');
|
||||
$this->SetFont('ComicSans', 'B', 11);
|
||||
$this->Cell(30, 7, 'DATE', 1, 0, 'C');
|
||||
$this->Cell(60, 7, 'CLIENT', 1, 0, 'C');
|
||||
$this->Cell(40, 7, 'FACTURE', 1, 0, 'C');
|
||||
$this->Cell(40, 7, 'ECHEANCE', 1, 0, 'C');
|
||||
$this->Cell(34, 7, 'COMMANDE', 1, 1, 'C');
|
||||
|
||||
$this->SetFont('ComicSans', '', 10);
|
||||
$this->Cell(30, 7, $factureDatePaiement, 1, 0, 'C');
|
||||
$this->Cell(60, 7, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C');
|
||||
$this->Cell(40, 7, $this->factureData['num'], 1, 0, 'C');
|
||||
$this->Cell(40, 7, $factureDateEcheance, 1, 0, 'C');
|
||||
$this->Cell(34, 7, $this->factureData["facture_order_number"], 1, 1, 'C');
|
||||
|
||||
$this->startingYOfArticlesTable = 85;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -27,10 +27,18 @@ declare(strict_types=1);
|
||||
namespace OCA\Gestion\Service;
|
||||
|
||||
use DateTime;
|
||||
use OCA\Gestion\Constants\BddConstant;
|
||||
use OCA\Gestion\Constants\ClientTemplateTypeConstant;
|
||||
use OCA\Gestion\Constants\DevisMentionConstant;
|
||||
use OCA\Gestion\Constants\FactureTypeConstant;
|
||||
use OCA\Gestion\Constants\MultipleFactureTypeConstant;
|
||||
use OCA\Gestion\Db\Bdd;
|
||||
use OCA\Gestion\Helpers\DateHelpers;
|
||||
use OCA\Gestion\Service\InvoiceGroupPdfHandler\InvoiceFunecapPdfHandler;
|
||||
use OCA\Gestion\Service\InvoiceGroupPdfHandler\InvoiceGroupPdfHandler;
|
||||
use OCA\Gestion\Service\InvoiceGroupPdfHandler\InvoiceOgfPdfHandler;
|
||||
use OCA\Gestion\Service\InvoiceRecap\InvoiceRecapService;
|
||||
use OCP\DB\Exception;
|
||||
use OCP\Files\IRootFolder;
|
||||
|
||||
class InvoicePdfService {
|
||||
@ -73,7 +81,7 @@ class InvoicePdfService {
|
||||
return base64_encode($file->getContent());
|
||||
}
|
||||
|
||||
public function generateFacturePdfByFactureId($factureId,$idNextCloud){
|
||||
private function generateFactureSinglePdfByFactureId($factureId,$idNextCloud){
|
||||
$storage = $this->rootFolder->getUserFolder($idNextCloud);
|
||||
$configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
|
||||
$currentConfig = $configs[0];
|
||||
@ -106,6 +114,28 @@ class InvoicePdfService {
|
||||
}
|
||||
return $filenames;
|
||||
}
|
||||
|
||||
public function generateFacturePdfByFactureId($factureId,$idNextCloud){
|
||||
$factureType = $this->gestionBdd->getFactureTypeByFactureId($factureId);
|
||||
if($factureType == FactureTypeConstant::TYPE_SINGLE){
|
||||
return $this->generateFactureSinglePdfByFactureId($factureId,$idNextCloud);
|
||||
}
|
||||
else{
|
||||
return $this->generateFactureGroupPdfByFactureId($factureId,$idNextCloud);
|
||||
}
|
||||
}
|
||||
|
||||
private function getGroupFactureFolder(array $factureData,$racinePath){
|
||||
$clientRacineFolder = $racinePath.'CLIENTS/'.mb_strtoupper($factureData["group_name"],'UTF-8').'/';
|
||||
$factureDate = $factureData['date_paiement'];
|
||||
$factureDatetime = new DateTime($factureDate);
|
||||
$factureDateYear = $factureDatetime->format('Y');
|
||||
$factureMonth = DateHelpers::GetDateWithFormatDayAndMonthPlainString($factureData['date_paiement']);
|
||||
$factureByYearFolder = $clientRacineFolder."$factureDateYear".'/'.$factureMonth.'/'.'FACTURES'.'/';
|
||||
return [
|
||||
$factureByYearFolder
|
||||
];
|
||||
}
|
||||
|
||||
private function getFacturesFolder(array $factureData,$racinePath){
|
||||
$clientRacineFolder = $racinePath.'CLIENTS/'.mb_strtoupper($factureData["client_nom"],'UTF-8').'/';
|
||||
@ -121,6 +151,53 @@ class InvoicePdfService {
|
||||
];
|
||||
}
|
||||
|
||||
private function generateFactureGroupPdfByFactureId($factureId,$idNextCloud){
|
||||
$storage = $this->rootFolder->getUserFolder($idNextCloud);
|
||||
$configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
|
||||
$currentConfig = $configs[0];
|
||||
$logo = $this->getLogo();
|
||||
$invoicePdfData = $this->gestionBdd->getInvoiceGroupPdfData($factureId,$currentConfig);
|
||||
if($invoicePdfData == null){
|
||||
return "";
|
||||
}
|
||||
$templateType = $invoicePdfData['template_type_key'];
|
||||
$clean_folder = html_entity_decode(string: $currentConfig->path).'/';
|
||||
$factureFolders = $this->getGroupFactureFolder($invoicePdfData,$clean_folder);
|
||||
switch ($templateType) {
|
||||
case ClientTemplateTypeConstant::FUNECAP:
|
||||
$pdf = new InvoiceFunecapPdfHandler();
|
||||
break;
|
||||
|
||||
case ClientTemplateTypeConstant::OGF:
|
||||
$pdf = new InvoiceOgfPdfHandler();
|
||||
break;
|
||||
|
||||
default:
|
||||
$pdf = new InvoiceGroupPdfHandler();
|
||||
break;
|
||||
}
|
||||
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
|
||||
$pdf->InvoicePdfFactory($invoicePdfData,$logo);
|
||||
$pdf->SetFactureContent();
|
||||
$pdfContent = $pdf->Output('','S');
|
||||
$pdfFilename = $pdf->GetInvoiceFilename();
|
||||
$filenames = [];
|
||||
foreach($factureFolders as $folder){
|
||||
try {
|
||||
$storage->newFolder($folder);
|
||||
}
|
||||
catch(\OCP\Files\NotPermittedException $e) {
|
||||
}
|
||||
$ff_pdf = $folder.$pdfFilename.'.pdf';
|
||||
$storage->newFile($ff_pdf);
|
||||
$file_pdf = $storage->get($ff_pdf);
|
||||
$file_pdf->putContent($pdfContent);
|
||||
$filenames[] = $ff_pdf;
|
||||
}
|
||||
return $filenames;
|
||||
}
|
||||
|
||||
public function generateFacturePdfByFactureIds(array $factureIds,$idNextCloud){
|
||||
foreach( $factureIds as $factureId ){
|
||||
$this->generateFacturePdfByFactureId($factureId,$idNextCloud);
|
||||
@ -166,4 +243,48 @@ class InvoicePdfService {
|
||||
public function generateInvoiceRecap($filter,$filterType,$date,$idNextCloud){
|
||||
$this->invoiceRecapService->generateInvoiceRecap($filter,$filterType,$date,$idNextCloud);
|
||||
}
|
||||
|
||||
public function exportGroupOfDevisIntoFacture($clientId,$clientType,$month,$year,$facturationDate,$idNextcloud = BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD){
|
||||
try{
|
||||
$datetime = new Datetime();
|
||||
$month = $month ?? $datetime->format('m');
|
||||
$year = $year ?? $datetime->format('Y');
|
||||
|
||||
$factureId = null;
|
||||
$fkClientId = null;
|
||||
$fkClientGroupFacturationId = null;
|
||||
$devisMentionFiltersToBeInvoiced = [
|
||||
DevisMentionConstant::NEW,
|
||||
DevisMentionConstant::MENTION
|
||||
];
|
||||
if($clientType == MultipleFactureTypeConstant::CLIENT_FILTER_TYPE){
|
||||
$factureId = $this->gestionBdd->getFactureIdByClientIdAndMonthYear($clientId,$month,$year);
|
||||
$devisIds = $this->gestionBdd->getDevisIdsByClientIdAndMonthYear($clientId,$month,$year,$devisMentionFiltersToBeInvoiced);
|
||||
$fkClientId = $clientId;
|
||||
}
|
||||
else{
|
||||
$factureId = $this->gestionBdd->getFactureIdByClientGroupFacturationIdAndMonthYear($clientId,$month,$year);
|
||||
$devisIds = $this->gestionBdd->getDevisIdsByClientGroupFacturationIdAndMonthYear($clientId,$month,$year);
|
||||
$fkClientGroupFacturationId = $clientId;
|
||||
}
|
||||
$clientIsAlreadyFacturedForThisMonthAndYear = $factureId != null && $factureId != 0;
|
||||
if($clientIsAlreadyFacturedForThisMonthAndYear == false){
|
||||
$factureId = $this->gestionBdd->createFactureAndReturnFactureId(
|
||||
$facturationDate,
|
||||
FactureTypeConstant::TYPE_GROUP,
|
||||
$month,
|
||||
$year,
|
||||
$fkClientId,
|
||||
$fkClientGroupFacturationId);
|
||||
}
|
||||
|
||||
$this->gestionBdd->invoiceListOfDevisIds($devisIds);
|
||||
$filenames = $this->generateFactureGroupPdfByFactureId($factureId,$idNextcloud);
|
||||
return $filenames;
|
||||
}
|
||||
catch(Exception){
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
8
gestion/lib/Sql/20250228-ADD_GROUP_DEVIS_FACTURE.sql
Normal file
8
gestion/lib/Sql/20250228-ADD_GROUP_DEVIS_FACTURE.sql
Normal file
@ -0,0 +1,8 @@
|
||||
create table if not exists oc_gestion_devis_facture (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
fk_devis_id INT NOT NULL,
|
||||
fk_facture_id INT NOT NULL
|
||||
);
|
||||
|
||||
alter table oc_gestion_facture
|
||||
add column facture_type VARCHAR(50) NOT NULL DEFAULT 'SINGLE';
|
||||
@ -0,0 +1,5 @@
|
||||
alter table oc_gestion_facture
|
||||
add column fk_client_id INT DEFAULT NULL,
|
||||
add column fk_client_group_facturation_id INT DEFAULT NULL,
|
||||
add column month int DEFAULT NULL,
|
||||
add column year int DEFAULT NULL;
|
||||
503
gestion/package-lock.json
generated
503
gestion/package-lock.json
generated
@ -35,7 +35,7 @@
|
||||
"sass-loader": ">=11.0.1",
|
||||
"style": ">=0.0.3",
|
||||
"style-loader": ">=2.0.0",
|
||||
"webpack": ">=5.61.1",
|
||||
"webpack": "^5.98.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"engines": {
|
||||
@ -277,61 +277,61 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
|
||||
"integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
|
||||
"version": "0.3.8",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",
|
||||
"integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/set-array": "^1.0.1",
|
||||
"@jridgewell/set-array": "^1.2.1",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.10",
|
||||
"@jridgewell/trace-mapping": "^0.3.9"
|
||||
"@jridgewell/trace-mapping": "^0.3.24"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/resolve-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
|
||||
"integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==",
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
|
||||
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/set-array": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
||||
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
|
||||
"integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/source-map": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
|
||||
"integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
|
||||
"version": "0.3.6",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz",
|
||||
"integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/gen-mapping": "^0.3.0",
|
||||
"@jridgewell/trace-mapping": "^0.3.9"
|
||||
"@jridgewell/gen-mapping": "^0.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.25"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.14",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
|
||||
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
|
||||
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.17",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz",
|
||||
"integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==",
|
||||
"version": "0.3.25",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
|
||||
"integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "1.4.14"
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/auth": {
|
||||
@ -693,9 +693,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/eslint-scope": {
|
||||
"version": "3.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz",
|
||||
"integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==",
|
||||
"version": "3.7.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz",
|
||||
"integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/eslint": "*",
|
||||
@ -703,9 +703,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
|
||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==",
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
|
||||
"integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/jquery": {
|
||||
@ -756,148 +756,148 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/ast": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz",
|
||||
"integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz",
|
||||
"integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/helper-numbers": "1.11.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.1"
|
||||
"@webassemblyjs/helper-numbers": "1.13.2",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/floating-point-hex-parser": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz",
|
||||
"integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz",
|
||||
"integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-api-error": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz",
|
||||
"integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz",
|
||||
"integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-buffer": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz",
|
||||
"integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz",
|
||||
"integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-numbers": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz",
|
||||
"integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz",
|
||||
"integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/floating-point-hex-parser": "1.11.1",
|
||||
"@webassemblyjs/helper-api-error": "1.11.1",
|
||||
"@webassemblyjs/floating-point-hex-parser": "1.13.2",
|
||||
"@webassemblyjs/helper-api-error": "1.13.2",
|
||||
"@xtuc/long": "4.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-wasm-bytecode": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz",
|
||||
"integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz",
|
||||
"integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@webassemblyjs/helper-wasm-section": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz",
|
||||
"integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz",
|
||||
"integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/helper-buffer": "1.11.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.1",
|
||||
"@webassemblyjs/wasm-gen": "1.11.1"
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-buffer": "1.14.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2",
|
||||
"@webassemblyjs/wasm-gen": "1.14.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/ieee754": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz",
|
||||
"integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz",
|
||||
"integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@xtuc/ieee754": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/leb128": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz",
|
||||
"integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz",
|
||||
"integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@xtuc/long": "4.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/utf8": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz",
|
||||
"integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz",
|
||||
"integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@webassemblyjs/wasm-edit": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz",
|
||||
"integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz",
|
||||
"integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/helper-buffer": "1.11.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.1",
|
||||
"@webassemblyjs/helper-wasm-section": "1.11.1",
|
||||
"@webassemblyjs/wasm-gen": "1.11.1",
|
||||
"@webassemblyjs/wasm-opt": "1.11.1",
|
||||
"@webassemblyjs/wasm-parser": "1.11.1",
|
||||
"@webassemblyjs/wast-printer": "1.11.1"
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-buffer": "1.14.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2",
|
||||
"@webassemblyjs/helper-wasm-section": "1.14.1",
|
||||
"@webassemblyjs/wasm-gen": "1.14.1",
|
||||
"@webassemblyjs/wasm-opt": "1.14.1",
|
||||
"@webassemblyjs/wasm-parser": "1.14.1",
|
||||
"@webassemblyjs/wast-printer": "1.14.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/wasm-gen": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz",
|
||||
"integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz",
|
||||
"integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.1",
|
||||
"@webassemblyjs/ieee754": "1.11.1",
|
||||
"@webassemblyjs/leb128": "1.11.1",
|
||||
"@webassemblyjs/utf8": "1.11.1"
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2",
|
||||
"@webassemblyjs/ieee754": "1.13.2",
|
||||
"@webassemblyjs/leb128": "1.13.2",
|
||||
"@webassemblyjs/utf8": "1.13.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/wasm-opt": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz",
|
||||
"integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz",
|
||||
"integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/helper-buffer": "1.11.1",
|
||||
"@webassemblyjs/wasm-gen": "1.11.1",
|
||||
"@webassemblyjs/wasm-parser": "1.11.1"
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-buffer": "1.14.1",
|
||||
"@webassemblyjs/wasm-gen": "1.14.1",
|
||||
"@webassemblyjs/wasm-parser": "1.14.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/wasm-parser": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz",
|
||||
"integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz",
|
||||
"integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/helper-api-error": "1.11.1",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.11.1",
|
||||
"@webassemblyjs/ieee754": "1.11.1",
|
||||
"@webassemblyjs/leb128": "1.11.1",
|
||||
"@webassemblyjs/utf8": "1.11.1"
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@webassemblyjs/helper-api-error": "1.13.2",
|
||||
"@webassemblyjs/helper-wasm-bytecode": "1.13.2",
|
||||
"@webassemblyjs/ieee754": "1.13.2",
|
||||
"@webassemblyjs/leb128": "1.13.2",
|
||||
"@webassemblyjs/utf8": "1.13.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/wast-printer": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz",
|
||||
"integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz",
|
||||
"integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/ast": "1.14.1",
|
||||
"@xtuc/long": "4.2.2"
|
||||
}
|
||||
},
|
||||
@ -970,9 +970,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
"integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
|
||||
"version": "8.14.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
|
||||
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
@ -981,16 +981,6 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-import-assertions": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz",
|
||||
"integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==",
|
||||
"deprecated": "package has been renamed to acorn-import-attributes",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"acorn": "^8"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-jsx": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
|
||||
@ -1236,9 +1226,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.21.5",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz",
|
||||
"integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==",
|
||||
"version": "4.24.4",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz",
|
||||
"integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -1248,13 +1238,17 @@
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/browserslist"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001449",
|
||||
"electron-to-chromium": "^1.4.284",
|
||||
"node-releases": "^2.0.8",
|
||||
"update-browserslist-db": "^1.0.10"
|
||||
"caniuse-lite": "^1.0.30001688",
|
||||
"electron-to-chromium": "^1.5.73",
|
||||
"node-releases": "^2.0.19",
|
||||
"update-browserslist-db": "^1.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"browserslist": "cli.js"
|
||||
@ -1328,9 +1322,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001457",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001457.tgz",
|
||||
"integrity": "sha512-SDIV6bgE1aVbK6XyxdURbUE89zY7+k1BBBaOwYwkNCglXlel/E7mELiHC64HQ+W0xSKlqWhV9Wh7iHxUjMs4fA==",
|
||||
"version": "1.0.30001700",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001700.tgz",
|
||||
"integrity": "sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -1340,6 +1334,10 @@
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1736,9 +1734,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.302",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.302.tgz",
|
||||
"integrity": "sha512-Uk7C+7aPBryUR1Fwvk9VmipBcN9fVsqBO57jV2ZjTm+IZ6BMNqu7EDVEg2HxCNufk6QcWlFsBkhQyQroB2VWKw==",
|
||||
"version": "1.5.103",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.103.tgz",
|
||||
"integrity": "sha512-P6+XzIkfndgsrjROJWfSvVEgNHtPgbhVyTkwLjUM2HU/h7pZRORgaTlHqfAikqxKmdJMLW8fftrdGWbd/Ds0FA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/emoji-mart-vue-fast": {
|
||||
@ -1773,9 +1771,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.12.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz",
|
||||
"integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==",
|
||||
"version": "5.18.1",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz",
|
||||
"integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
@ -1807,15 +1805,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/es-module-lexer": {
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz",
|
||||
"integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==",
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz",
|
||||
"integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
|
||||
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
@ -2453,9 +2451,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/grapheme-splitter": {
|
||||
@ -3281,9 +3279,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz",
|
||||
"integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==",
|
||||
"version": "2.0.19",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz",
|
||||
"integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/normalize-path": {
|
||||
@ -3470,9 +3468,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
@ -4010,18 +4008,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/schema-utils": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz",
|
||||
"integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz",
|
||||
"integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.9",
|
||||
"ajv": "^8.8.0",
|
||||
"ajv": "^8.9.0",
|
||||
"ajv-formats": "^2.1.1",
|
||||
"ajv-keywords": "^5.0.0"
|
||||
"ajv-keywords": "^5.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12.13.0"
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@ -4297,13 +4295,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.16.4",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.16.4.tgz",
|
||||
"integrity": "sha512-5yEGuZ3DZradbogeYQ1NaGz7rXVBDWujWlx1PT8efXO6Txn+eWbfKqB2bTDVmFXmePFkoLU6XI8UektMIEA0ug==",
|
||||
"version": "5.39.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz",
|
||||
"integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/source-map": "^0.3.2",
|
||||
"acorn": "^8.5.0",
|
||||
"@jridgewell/source-map": "^0.3.3",
|
||||
"acorn": "^8.8.2",
|
||||
"commander": "^2.20.0",
|
||||
"source-map-support": "~0.5.20"
|
||||
},
|
||||
@ -4315,16 +4313,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin": {
|
||||
"version": "5.3.6",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz",
|
||||
"integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==",
|
||||
"version": "5.3.11",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz",
|
||||
"integrity": "sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "^0.3.14",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"jest-worker": "^27.4.5",
|
||||
"schema-utils": "^3.1.1",
|
||||
"serialize-javascript": "^6.0.0",
|
||||
"terser": "^5.14.1"
|
||||
"schema-utils": "^4.3.0",
|
||||
"serialize-javascript": "^6.0.2",
|
||||
"terser": "^5.31.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
@ -4348,31 +4346,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin/node_modules/ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin/node_modules/ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"ajv": "^6.9.1"
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin/node_modules/jest-worker": {
|
||||
"version": "27.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
|
||||
@ -4387,34 +4360,10 @@
|
||||
"node": ">= 10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/terser-webpack-plugin/node_modules/schema-utils": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
||||
"integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin/node_modules/serialize-javascript": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz",
|
||||
"integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==",
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
|
||||
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
@ -4511,9 +4460,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz",
|
||||
"integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz",
|
||||
"integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@ -4523,14 +4472,18 @@
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/browserslist"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"escalade": "^3.1.1",
|
||||
"picocolors": "^1.0.0"
|
||||
"escalade": "^3.2.0",
|
||||
"picocolors": "^1.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"browserslist-lint": "cli.js"
|
||||
"update-browserslist-db": "cli.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"browserslist": ">= 4.21.0"
|
||||
@ -4677,9 +4630,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz",
|
||||
"integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
@ -4690,34 +4643,33 @@
|
||||
}
|
||||
},
|
||||
"node_modules/webpack": {
|
||||
"version": "5.75.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz",
|
||||
"integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==",
|
||||
"version": "5.98.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz",
|
||||
"integrity": "sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/eslint-scope": "^3.7.3",
|
||||
"@types/estree": "^0.0.51",
|
||||
"@webassemblyjs/ast": "1.11.1",
|
||||
"@webassemblyjs/wasm-edit": "1.11.1",
|
||||
"@webassemblyjs/wasm-parser": "1.11.1",
|
||||
"acorn": "^8.7.1",
|
||||
"acorn-import-assertions": "^1.7.6",
|
||||
"browserslist": "^4.14.5",
|
||||
"@types/eslint-scope": "^3.7.7",
|
||||
"@types/estree": "^1.0.6",
|
||||
"@webassemblyjs/ast": "^1.14.1",
|
||||
"@webassemblyjs/wasm-edit": "^1.14.1",
|
||||
"@webassemblyjs/wasm-parser": "^1.14.1",
|
||||
"acorn": "^8.14.0",
|
||||
"browserslist": "^4.24.0",
|
||||
"chrome-trace-event": "^1.0.2",
|
||||
"enhanced-resolve": "^5.10.0",
|
||||
"es-module-lexer": "^0.9.0",
|
||||
"enhanced-resolve": "^5.17.1",
|
||||
"es-module-lexer": "^1.2.1",
|
||||
"eslint-scope": "5.1.1",
|
||||
"events": "^3.2.0",
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.2.9",
|
||||
"graceful-fs": "^4.2.11",
|
||||
"json-parse-even-better-errors": "^2.3.1",
|
||||
"loader-runner": "^4.2.0",
|
||||
"mime-types": "^2.1.27",
|
||||
"neo-async": "^2.6.2",
|
||||
"schema-utils": "^3.1.0",
|
||||
"schema-utils": "^4.3.0",
|
||||
"tapable": "^2.1.1",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"watchpack": "^2.4.0",
|
||||
"terser-webpack-plugin": "^5.3.11",
|
||||
"watchpack": "^2.4.1",
|
||||
"webpack-sources": "^3.2.3"
|
||||
},
|
||||
"bin": {
|
||||
@ -4812,37 +4764,6 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webpack/node_modules/@types/estree": {
|
||||
"version": "0.0.51",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz",
|
||||
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/webpack/node_modules/ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/webpack/node_modules/ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"ajv": "^6.9.1"
|
||||
}
|
||||
},
|
||||
"node_modules/webpack/node_modules/eslint-scope": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||
@ -4865,30 +4786,6 @@
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webpack/node_modules/json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/webpack/node_modules/schema-utils": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
|
||||
"integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
"sass-loader": ">=11.0.1",
|
||||
"style": ">=0.0.3",
|
||||
"style-loader": ">=2.0.0",
|
||||
"webpack": ">=5.61.1",
|
||||
"webpack": "^5.98.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"browserslist": [
|
||||
|
||||
@ -4,6 +4,7 @@ import "../css/mycss.css";
|
||||
|
||||
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
||||
import "./listener/main_listener";
|
||||
import "./listener/devisListener";
|
||||
import { exportClientDevisByMonthAndYearToPdf } from "./modules/ajaxRequest.mjs";
|
||||
import 'select2/dist/css/select2.css';
|
||||
import 'select2';
|
||||
|
||||
@ -6,4 +6,7 @@ export const CanceledDevisMentionConstant = "CANCELED";
|
||||
|
||||
export const FactureStatusPaid = "PAID";
|
||||
export const FactureStatusPending = "PENDING";
|
||||
export const FactureStatusCanceled = "CANCELED";
|
||||
export const FactureStatusCanceled = "CANCELED";
|
||||
|
||||
export const FactureTypeSingle = "SINGLE";
|
||||
export const FactureTypeGroup = "GROUP";
|
||||
12
gestion/src/js/factureGroupDetails.js
Normal file
12
gestion/src/js/factureGroupDetails.js
Normal file
@ -0,0 +1,12 @@
|
||||
import "@nextcloud/dialogs/dist/index.css";
|
||||
import "datatables.net-dt/css/jquery.dataTables.css";
|
||||
import "../css/mycss.css";
|
||||
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
||||
import "./listener/main_listener";
|
||||
import "./listener/invoiceListener";
|
||||
|
||||
window.addEventListener("DOMContentLoaded", function () {
|
||||
globalConfiguration();
|
||||
});
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ $('body').on('click', '#closeDevisModal', function () {
|
||||
$('#devisFacturationModal').hide();
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '#invoiceQuote', function () {
|
||||
var dateValue = document.getElementById("facturationDate").value;
|
||||
var oTable = $('.tabledt').dataTable();
|
||||
@ -47,9 +48,12 @@ $('body').on('click', '#invoiceQuote', function () {
|
||||
return;
|
||||
}
|
||||
|
||||
var factureTypeSelect = document.getElementById("factureTypeSelect");
|
||||
var selectedValue = factureTypeSelect.value;
|
||||
let devisToFacturePayload = {
|
||||
devisToFacture: devisToFacture,
|
||||
paymentDate: dateValue
|
||||
paymentDate: dateValue,
|
||||
type: selectedValue
|
||||
}
|
||||
|
||||
showLoader();
|
||||
@ -70,4 +74,126 @@ $('body').on('click', '#invoiceQuote', function () {
|
||||
}).always(function () {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('body').on('click', '#showcocherparmois', function () {
|
||||
var oTable = $('.tabledt').dataTable();
|
||||
var rowcollection = oTable.$(".devisToFacture:checked", {"page": "all"});
|
||||
let devisToFacture = [];
|
||||
rowcollection.each(function(index,elem){
|
||||
var checkbox_value = $(elem).val();
|
||||
devisToFacture.push(checkbox_value);
|
||||
});
|
||||
|
||||
$('#cocherparmois').show();
|
||||
});
|
||||
$('body').on('click', '#closeDevisModal', function () {
|
||||
$('#cocherparmois').hide();
|
||||
});
|
||||
|
||||
$('body').on('click', '#cocher', function () {
|
||||
var selectedMonth = document.getElementById("monthSelect").value;
|
||||
var selectedYear = document.getElementById("yearSelect").value;
|
||||
|
||||
var oTable = $('.tabledt').DataTable();
|
||||
|
||||
var rowcollection = oTable.$(".devisToFacture", {"page": "all"}).toArray();
|
||||
|
||||
oTable.$(".devisToFacture").prop('checked', false);
|
||||
|
||||
let devisToSelect = [];
|
||||
|
||||
rowcollection.forEach(function (inputElem) {
|
||||
var dateCell = $(inputElem).closest("tr").find('.devisOrFactureInputDate');
|
||||
var dateText = dateCell.val();
|
||||
if (dateText) {
|
||||
var rowDate = new Date(dateText);
|
||||
var rowYear = rowDate.getFullYear();
|
||||
var rowMonth = rowDate.getMonth() + 1;
|
||||
|
||||
if (rowYear == selectedYear && rowMonth == selectedMonth) {
|
||||
var checkbox = $(inputElem).closest("tr").find('.devisToFacture');
|
||||
checkbox.prop('checked', true);
|
||||
devisToSelect.push(checkbox.val());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (devisToSelect.length === 0) {
|
||||
showError(t('gestion', "Aucun devis trouvé pour ce mois et cette année"));
|
||||
return;
|
||||
}
|
||||
|
||||
let devisToSelectPayload = {
|
||||
devisToFacture: devisToSelect,
|
||||
};
|
||||
|
||||
$('#cocherparmois').hide();
|
||||
});
|
||||
|
||||
document.onchange = function(event) {
|
||||
if (event.target && event.target.id === 'clientselector') {
|
||||
let selectedOption = event.target.options[event.target.selectedIndex];
|
||||
let filterType = selectedOption.getAttribute('data-type');
|
||||
let filterTypeInput = document.getElementById('filterType');
|
||||
if (filterTypeInput) {
|
||||
filterTypeInput.value = filterType;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$('body').on('click', '#showGroupDevisFacturationModal', function () {
|
||||
console.log("sdsfs");
|
||||
$('#groupDevisFacturationModal').show();
|
||||
});
|
||||
|
||||
$('body').on('click', '#closeGroupDevisModal', function () {
|
||||
$('#groupDevisFacturationModal').hide();
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '#invoiceGroupQuote', function () {
|
||||
var dateValue = document.getElementById("facturationDate").value;
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const filter = urlParams.get('cli');
|
||||
const year = urlParams.get('annee');
|
||||
const month = urlParams.get('mois');
|
||||
const filterType = urlParams.get('filterType');
|
||||
var invoiceGroupQuotePayload = {
|
||||
clientId : filter,
|
||||
month : month,
|
||||
year : year,
|
||||
clientType : filterType,
|
||||
facturationDate : dateValue
|
||||
};
|
||||
|
||||
showLoader();
|
||||
|
||||
$.ajax({
|
||||
url: baseUrl + '/devis/exportGroupOfDevisIntoFacture',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(invoiceGroupQuotePayload)
|
||||
}).done(function (response) {
|
||||
var fileNames = response;
|
||||
if(fileNames != null){
|
||||
let fileNamesArray = JSON.parse(fileNames);
|
||||
if(fileNamesArray.length > 0){
|
||||
fileNamesArray.forEach((filename) => {
|
||||
showSuccess('Sauvegardé dans' + filename);
|
||||
})
|
||||
$('#groupDevisFacturationModal').hide();
|
||||
}
|
||||
else{
|
||||
showError(t('gestion', "Les données pour sauvegarde sont vides"));
|
||||
}
|
||||
}
|
||||
else{
|
||||
showError(t('gestion', "Les données pour sauvegarde sont vides"));
|
||||
}
|
||||
}).fail(function (response, code) {
|
||||
showError(t('gestion', "Erreur dans la génération de facture multiple"));
|
||||
}).always(function () {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
|
||||
@ -2,6 +2,7 @@ import {showError, showSuccess } from "@nextcloud/dialogs";
|
||||
import {baseUrl, hideLoader, showLoader} from "../modules/mainFunction.mjs";
|
||||
import { Facture } from "../objects/facture.mjs";
|
||||
import DataTable from "datatables.net";
|
||||
import { generateUrl } from "@nextcloud/router";
|
||||
window.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
const today = new Date();
|
||||
@ -128,4 +129,10 @@ document.onchange = function(event) {
|
||||
filterTypeInput.value = filterType;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$('body').on('click', '.goToDevisDetails', function () {
|
||||
let devisId = $(this).data('devis-id');
|
||||
let url = generateUrl(`/apps/gestion/devis/${devisId}/show`);
|
||||
window.location.href = url;
|
||||
});
|
||||
@ -60,6 +60,9 @@ document.body.addEventListener('click', e => {
|
||||
else if(e.target.className.includes("selectClientGroupList")){
|
||||
ClientGroup.loadClientGroupListToSelect(e);
|
||||
}
|
||||
else if(e.target.className.includes("selectClientTemplateTypes")){
|
||||
ClientGroupFacturation.loadClientTemplateTypesIntoSelect(e);
|
||||
}
|
||||
else if(e.target.className.includes("selectClientGroupFacturationList")){
|
||||
ClientGroupFacturation.loadClientGroupFacturationListToSelect(e);
|
||||
}
|
||||
@ -126,7 +129,7 @@ document.body.addEventListener('click', e => {
|
||||
console.log(url);
|
||||
window.location.replace(url);
|
||||
} else if("apercusDevis" === e.target.id) {
|
||||
window.location.replace(generateUrl(`/apps/gestion/devis/apercus?cli=&annee=${(new Date()).getFullYear()}&mois=${(new Date()).getMonth()}`));
|
||||
window.location.replace(generateUrl(`/apps/gestion/devis/apercus?cli=&annee=${(new Date()).getFullYear()}&mois=${(new Date()).getMonth()}&filterType=group`));
|
||||
} else if("newArticle" === e.target.id) {
|
||||
Article.newArticle(new DataTable('.tabledt'));
|
||||
} else if("newDefunt" == e.target.id) {
|
||||
|
||||
@ -1,23 +1,52 @@
|
||||
import { showError } from "@nextcloud/dialogs";
|
||||
import { baseUrl, checkSelectPurJs, LoadDT, showDone } from "../modules/mainFunction.mjs";
|
||||
import {
|
||||
baseUrl,
|
||||
checkSelectPurJs,
|
||||
LoadDT,
|
||||
showDone,
|
||||
} from "../modules/mainFunction.mjs";
|
||||
import { updateDB } from "../modules/ajaxRequest.mjs";
|
||||
|
||||
export class ClientGroupFacturation {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param myresp instantiate client group facturation object
|
||||
*/
|
||||
constructor(myresp) {
|
||||
this.id = myresp.id;
|
||||
this.clientGroupFacturationName = ((myresp.group_facturation_name.length === 0) ? '-' : myresp.group_facturation_name);
|
||||
this.phoneNumber = (myresp.phone_number != null && myresp.phone_number.length > 0) ? myresp.phone_number : '-';
|
||||
this.address = (myresp.address != null && myresp.address.length > 0) ? myresp.address : '-';
|
||||
this.postalCode = (myresp.postal_code != null && myresp.postal_code.length > 0) ? myresp.postal_code : '-';
|
||||
this.city = (myresp.city != null && myresp.city.length > 0) ? myresp.city : '-';
|
||||
this.email = (myresp.email != null && myresp.email.length > 0) ? myresp.email : '-';
|
||||
this.siretNumber = (myresp.siret_number != null && myresp.siret_number.length > 0) ? myresp.siret_number : '-';
|
||||
this.tvaIntraCommu = (myresp.tva_intracommu != null && myresp.tva_intracommu.length > 0) ? myresp.tva_intracommu : '-';
|
||||
this.clientGroupFacturationName =
|
||||
myresp.group_facturation_name.length === 0
|
||||
? "-"
|
||||
: myresp.group_facturation_name;
|
||||
this.phoneNumber =
|
||||
myresp.phone_number != null && myresp.phone_number.length > 0
|
||||
? myresp.phone_number
|
||||
: "-";
|
||||
this.address =
|
||||
myresp.address != null && myresp.address.length > 0
|
||||
? myresp.address
|
||||
: "-";
|
||||
this.postalCode =
|
||||
myresp.postal_code != null && myresp.postal_code.length > 0
|
||||
? myresp.postal_code
|
||||
: "-";
|
||||
this.city =
|
||||
myresp.city != null && myresp.city.length > 0 ? myresp.city : "-";
|
||||
this.email =
|
||||
myresp.email != null && myresp.email.length > 0 ? myresp.email : "-";
|
||||
this.siretNumber =
|
||||
myresp.siret_number != null && myresp.siret_number.length > 0
|
||||
? myresp.siret_number
|
||||
: "-";
|
||||
this.tvaIntraCommu =
|
||||
myresp.tva_intracommu != null && myresp.tva_intracommu.length > 0
|
||||
? myresp.tva_intracommu
|
||||
: "-";
|
||||
this.templateTypeKey =
|
||||
myresp.fk_template_type_key != null &&
|
||||
myresp.fk_template_type_key.length > 0
|
||||
? myresp.fk_template_type_key
|
||||
: "-";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -25,120 +54,231 @@ export class ClientGroupFacturation {
|
||||
*/
|
||||
getDTRow() {
|
||||
let clientGroupFacturationRow = [
|
||||
'<div>' + this.id + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="group_facturation_name" data-id="' + this.id + '">' + this.clientGroupFacturationName + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="address" data-id="' + this.id + '">' + this.address + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="city" data-id="' + this.id + '">' + this.city + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="postal_code" data-id="' + this.id + '">' + this.postalCode + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="email" data-id="' + this.id + '">' + this.email + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="phone_number" data-id="' + this.id + '">' + this.phoneNumber + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="siret_number" data-id="' + this.id + '">' + this.siretNumber + '</div>',
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="tva_intracommu" data-id="' + this.id + '">' + this.tvaIntraCommu + '</div>',
|
||||
'<div data-modifier="clientGroupFacturation" data-id=' + this.id + ' data-table="client_group_facturation" style="display:inline-block;margin-right:0px;" class="deleteItem icon-delete"></div>'
|
||||
"<div>" + this.id + "</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="group_facturation_name" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.clientGroupFacturationName +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="address" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.address +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="city" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.city +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="postal_code" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.postalCode +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="email" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.email +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="phone_number" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.phoneNumber +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="siret_number" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.siretNumber +
|
||||
"</div>",
|
||||
'<div class="editable" data-table="client_group_facturation" data-column="tva_intracommu" data-id="' +
|
||||
this.id +
|
||||
'">' +
|
||||
this.tvaIntraCommu +
|
||||
"</div>",
|
||||
'<div class="selectClientTemplateTypes" data-table="client_group_facturation" data-column="fk_template_type_key" data-id="' +
|
||||
this.id +
|
||||
'" data-current="' +
|
||||
this.templateTypeKey +
|
||||
'">' +
|
||||
this.templateTypeKey +
|
||||
"</div>",
|
||||
'<div data-modifier="clientGroupFacturation" data-id=' +
|
||||
this.id +
|
||||
' data-table="client_group_facturation" style="display:inline-block;margin-right:0px;" class="deleteItem icon-delete"></div>',
|
||||
];
|
||||
|
||||
return clientGroupFacturationRow;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} clientGroupFacturationDatatable
|
||||
*
|
||||
* @param {*} clientGroupFacturationDatatable
|
||||
*/
|
||||
static loadClientGroupFacturationDatatable(clientGroupFacturationDatatable) {
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open('PROPFIND', baseUrl + '/client/getClientGroupFacturations', true);
|
||||
oReq.open("PROPFIND", baseUrl + "/client/getClientGroupFacturations", true);
|
||||
oReq.setRequestHeader("Content-Type", "application/json");
|
||||
oReq.onload = function(e){
|
||||
oReq.onload = function (e) {
|
||||
if (this.status == 200) {
|
||||
LoadDT(clientGroupFacturationDatatable, JSON.parse(this.response), ClientGroupFacturation);
|
||||
}else{
|
||||
LoadDT(
|
||||
clientGroupFacturationDatatable,
|
||||
JSON.parse(this.response),
|
||||
ClientGroupFacturation
|
||||
);
|
||||
} else {
|
||||
showError(this.response);
|
||||
}
|
||||
};
|
||||
oReq.send();
|
||||
}
|
||||
|
||||
static getClientGroupFacturations(callback){
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open('PROPFIND', baseUrl + '/client/getClientGroupFacturations', true);
|
||||
oReq.setRequestHeader("Content-Type", "application/json");
|
||||
oReq.onload = function(e){
|
||||
if (this.status == 200) {
|
||||
callback(JSON.parse(this.response));
|
||||
}else{
|
||||
showError(this.response);
|
||||
}
|
||||
};
|
||||
oReq.send();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} lid
|
||||
*/
|
||||
static loadClientGroupFacturationListToSelect(e){
|
||||
ClientGroupFacturation.getClientGroupFacturations(response => {
|
||||
|
||||
var selectElement = document.createElement("select");
|
||||
selectElement.dataset.current = e.target.dataset.current;
|
||||
selectElement.dataset.id = e.target.dataset.id;
|
||||
selectElement.dataset.old = e.target.innerHTML;
|
||||
|
||||
selectElement.addEventListener("change", el=>{
|
||||
if(el.target.value != 0){
|
||||
updateDB(el.target.parentElement.dataset.table,
|
||||
el.target.parentElement.dataset.column,
|
||||
el.target.value,
|
||||
el.target.parentElement.dataset.id
|
||||
);
|
||||
|
||||
// location.reload();
|
||||
|
||||
var parentElement = el.target.parentElement
|
||||
parentElement.innerHTML = el.target.options[el.target.selectedIndex].text;
|
||||
parentElement.dataset.current = el.target.value;
|
||||
}else{
|
||||
var parentElement = el.target.parentElement
|
||||
parentElement.innerHTML = el.target.dataset.old
|
||||
}
|
||||
});
|
||||
|
||||
var option = document.createElement("option");
|
||||
option.value = 0;
|
||||
option.text = t('gestion', 'Cancel');
|
||||
selectElement.appendChild(option);
|
||||
|
||||
JSON.parse(response).forEach(myresp => {
|
||||
var txt = document.createElement("textarea");
|
||||
txt.innerHTML = myresp.group_facturation_name;
|
||||
var option = document.createElement("option");
|
||||
option.value = myresp.id;
|
||||
option.text = txt.value;
|
||||
selectElement.appendChild(option);
|
||||
});
|
||||
|
||||
checkSelectPurJs(selectElement);
|
||||
|
||||
e.target.innerHTML = ''
|
||||
e.target.appendChild(selectElement);
|
||||
});
|
||||
static getClientGroupFacturations(callback) {
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open("PROPFIND", baseUrl + "/client/getClientGroupFacturations", true);
|
||||
oReq.setRequestHeader("Content-Type", "application/json");
|
||||
oReq.onload = function (e) {
|
||||
if (this.status == 200) {
|
||||
callback(JSON.parse(this.response));
|
||||
} else {
|
||||
showError(this.response);
|
||||
}
|
||||
};
|
||||
oReq.send();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} dt
|
||||
*
|
||||
* @param {*} lid
|
||||
*/
|
||||
static loadClientGroupFacturationListToSelect(e) {
|
||||
ClientGroupFacturation.getClientGroupFacturations((response) => {
|
||||
var selectElement = document.createElement("select");
|
||||
selectElement.dataset.current = e.target.dataset.current;
|
||||
selectElement.dataset.id = e.target.dataset.id;
|
||||
selectElement.dataset.old = e.target.innerHTML;
|
||||
|
||||
selectElement.addEventListener("change", (el) => {
|
||||
if (el.target.value != 0) {
|
||||
updateDB(
|
||||
el.target.parentElement.dataset.table,
|
||||
el.target.parentElement.dataset.column,
|
||||
el.target.value,
|
||||
el.target.parentElement.dataset.id
|
||||
);
|
||||
|
||||
// location.reload();
|
||||
|
||||
var parentElement = el.target.parentElement;
|
||||
parentElement.innerHTML =
|
||||
el.target.options[el.target.selectedIndex].text;
|
||||
parentElement.dataset.current = el.target.value;
|
||||
} else {
|
||||
var parentElement = el.target.parentElement;
|
||||
parentElement.innerHTML = el.target.dataset.old;
|
||||
}
|
||||
});
|
||||
|
||||
var option = document.createElement("option");
|
||||
option.value = 0;
|
||||
option.text = t("gestion", "Cancel");
|
||||
selectElement.appendChild(option);
|
||||
|
||||
JSON.parse(response).forEach((myresp) => {
|
||||
var txt = document.createElement("textarea");
|
||||
txt.innerHTML = myresp.group_facturation_name;
|
||||
var option = document.createElement("option");
|
||||
option.value = myresp.id;
|
||||
option.text = txt.value;
|
||||
selectElement.appendChild(option);
|
||||
});
|
||||
|
||||
checkSelectPurJs(selectElement);
|
||||
|
||||
e.target.innerHTML = "";
|
||||
e.target.appendChild(selectElement);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} dt
|
||||
*/
|
||||
static createDefaultClientGroupFacturation(dt) {
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open('POST', baseUrl + '/client/createDefaultClientGroupFacturation', true);
|
||||
oReq.onload = function(e){
|
||||
oReq.open(
|
||||
"POST",
|
||||
baseUrl + "/client/createDefaultClientGroupFacturation",
|
||||
true
|
||||
);
|
||||
oReq.onload = function (e) {
|
||||
if (this.status == 200) {
|
||||
showDone()
|
||||
showDone();
|
||||
ClientGroupFacturation.loadClientGroupFacturationDatatable(dt);
|
||||
}else{
|
||||
} else {
|
||||
showError(this.response);
|
||||
}
|
||||
};
|
||||
oReq.send();
|
||||
}
|
||||
|
||||
static getClientTemplateTypes(callback) {
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open("PROPFIND", baseUrl + "/client/getClientTemplateTypes", true);
|
||||
oReq.setRequestHeader("Content-Type", "application/json");
|
||||
oReq.onload = function (e) {
|
||||
if (this.status == 200) {
|
||||
callback(JSON.parse(this.response));
|
||||
} else {
|
||||
showError(this.response);
|
||||
}
|
||||
};
|
||||
oReq.send();
|
||||
}
|
||||
|
||||
static loadClientTemplateTypesIntoSelect(e) {
|
||||
ClientGroupFacturation.getClientTemplateTypes((response) => {
|
||||
var selectElement = document.createElement("select");
|
||||
selectElement.dataset.current = e.target.dataset.current;
|
||||
selectElement.dataset.id = e.target.dataset.id;
|
||||
selectElement.dataset.old = e.target.innerHTML;
|
||||
|
||||
selectElement.addEventListener("change", (el) => {
|
||||
if (el.target.value != "") {
|
||||
updateDB(
|
||||
el.target.parentElement.dataset.table,
|
||||
el.target.parentElement.dataset.column,
|
||||
el.target.value,
|
||||
el.target.parentElement.dataset.id
|
||||
);
|
||||
|
||||
var parentElement = el.target.parentElement;
|
||||
parentElement.innerHTML =
|
||||
el.target.options[el.target.selectedIndex].text;
|
||||
parentElement.dataset.current = el.target.value;
|
||||
} else {
|
||||
var parentElement = el.target.parentElement;
|
||||
parentElement.innerHTML = el.target.dataset.old;
|
||||
}
|
||||
});
|
||||
|
||||
var option = document.createElement("option");
|
||||
option.value = "";
|
||||
option.text = t("gestion", "Cancel");
|
||||
selectElement.appendChild(option);
|
||||
|
||||
JSON.parse(response).forEach((myresp) => {
|
||||
var txt = document.createElement("textarea");
|
||||
txt.innerHTML = myresp.template_type_key;
|
||||
var option = document.createElement("option");
|
||||
option.value = myresp.template_type_key;
|
||||
option.text = txt.value;
|
||||
selectElement.appendChild(option);
|
||||
});
|
||||
|
||||
checkSelectPurJs(selectElement);
|
||||
|
||||
e.target.innerHTML = "";
|
||||
e.target.appendChild(selectElement);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import { showError } from "@nextcloud/dialogs";
|
||||
import { generateUrl } from "@nextcloud/router";
|
||||
import { baseUrl, LoadDT, showDone } from "../modules/mainFunction.mjs";
|
||||
import { Devis } from "./devis.mjs";
|
||||
import { FactureTypeSingle } from "../constants/invoiceConstant.js";
|
||||
|
||||
export class Facture {
|
||||
|
||||
@ -32,6 +33,13 @@ export class Facture {
|
||||
paymentDate = paymentDate.toLocaleDateString("fr-FR");
|
||||
}
|
||||
this.payment_date = paymentDate;
|
||||
this.factureType = myresp.facture_type;
|
||||
if(this.factureType == FactureTypeSingle){
|
||||
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/show`);
|
||||
}
|
||||
else{
|
||||
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/groupDetails`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,143 +3,199 @@
|
||||
<form method="get" class="d-flex flex-row align-items-center">
|
||||
<select name="cli" id="clientselector">
|
||||
<?php
|
||||
foreach ($_['clients'] as $key => $client) {
|
||||
?>
|
||||
<option <?php if(strcmp($_GET['cli'],$client->id)==0) echo 'selected' ?> value='<?php echo $client->id; ?>'><?php echo html_entity_decode($client->prenom).' '.html_entity_decode($client->nom); ?></option>
|
||||
<?php
|
||||
foreach ($_['clients'] as $key => $client) {
|
||||
?>
|
||||
<option <?php
|
||||
if ($_GET['cli'] == $client->id && $_GET['filterType'] == $client->client_type) {
|
||||
echo 'selected';
|
||||
}
|
||||
?> value='<?php echo $client->id; ?>' data-type='<?php echo $client->client_type ?>'>
|
||||
<?php echo strtoupper(html_entity_decode($client->nom)); ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<select name="annee" id="yearselector">
|
||||
<option value="-1" <?php if ((int)$_GET['annee'] == -1) echo 'selected' ?>>Toutes les années</option>
|
||||
<?php
|
||||
$currentYear = date('Y');
|
||||
for ($year = $currentYear; $year >= $currentYear - 10; $year--) {
|
||||
echo '<option value="' . $year . '"';
|
||||
if ((int)$_GET['annee'] == $year) echo ' selected';
|
||||
echo '>' . $year . '</option>';
|
||||
}
|
||||
<option value="-1" <?php if ((int) $_GET['annee'] == -1)
|
||||
echo 'selected' ?>>Toutes les années</option>
|
||||
<?php
|
||||
$currentYear = date('Y');
|
||||
for ($year = $currentYear; $year >= $currentYear - 10; $year--) {
|
||||
echo '<option value="' . $year . '" ' . ((int) $_GET['annee'] == $year ? 'selected' : '') . '>' . $year . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<select name="mois" id="monthselector">
|
||||
<option value="0" <?php if((int) $_GET['mois'] == 0) echo 'selected' ?>>Tous les mois</option>
|
||||
<option value="1" <?php if((int) $_GET['mois'] == 1) echo 'selected' ?>>Janvier</option>
|
||||
<option value="2" <?php if((int) $_GET['mois'] == 2) echo 'selected' ?>>Fevrier</option>
|
||||
<option value="3" <?php if((int) $_GET['mois'] == 3) echo 'selected' ?>>Mars</option>
|
||||
<option value="4" <?php if((int) $_GET['mois'] == 4) echo 'selected' ?>>Avril</option>
|
||||
<option value="5" <?php if((int) $_GET['mois'] == 5) echo 'selected' ?>>Mai</option>
|
||||
<option value="6" <?php if((int) $_GET['mois'] == 6) echo 'selected' ?>>Juin</option>
|
||||
<option value="7" <?php if((int) $_GET['mois'] == 7) echo 'selected' ?>>Juillet</option>
|
||||
<option value="8" <?php if((int) $_GET['mois'] == 8) echo 'selected' ?>>Août</option>
|
||||
<option value="9" <?php if((int) $_GET['mois'] == 9) echo 'selected' ?>>Septembre</option>
|
||||
<option value="10" <?php if((int) $_GET['mois'] == 10) echo 'selected' ?>>Octobre</option>
|
||||
<option value="11" <?php if((int) $_GET['mois'] == 11) echo 'selected' ?>>Novembre</option>
|
||||
<option value="12" <?php if((int) $_GET['mois'] == 12) echo 'selected' ?>>Decembre</option>
|
||||
</select>
|
||||
<input type="submit" value="Filtrer"/>
|
||||
<option value="0" <?php if ((int) $_GET['mois'] == 0)
|
||||
echo 'selected' ?>>Tous les mois</option>
|
||||
<option value="1" <?php if ((int) $_GET['mois'] == 1)
|
||||
echo 'selected' ?>>Janvier</option>
|
||||
<option value="2" <?php if ((int) $_GET['mois'] == 2)
|
||||
echo 'selected' ?>>Fevrier</option>
|
||||
<option value="3" <?php if ((int) $_GET['mois'] == 3)
|
||||
echo 'selected' ?>>Mars</option>
|
||||
<option value="4" <?php if ((int) $_GET['mois'] == 4)
|
||||
echo 'selected' ?>>Avril</option>
|
||||
<option value="5" <?php if ((int) $_GET['mois'] == 5)
|
||||
echo 'selected' ?>>Mai</option>
|
||||
<option value="6" <?php if ((int) $_GET['mois'] == 6)
|
||||
echo 'selected' ?>>Juin</option>
|
||||
<option value="7" <?php if ((int) $_GET['mois'] == 7)
|
||||
echo 'selected' ?>>Juillet</option>
|
||||
<option value="8" <?php if ((int) $_GET['mois'] == 8)
|
||||
echo 'selected' ?>>Août</option>
|
||||
<option value="9" <?php if ((int) $_GET['mois'] == 9)
|
||||
echo 'selected' ?>>Septembre</option>
|
||||
<option value="10" <?php if ((int) $_GET['mois'] == 10)
|
||||
echo 'selected' ?>>Octobre</option>
|
||||
<option value="11" <?php if ((int) $_GET['mois'] == 11)
|
||||
echo 'selected' ?>>Novembre</option>
|
||||
<option value="12" <?php if ((int) $_GET['mois'] == 12)
|
||||
echo 'selected' ?>>Decembre</option>
|
||||
</select>
|
||||
<input type="hidden" name="filterType" id="filterType"
|
||||
value="<?php echo ($_GET['filterType'] ?? 'group'); ?>">
|
||||
<input type="submit" value="Filtrer" />
|
||||
</form>
|
||||
<div class="d-flex flex-row">
|
||||
<?php
|
||||
$clients = $_['clients'];
|
||||
if($_SERVER['REQUEST_METHOD'] == 'GET') {
|
||||
$devis = array_filter($_['devis'], function($d) {
|
||||
if($d->cid){
|
||||
$datesplit = explode("-", $d->date);
|
||||
$year = (int) $datesplit[0];
|
||||
$month = (int) $datesplit[1];
|
||||
$checkClient = false;
|
||||
if(strcmp($_GET['cli'], '')==0){
|
||||
$checkClient = $_['clients'][0]->id == $d->cid;
|
||||
} else {
|
||||
$checkClient = ((int) $_GET['cli']) == $d->cid;
|
||||
}
|
||||
$checkYear = ((int) ($_GET['annee']) == -1)?(true):($year==((int) $_GET['annee']));
|
||||
$checkMounth = (((int) $_GET['mois']) == 0)? (true): ($month==((int) $_GET['mois']));
|
||||
return $checkClient && $checkYear && $checkMounth;
|
||||
$clients = $_['clients'];
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
|
||||
$devis = array_filter($_['devis'], function ($currentDevis) {
|
||||
if ($currentDevis->cid) {
|
||||
$datesplit = explode("-", $currentDevis->date);
|
||||
$year = (int) $datesplit[0];
|
||||
$month = (int) $datesplit[1];
|
||||
$checkClient = false;
|
||||
$filterType = "group";
|
||||
if (array_key_exists('filterType', $_GET) && $_GET['filterType'] == 'client') {
|
||||
$filterType = "client";
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if(strcmp($_GET['cli'], '')!=0 && sizeof($devis)>0) {
|
||||
?>
|
||||
<button class="btn btn-secondary" type="button" id="exportMultipleDevisToPdf"><?php p($l->t('Save in Nextcloud'));?></button>
|
||||
<?php
|
||||
$clientIsNotSelected = strcmp($_GET['cli'], '') == 0;
|
||||
if ($clientIsNotSelected) {
|
||||
if ($filterType == "group") {
|
||||
$checkClient = $_['clients'][0]->fk_client_group_facturation_id == $currentDevis->cid;
|
||||
} else {
|
||||
$checkClient = $_['clients'][0]->id == $currentDevis->cid;
|
||||
}
|
||||
} else {
|
||||
if ($filterType == "group") {
|
||||
$checkClient = $currentDevis->fk_client_group_facturation_id == $_GET['cli'];
|
||||
} else {
|
||||
$checkClient = $currentDevis->cid == $_GET['cli'];
|
||||
}
|
||||
}
|
||||
$checkYear = ((int) ($_GET['annee']) == -1) ? (true) : ($year == ((int) $_GET['annee']));
|
||||
$checkMounth = (((int) $_GET['mois']) == 0) ? (true) : ($month == ((int) $_GET['mois']));
|
||||
return $checkClient && $checkYear && $checkMounth;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (strcmp($_GET['cli'], '') != 0 && sizeof($devis) > 0) {
|
||||
?>
|
||||
<button class="btn btn-secondary" type="button"
|
||||
id="exportMultipleDevisToPdf"><?php p($l->t('Save in Nextcloud')); ?></button>
|
||||
<button class="btn btn-secondary" type="button" id="showGroupDevisFacturationModal" data-toggle="modal"
|
||||
data-target="#groupDevisFacturationModal">
|
||||
Facturer
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="gestion-canvas" class="canvas_div_pdf">
|
||||
<?php
|
||||
if($_SERVER['REQUEST_METHOD'] == 'GET' && strcmp($_GET['cli'], '')!=0) {
|
||||
if(sizeof($devis)==0) echo "Aucun devis trouvé.";
|
||||
};
|
||||
|
||||
foreach ($devis as $key => $d) {
|
||||
?>
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'GET' && strcmp($_GET['cli'], '') != 0) {
|
||||
if (sizeof($devis) == 0)
|
||||
echo "Aucun devis trouvé.";
|
||||
}
|
||||
;
|
||||
|
||||
foreach ($devis as $key => $d) {
|
||||
?>
|
||||
<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>
|
||||
<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>
|
||||
</h2>
|
||||
<hr/>
|
||||
<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>
|
||||
<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>
|
||||
</h2>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-5 h-100 m-0" style="min-height:250px;">
|
||||
<?php $res = json_decode($_['configuration'])[0]; ?>
|
||||
<h5 class="p-3 m-0 text-dark text-center border border-2 border-dark"><?php p($l->t('FROM'));?> <?php echo $res->entreprise; ?></h5>
|
||||
<p class="p-3 m-0 h-auto text-center text-dark text-center border border-top-0 border-2 border-dark">
|
||||
<h5 class="p-3 m-0 text-dark text-center border border-2 border-dark"><?php p($l->t('FROM')); ?>
|
||||
<?php echo $res->entreprise; ?></h5>
|
||||
<p
|
||||
class="p-3 m-0 h-auto text-center text-dark text-center border border-top-0 border-2 border-dark">
|
||||
<?php echo $res->prenom . " " . $res->nom; ?><br />
|
||||
<?php echo $res->adresse; ?><br />
|
||||
<?php echo $res->mail; ?><br />
|
||||
<?php echo $res->telephone; ?><br/>
|
||||
<?php echo $res->telephone; ?><br />
|
||||
<span id="nothing"></span><br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-2 h-100 m-0" style="min-height:250px;">
|
||||
<?php
|
||||
if(isset($_['logo']) && $_['logo'] !== "nothing"){
|
||||
echo "<center><a><img alt='".$l->t('Company logo')."' class=\"img-fluid\" src=\"data:image/png;base64, ".$_['logo']."\"/></a></center>";
|
||||
}else{
|
||||
echo "<span style='font-size:12px' id='Company-logo' data-html2canvas-ignore><b><center>".$l->t('You can add your company logo here.')."</center></b><br/><i>".$l->t('To add a logo, drop the logo.png file in ".gestion" folder at the root of your Nextcloud Files app. Remember to set "Show hidden files".')."</i><br/><br/><center>".$l->t('This message will not appear on generated PDF.')."</center></span>";
|
||||
}
|
||||
if (isset($_['logo']) && $_['logo'] !== "nothing") {
|
||||
echo "<center><a><img alt='" . $l->t('Company logo') . "' class=\"img-fluid\" src=\"data:image/png;base64, " . $_['logo'] . "\"/></a></center>";
|
||||
} else {
|
||||
echo "<span style='font-size:12px' id='Company-logo' data-html2canvas-ignore><b><center>" . $l->t('You can add your company logo here.') . "</center></b><br/><i>" . $l->t('To add a logo, drop the logo.png file in ".gestion" folder at the root of your Nextcloud Files app. Remember to set "Show hidden files".') . "</i><br/><br/><center>" . $l->t('This message will not appear on generated PDF.') . "</center></span>";
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
<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 />
|
||||
<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 class="pdf" style="display: none"><?php echo $d->entreprise."_".$d->id."_v".$d->version?></span>
|
||||
</p>
|
||||
<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>
|
||||
<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 />
|
||||
<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 class="pdf"
|
||||
style="display: none"><?php echo $d->entreprise . "_" . $d->id . "_v" . $d->version ?></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col col-md">
|
||||
<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>
|
||||
<hr/>
|
||||
<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>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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> <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>
|
||||
<span>Date de soin :
|
||||
<b><?php echo (new DateTime($d->date))->format('d-m-Y'); ?></b>,</span> <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>
|
||||
</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>
|
||||
<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 />
|
||||
</div>
|
||||
</div>
|
||||
@ -147,12 +203,12 @@
|
||||
<table id="produits" data-type="facture" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php p($l->t('Reference'));?></th>
|
||||
<th><?php p($l->t('Designation'));?></th>
|
||||
<th><?php p($l->t('Comment'));?></th>
|
||||
<th><?php p($l->t('Quantity'));?></th>
|
||||
<th><?php p($l->t('Unit price without VAT'));?></th>
|
||||
<th><?php p($l->t('Total without VAT'));?></th>
|
||||
<th><?php p($l->t('Reference')); ?></th>
|
||||
<th><?php p($l->t('Designation')); ?></th>
|
||||
<th><?php p($l->t('Comment')); ?></th>
|
||||
<th><?php p($l->t('Quantity')); ?></th>
|
||||
<th><?php p($l->t('Unit price without VAT')); ?></th>
|
||||
<th><?php p($l->t('Total without VAT')); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -162,8 +218,9 @@
|
||||
<td><?php echo $produit->description ?></td>
|
||||
<td><?php echo $produit->comment ?></td>
|
||||
<td><?php echo $produit->quantite ?></td>
|
||||
<td>€<?php echo number_format($produit->prix_unitaire, 2) ?></td>
|
||||
<td>€<?php echo number_format($produit->prix_unitaire*$produit->quantite, 2) ?></td>
|
||||
<td>€<?php echo number_format($produit->prix_unitaire, 2) ?></td>
|
||||
<td>€<?php echo number_format($produit->prix_unitaire * $produit->quantite, 2) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
@ -173,23 +230,23 @@
|
||||
<table id="totaldevis" class="table table-striped table-xl">
|
||||
<thead class="bg-dark text-white">
|
||||
<tr>
|
||||
<th class="text-center"><?php p($l->t('Total without VAT'));?></th>
|
||||
<th class="text-center"><?php p($l->t('VAT Rate'));?></th>
|
||||
<th class="text-center"><?php p($l->t('Total VAT'));?></th>
|
||||
<th class="text-center"><?php p($l->t('Total Price'));?></th>
|
||||
<th class="text-center"><?php p($l->t('Total without VAT')); ?></th>
|
||||
<th class="text-center"><?php p($l->t('VAT Rate')); ?></th>
|
||||
<th class="text-center"><?php p($l->t('Total VAT')); ?></th>
|
||||
<th class="text-center"><?php p($l->t('Total Price')); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$totalhtc = 0;
|
||||
$tva = json_decode($_['configuration'])[0]->tva_default;
|
||||
$totalttc = 0;
|
||||
$totalprice = 0;
|
||||
foreach ($d->dproduits as $key => $produit) {
|
||||
$totalhtc = $totalhtc + ($produit->quantite*$produit->prix_unitaire);
|
||||
}
|
||||
$totalttc = ($totalhtc * $tva)/100;
|
||||
$totalprice = $totalhtc + $totalttc;
|
||||
<?php
|
||||
$totalhtc = 0;
|
||||
$tva = json_decode($_['configuration'])[0]->tva_default;
|
||||
$totalttc = 0;
|
||||
$totalprice = 0;
|
||||
foreach ($d->dproduits as $key => $produit) {
|
||||
$totalhtc = $totalhtc + ($produit->quantite * $produit->prix_unitaire);
|
||||
}
|
||||
$totalttc = ($totalhtc * $tva) / 100;
|
||||
$totalprice = $totalhtc + $totalttc;
|
||||
?>
|
||||
<tr>
|
||||
<td>€<?php echo number_format($totalhtc, 2) ?></td>
|
||||
@ -203,19 +260,36 @@
|
||||
</div>
|
||||
<div class="d-flex flex-column w-100">
|
||||
<div class="col m-0 pb-0 alert alert-info text-center">
|
||||
<p><span id="mentions_default"><?php p($l->t('Please set in global configuration'));?></span></p>
|
||||
<p><span id="mentions_default"><?php p($l->t('Please set in global configuration')); ?></span></p>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="col m-0 pb-0 alert alert-info text-center">
|
||||
<p><?php echo $res->entreprise; ?><br /><?php echo $res->adresse; ?><br /><?php echo $res->legal_one; ?><br/><?php echo $res->legal_two; ?></p>
|
||||
<p><?php echo $res->entreprise; ?><br /><?php echo $res->adresse; ?><br /><?php echo $res->legal_one; ?><br /><?php echo $res->legal_two; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr data-html2canvas-ignore>
|
||||
<hr data-html2canvas-ignore>
|
||||
<hr data-html2canvas-ignore>
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="modal" id="groupDevisFacturationModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Choisir la date de facturation souhaitée</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="date" id="facturationDate">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="closeGroupDevisModal" type="button" class="btn btn-secondary">Annuler</button>
|
||||
<button id="invoiceGroupQuote" type="button" class="btn btn-primary">Facturer</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -23,6 +23,7 @@
|
||||
<th><?php p($l->t('Téléphone'));?></th>
|
||||
<th><?php p($l->t('Siret'));?></th>
|
||||
<th><?php p($l->t('Tva Intra-communautaire'));?></th>
|
||||
<th><?php p($l->t('Modèle de facture'));?></th>
|
||||
<th><?php p($l->t('Actions'));?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -18,6 +18,10 @@
|
||||
Facturer
|
||||
</button>
|
||||
<button class="btn btn-secondary" id="apercusDevis">Voir les aperçus</button>
|
||||
</button>
|
||||
<button id="showcocherparmois" class="btn btn-secondary" data-toggle="modal" data-target="#cocherparmois">
|
||||
Cocher par mois
|
||||
</button>
|
||||
</div>
|
||||
<!-- <div class="d-flex justify-content-between">
|
||||
<div class="d-flex flex-column">
|
||||
@ -57,6 +61,10 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="date" id="facturationDate">
|
||||
<select id="factureTypeSelect" name="type">
|
||||
<option value="SINGLE" selected>Simple</option>
|
||||
<option value="GROUP">Groupé</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="closeDevisModal" type="button" class="btn btn-secondary">Annuler</button>
|
||||
@ -65,4 +73,46 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="cocherparmois" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Choisir le mois de facturation souhaité</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<select class="form-select w-auto" name="month" id="monthSelect">
|
||||
<option value="1">Janvier</option>
|
||||
<option value="2">Février</option>
|
||||
<option value="3">Mars</option>
|
||||
<option value="4">Avril</option>
|
||||
<option value="5">Mai</option>
|
||||
<option value="6">Juin</option>
|
||||
<option value="7">Juillet</option>
|
||||
<option value="8">Août</option>
|
||||
<option value="9">Septembre</option>
|
||||
<option value="10">Octobre</option>
|
||||
<option value="11">Novembre</option>
|
||||
<option value="12">Décembre</option>
|
||||
</select>
|
||||
<select class="form-select w-auto" name="year" id="yearSelect">
|
||||
<?php
|
||||
$currentYear = date('Y');
|
||||
for ($year = $currentYear; $year >= $currentYear - 10; $year--) {
|
||||
echo '<option value="' . $year . '"';
|
||||
echo '>' . $year . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="closeDevisModal" type="button" class="btn btn-secondary">Annuler</button>
|
||||
<button id="cocher" type="button" class="btn btn-primary">Cocher</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
141
gestion/templates/content/factureGroupDetails.php
Normal file
141
gestion/templates/content/factureGroupDetails.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
use OC\URLGenerator;
|
||||
use OCA\Gestion\Helpers\PriceHelpers;
|
||||
$facture = $_['facture'];
|
||||
$factureOrderNumber = $facture->facture_order_number == '' ? '-' : $facture->facture_order_number;
|
||||
$factureCaseNumber = $facture->facture_case_number == '' ? '-' : $facture->facture_case_number;
|
||||
$isFactureClientGroup = $facture->isFactureClientGroup;
|
||||
$currentConfig = json_decode($_['configuration'])[0];
|
||||
?>
|
||||
<div class="bootstrap-iso">
|
||||
<div id="factureId" data-id="<?php echo $facture->id; ?>"></div>
|
||||
<div id="factureIdentifier" data-id="<?php echo $facture->id; ?>"></div>
|
||||
<h2 class="mt-3 mb-3 text-center"> <?php echo ('Facture n° '.$facture->num); ?>
|
||||
</h2>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<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('FROM')); ?>
|
||||
<?php echo $currentConfig->entreprise; ?></h5>
|
||||
<p style="min-height:180px;"
|
||||
class="p-3 m-0 h-100 text-center text-dark text-center border border-top-0 border-2 border-dark">
|
||||
<?php echo $currentConfig->prenom . " " . $currentConfig->nom; ?><br />
|
||||
<?php echo $currentConfig->adresse; ?><br />
|
||||
<?php echo $currentConfig->mail; ?><br />
|
||||
<?php echo $currentConfig->telephone; ?><br />
|
||||
<span id="nothing"></span><br />
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-2 h-100 m-0" style="min-height:250px;">
|
||||
<?php
|
||||
if (isset($_['logo']) && $_['logo'] !== "nothing") {
|
||||
echo "<center><a><img alt='" . $l->t('Company logo') . "' class=\"img-fluid\" src=\"data:image/png;base64, " . $_['logo'] . "\"/></a></center>";
|
||||
} else {
|
||||
echo "<span style='font-size:12px' id='Company-logo' data-html2canvas-ignore><b><center>" . $l->t('You can add your company logo here.') . "</center></b><br/><i>" . $l->t('To add a logo, drop the logo.png file in ".gestion" folder at the root of your Nextcloud Files app. Remember to set "Show hidden files".') . "</i><br/><br/><center>" . $l->t('This message will not appear on generated PDF.') . "</center></span>";
|
||||
}
|
||||
?>
|
||||
</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><?php echo $facture->group_name; ?></span></h5>
|
||||
<p style="min-height:180px;"
|
||||
class="p-3 m-0 h-100 text-center text-dark text-center border border-top-0 border-2 border-dark">
|
||||
<span><?php echo $facture->group_name; ?></span><br />
|
||||
<?php if($isFactureClientGroup == false){
|
||||
?>
|
||||
<span><?php echo $facture->client_name; ?></span><br />
|
||||
<?php }?>
|
||||
<span><?php echo $facture->client_address; ?></span><br />
|
||||
<span><?php echo $facture->mail; ?></span><br />
|
||||
<span><?php echo $facture->siret; ?></span><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col col-md">
|
||||
<label class="fw-bold">Commande :</label>
|
||||
<div class="col col-xl mb-3 text-center editable" style="display:inline" data-table="facture"
|
||||
data-column="facture_order_number" data-id="<?php echo $facture->id; ?>">
|
||||
<?php echo $factureOrderNumber; ?>
|
||||
</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="facture"
|
||||
data-column="facture_case_number" data-id="<?php echo $facture->id; ?>">
|
||||
<?php echo $factureCaseNumber; ?>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="factureGroupId" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php p($l->t('Devis')); ?></th>
|
||||
<th><?php p($l->t('Defunt')); ?></th>
|
||||
<th><?php p($l->t('Agence')); ?></th>
|
||||
<th><?php p($l->t('Prix HT')); ?></th>
|
||||
<th><?php p($l->t('Prix TTC')); ?></th>
|
||||
<th><?php p($l->t('Actions')); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$devisList = $facture->devisList;
|
||||
foreach ($devisList as $currentDevis) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $currentDevis->devis_full_number; ?></td>
|
||||
<td><?php echo $currentDevis->defunt_nom; ?></td>
|
||||
<td><?php echo $currentDevis->client_nom; ?></td>
|
||||
<td><?php echo PriceHelpers::formatDecimalPrice($currentDevis->totalHt).'€'; ?></td>
|
||||
<td><?php echo PriceHelpers::formatDecimalPrice($currentDevis->totalTtc).'€'; ?></td>
|
||||
<td>
|
||||
<div style="display:inline-block;margin-right:0px;width:80%;">
|
||||
<button class="goToDevisDetails" data-devis-id="<?php echo $currentDevis->devis_id; ?>">Ouvrir</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<button id="exportFactureToPdf" type="button" class="mb-2 btn btn-outline-success" data-html2canvas-ignore data-name=""><?php p($l->t('Save in Nextcloud'));?></button>
|
||||
<button id="mailGestion" type="button" class="mb-2 btn btn-outline-success sendmail" data-html2canvas-ignore data-name=""><?php p($l->t('Send by email'));?></button>
|
||||
</div>
|
||||
<div class="mt-0 table-responsive">
|
||||
<table id="totalFactureGroupPrice" class="table table-striped table-xl">
|
||||
<thead class="bg-dark text-white">
|
||||
<tr>
|
||||
<th class="text-center"><?php p($l->t('Total without VAT')); ?></th>
|
||||
<th class="text-center"><?php p($l->t('VAT Rate')); ?></th>
|
||||
<th class="text-center"><?php p($l->t('Total VAT')); ?></th>
|
||||
<th class="text-center"><?php p($l->t('Total Price')); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo (PriceHelpers::formatDecimalPrice($facture->totalHt).'€'); ?></td>
|
||||
<td class="text-center"><?php echo (PriceHelpers::formatDecimalPrice($currentConfig->tva_default).'€'); ?></td>
|
||||
<td class="text-center"><?php echo (PriceHelpers::formatDecimalPrice($facture->totalTva).'€'); ?></td>
|
||||
<td class="text-center"><?php echo (PriceHelpers::formatDecimalPrice($facture->totalTtc).'€'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col m-0 pb-0 alert alert-info text-center">
|
||||
<p><span id="mentions_default"><?php p($l->t('Please set in global configuration')); ?></span></p>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="col m-0 pb-0 alert alert-info text-center">
|
||||
<p><?php echo $currentConfig->entreprise; ?><br /><?php echo $currentConfig->adresse; ?><br /><?php echo $currentConfig->legal_one; ?><br /><?php echo $currentConfig->legal_two; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
18
gestion/templates/factureGroupDetails.php
Normal file
18
gestion/templates/factureGroupDetails.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
style('gestion', array('style'));
|
||||
script('gestion', array('factureGroupDetails.app', '814.app', '856.app'));
|
||||
?>
|
||||
<div id="app">
|
||||
<div id="app-navigation">
|
||||
<?php print_unescaped($this->inc('navigation/index')); ?>
|
||||
<?php print_unescaped($this->inc('settings/index')); ?>
|
||||
</div>
|
||||
|
||||
<div id="app-content">
|
||||
<div id="app-content-wrapper">
|
||||
<?php print_unescaped($this->inc('content/changelog')); ?>
|
||||
<?php print_unescaped($this->inc('content/factureGroupDetails')); ?>
|
||||
<?php print_unescaped($this->inc('loader')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -31,6 +31,7 @@ module.exports =
|
||||
clientGroup: './src/js/clientGroup.js',
|
||||
clientGroupFacturation : './src/js/clientGroupFacturation.js',
|
||||
pdf: './src/js/pdf.js',
|
||||
factureGroupDetails: './src/js/factureGroupDetails.js'
|
||||
},
|
||||
output: {
|
||||
filename: '../js/[name].app.js',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user