finish facture document generated date and document_sent_date, wip sent facture
This commit is contained in:
parent
528afe379e
commit
741368b12b
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
@ -356,6 +356,8 @@ class Bdd {
|
||||
.$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."facture.document_generated_date as facture_document_generated_date, "
|
||||
.$this->tableprefix."facture.document_sent_date as facture_document_sent_date, "
|
||||
.$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, "
|
||||
@ -4503,4 +4505,24 @@ class Bdd {
|
||||
$facture["isFactureClientGroup"] = !$isFactureSingleClient;
|
||||
return $facture;
|
||||
}
|
||||
|
||||
public function setFactureGeneratedDate($factureId){
|
||||
$datetimeNow = new Datetime();
|
||||
$dateNow = $datetimeNow->format("Y-m-d");
|
||||
$sql = "UPDATE ".$this->tableprefix."facture set document_generated_date = ? WHERE id = ?";
|
||||
$this->execSQLNoData($sql,[
|
||||
$dateNow,
|
||||
$factureId
|
||||
]);
|
||||
}
|
||||
|
||||
public function setFactureSentDate($factureId){
|
||||
$datetimeNow = new Datetime();
|
||||
$dateNow = $datetimeNow->format("Y-m-d");
|
||||
$sql = "UPDATE ".$this->tableprefix."facture set document_sent_date = ? WHERE id = ?";
|
||||
$this->execSQLNoData($sql,[
|
||||
$dateNow,
|
||||
$factureId
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,6 +112,7 @@ class InvoicePdfService {
|
||||
$file_pdf->putContent($pdfContent);
|
||||
$filenames[] = $ff_pdf;
|
||||
}
|
||||
$this->gestionBdd->setFactureGeneratedDate($factureId);
|
||||
return $filenames;
|
||||
}
|
||||
|
||||
@ -195,6 +196,7 @@ class InvoicePdfService {
|
||||
$file_pdf->putContent($pdfContent);
|
||||
$filenames[] = $ff_pdf;
|
||||
}
|
||||
$this->gestionBdd->setFactureGeneratedDate($factureId);
|
||||
return $filenames;
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,20 @@ export class Facture {
|
||||
else{
|
||||
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/groupDetails`);
|
||||
}
|
||||
const isDocumentAlreadyGenerated = myresp.facture_document_generated_date != null;
|
||||
const isDocumentAlreadySent = myresp.facture_document_sent_date != null;
|
||||
this.isDocumentAlreadyGeneratedLabel = this.getDocumentStateLabel(isDocumentAlreadyGenerated);
|
||||
this.isDocumentAlreadySentLabel = this.getDocumentStateLabel(isDocumentAlreadySent);
|
||||
this.isDocumentAlreadyGeneratedClass = this.getDocumentStateClass(isDocumentAlreadyGenerated);
|
||||
this.isDocumentAlreadySentClass = this.getDocumentStateClass(isDocumentAlreadySent);
|
||||
}
|
||||
|
||||
getDocumentStateLabel(documentState){
|
||||
return documentState ? "Oui" : "Non";
|
||||
}
|
||||
|
||||
getDocumentStateClass(documentState){
|
||||
return documentState ? "text-bg-success" : "text-bg-warning";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,6 +72,8 @@ export class Facture {
|
||||
'<div>' + this.factureProduits + '</div>',
|
||||
'<div>' + this.status_paiement + '</div>',
|
||||
'<div>' + this.payment_date + '</div>',
|
||||
'<div><span class="badge '+this.isDocumentAlreadyGeneratedClass+'">' + this.isDocumentAlreadyGeneratedLabel + '</span></div>',
|
||||
'<div><span class="badge '+this.isDocumentAlreadySentClass+'">' + this.isDocumentAlreadySentLabel + '</span></div>',
|
||||
'<div style="display:inline-block;margin-right:0px;width:80%;"><a href="' + this.baseUrl +'"><button>' + t('gestion', 'Open') + '</button></a></div><div data-modifier="facture" data-id=' + this.id + ' data-table="facture" style="display:inline-block;margin-right:0px;" class="deleteItem icon-delete"></div>',
|
||||
];
|
||||
return myrow;
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
<th><?php p($l->t('Articles'));?></th>
|
||||
<th><?php p($l->t('Status'));?></th>
|
||||
<th><?php p($l->t('Date de paiement'));?></th>
|
||||
<th><?php p($l->t('Généré'));?></th>
|
||||
<th><?php p($l->t('Envoyé au client'));?></th>
|
||||
<th><?php p($l->t('Actions'));?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user