|
@@ -101,7 +101,7 @@ print '</span></td></tr></table></div><br>';
|
|
|
/*
|
|
|
* Invoices waiting for withdraw
|
|
|
*/
|
|
|
-$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
|
|
|
+$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut as status, f.paye, f.type,";
|
|
|
$sql .= " pfd.date_demande, pfd.amount,";
|
|
|
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
|
@@ -141,10 +141,13 @@ if ($resql) {
|
|
|
|
|
|
$invoicestatic->id = $obj->rowid;
|
|
|
$invoicestatic->ref = $obj->ref;
|
|
|
- $invoicestatic->statut = $obj->fk_statut;
|
|
|
+ $invoicestatic->statut = $obj->status;
|
|
|
+ $invoicestatic->status = $obj->status;
|
|
|
$invoicestatic->paye = $obj->paye;
|
|
|
$invoicestatic->type = $obj->type;
|
|
|
- $alreadypayed = $invoicestatic->getSommePaiement();
|
|
|
+ $totalallpayments = $invoicestatic->getSommePaiement(0);
|
|
|
+ $totalallpayments += $invoicestatic->getSumCreditNotesUsed(0);
|
|
|
+ $totalallpayments += $invoicestatic->getSumDepositsUsed(0);
|
|
|
|
|
|
$thirdpartystatic->id = $obj->socid;
|
|
|
$thirdpartystatic->name = $obj->name;
|
|
@@ -177,7 +180,7 @@ if ($resql) {
|
|
|
print '</td>';
|
|
|
|
|
|
print '<td class="right">';
|
|
|
- print $invoicestatic->getLibStatut(3, $alreadypayed);
|
|
|
+ print $invoicestatic->getLibStatut(3, $totalallpayments);
|
|
|
print '</td>';
|
|
|
print '</tr>';
|
|
|
$i++;
|