Merge branch 'fixes/fix-show-client-group-on-facture-list' into staging
This commit is contained in:
commit
646479f871
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
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
@ -1129,7 +1129,7 @@ class PageController extends Controller {
|
|||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function getFacturesWithProduits() {
|
public function getFacturesWithProduits() {
|
||||||
$result = $this->myDb->getFacturesWithProduits($this->idNextcloud);
|
$result = $this->myDb->getFacturesWithProduits();
|
||||||
$this->refreshFEC();
|
$this->refreshFEC();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -349,6 +349,57 @@ class Bdd {
|
|||||||
return json_encode($result);
|
return json_encode($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFacturesListWithDependencies(){
|
||||||
|
$sql = "SELECT
|
||||||
|
facture.id,
|
||||||
|
facture.user_id,
|
||||||
|
facture.num,
|
||||||
|
facture.date,
|
||||||
|
facture.fk_facture_status_key,
|
||||||
|
facture.fk_facture_payment_type_id,
|
||||||
|
facture.payment_date,
|
||||||
|
facture_payment_type.facture_payment_type_label,
|
||||||
|
facture_status.facture_status_label,
|
||||||
|
facture.facture_type,
|
||||||
|
facture.fk_client_id as facture_client_id,
|
||||||
|
facture.fk_client_group_facturation_id as facture_client_group_facturation_id,
|
||||||
|
facture.date_paiement,
|
||||||
|
facture.type_paiement,
|
||||||
|
facture.id_devis,
|
||||||
|
facture.version,
|
||||||
|
facture.status_paiement,
|
||||||
|
facture_client.nom as facture_client_name,
|
||||||
|
facture_client_group_facturation.group_facturation_name as facture_group_name,
|
||||||
|
devis.num as dnum,
|
||||||
|
devis.comment as dcomment,
|
||||||
|
client.entreprise,
|
||||||
|
client.nom,
|
||||||
|
client.prenom,
|
||||||
|
client.id as id_cli,
|
||||||
|
client.entreprise as client_entreprise,
|
||||||
|
client.fk_client_group_facturation_id as fk_client_group_facturation_id,
|
||||||
|
client.adresse as adresse_cli,client.mail as mail_cli,
|
||||||
|
client.telephone as telephone_cli,client.legal_one as legalone_cli,
|
||||||
|
client.fk_client_group_id as fk_client_group_id,
|
||||||
|
defunt.id as id_defunt,
|
||||||
|
defunt.nom as nom_defunt,
|
||||||
|
lieu.id as lid,
|
||||||
|
lieu.nom as lieu,
|
||||||
|
lieu.adresse as adresse_soin,devis.id_lieu
|
||||||
|
FROM ".$this->tableprefix."facture as facture
|
||||||
|
LEFT JOIN ".$this->tableprefix."devis as devis on facture.id_devis = devis.id
|
||||||
|
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.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."facture_payment_type as facture_payment_type on facture.fk_facture_payment_type_id = facture_payment_type.id
|
||||||
|
LEFT JOIN ".$this->tableprefix."facture_status as facture_status on facture.fk_facture_status_key = facture_status.facture_status_key
|
||||||
|
LEFT JOIN ".$this->tableprefix."client as facture_client on facture.fk_client_id = facture_client.id
|
||||||
|
LEFT JOIN ".$this->tableprefix."client_group_facturation as facture_client_group_facturation on facture.fk_client_group_facturation_id = facture_client_group_facturation.id
|
||||||
|
ORDER BY facture.id DESC, facture.date_paiement DESC";
|
||||||
|
$result = $this->execSQL($sql, array());
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
public function getFactures($idNextcloud){
|
public function getFactures($idNextcloud){
|
||||||
$sql = "SELECT ".$this->tableprefix."facture.id, ".$this->tableprefix."facture.user_id, ".$this->tableprefix."facture.num, ".$this->tableprefix."facture.date, "
|
$sql = "SELECT ".$this->tableprefix."facture.id, ".$this->tableprefix."facture.user_id, ".$this->tableprefix."facture.num, ".$this->tableprefix."facture.date, "
|
||||||
.$this->tableprefix."facture.fk_facture_status_key, ".$this->tableprefix."facture.fk_facture_payment_type_id, ".$this->tableprefix."facture.payment_date, "
|
.$this->tableprefix."facture.fk_facture_status_key, ".$this->tableprefix."facture.fk_facture_payment_type_id, ".$this->tableprefix."facture.payment_date, "
|
||||||
@ -378,8 +429,8 @@ class Bdd {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFacturesWithProduits($idNextCloud){
|
public function getFacturesWithProduits(){
|
||||||
$factures = $this->getFactures($idNextCloud);
|
$factures = $this->getFacturesListWithDependencies();
|
||||||
$facturesList = json_decode($factures);
|
$facturesList = json_decode($factures);
|
||||||
foreach($facturesList as $currentFacture){
|
foreach($facturesList as $currentFacture){
|
||||||
$produits = $this->getProduitsDevisByDevisId($currentFacture->id_devis);
|
$produits = $this->getProduitsDevisByDevisId($currentFacture->id_devis);
|
||||||
|
|||||||
@ -34,12 +34,23 @@ export class Facture {
|
|||||||
}
|
}
|
||||||
this.payment_date = paymentDate;
|
this.payment_date = paymentDate;
|
||||||
this.factureType = myresp.facture_type;
|
this.factureType = myresp.facture_type;
|
||||||
if(this.factureType == FactureTypeSingle){
|
const isFactureSingle = this.factureType == FactureTypeSingle;
|
||||||
|
if(isFactureSingle){
|
||||||
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/show`);
|
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/show`);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/groupDetails`);
|
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/groupDetails`);
|
||||||
}
|
}
|
||||||
|
this.clientName = this.nom;
|
||||||
|
if(isFactureSingle == false){
|
||||||
|
const isFactureClientWithoutGroup = myresp.facture_client_id != null && myresp.facture_client_id != 0;
|
||||||
|
if(isFactureClientWithoutGroup){
|
||||||
|
this.clientName = ((myresp.facture_client_name == null || myresp.facture_client_name.length == 0) ? '-' : myresp.facture_client_name);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.clientName = ((myresp.facture_group_name == null || myresp.facture_group_name.length == 0) ? '-' : myresp.facture_group_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,7 +65,7 @@ export class Facture {
|
|||||||
'<input style="margin:0;padding:0;" class="inputDate devisOrFactureInputDate" type="date" value=' + this.date_paiement + ' data-table="facture" data-column="date_paiement" data-id="' + this.id + '"/>',
|
'<input style="margin:0;padding:0;" class="inputDate devisOrFactureInputDate" type="date" value=' + this.date_paiement + ' data-table="facture" data-column="date_paiement" data-id="' + this.id + '"/>',
|
||||||
'<div>' + this.type_paiement + '</div>',
|
'<div>' + this.type_paiement + '</div>',
|
||||||
'<div class="selectAvailableDevis" data-table="facture" data-column="id_devis" data-id="' + this.id + '" data-current="' + this.id_devis + '">' + this.nom_defunt + ' | <span style="font-size: 0.7rem">' + this.prenom + ' ' + this.nom + '</span></div>',
|
'<div class="selectAvailableDevis" data-table="facture" data-column="id_devis" data-id="' + this.id + '" data-current="' + this.id_devis + '">' + this.nom_defunt + ' | <span style="font-size: 0.7rem">' + this.prenom + ' ' + this.nom + '</span></div>',
|
||||||
'<div>' + this.nom + '</div>',
|
'<div>' + this.clientName + '</div>',
|
||||||
'<div>' + this.factureProduits + '</div>',
|
'<div>' + this.factureProduits + '</div>',
|
||||||
'<div>' + this.status_paiement + '</div>',
|
'<div>' + this.status_paiement + '</div>',
|
||||||
'<div>' + this.payment_date + '</div>',
|
'<div>' + this.payment_date + '</div>',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user