Skip to content

Commit

Permalink
Merge branch '20.0' of [email protected]:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 18, 2024
2 parents 8ef33b0 + 6d5e42b commit 7fef62e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
8 changes: 6 additions & 2 deletions htdocs/core/boxes/box_factures_fourn_imp.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public function loadBox($max = 5)

$langs->load("bills");

$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidSupplierBills", $this->max));
$textHead = $langs->trans("BoxTitleOldestUnpaidSupplierBills");
$this->info_box_head = array(
'text' => $langs->trans("BoxTitleOldestUnpaidSupplierBills", $this->max).'<a class="paddingleft valignmiddle" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&sortfield=f.date_lim_reglement,f.ref&sortorder=ASC,ASC"><span class="badge">...</span></a>',
'limit' => dol_strlen($textHead)
);

if ($user->hasRight('fournisseur', 'facture', 'lire')) {
$sql1 = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
Expand Down Expand Up @@ -105,7 +109,7 @@ public function loadBox($max = 5)
$sql3 = " GROUP BY s.rowid, s.nom, s.name_alias, s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,";
$sql3 .= " f.rowid, f.ref, f.ref_supplier, f.date_lim_reglement,";
$sql3 .= " f.type, f.datef, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.fk_statut, f.tms";
$sql3 .= " ORDER BY datelimite DESC, f.ref_supplier DESC ";
$sql3 .= " ORDER BY datelimite ASC, f.ref_supplier ASC";
$sql3 .= $this->db->plimit($this->max + 1, 0);

$sql = $sql1.$sql2.$sql3;
Expand Down
28 changes: 17 additions & 11 deletions htdocs/core/boxes/box_factures_imp.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function loadBox($max = 5)

$textHead = $langs->trans("BoxTitleOldestUnpaidCustomerBills");
$this->info_box_head = array(
'text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $this->max).'<a class="paddingleft valignmiddle" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?sortfield=f.tms&sortorder=DESC"><span class="badge">...</span></a>',
'text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $this->max).'<a class="paddingleft valignmiddle" href="'.DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&sortfield=f.date_lim_reglement,f.ref&sortorder=ASC,ASC"><span class="badge">...</span></a>',
'limit' => dol_strlen($textHead));

if ($user->hasRight('facture', 'lire')) {
Expand Down Expand Up @@ -124,7 +124,7 @@ public function loadBox($max = 5)
}
$sql3 .= " f.rowid, f.ref, f.date_lim_reglement,";
$sql3 .= " f.type, f.datef, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.fk_statut";
$sql3 .= " ORDER BY datelimite ASC, f.ref ASC ";
$sql3 .= " ORDER BY datelimite ASC, f.ref ASC";
$sql3 .= $this->db->plimit($this->max + 1, 0);

$sql = $sql1.$sql2.$sql3;
Expand All @@ -140,20 +140,25 @@ public function loadBox($max = 5)
$objp = $this->db->fetch_object($result);

$datelimite = $this->db->jdate($objp->datelimite);
$date = $this->db->jdate($objp->date);
$datem = $this->db->jdate($objp->tms);
$datelimit = $this->db->jdate(datelimite);

$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$facturestatic->date = $date;
$facturestatic->date_lim_reglement = $datelimit;
$facturestatic->statut = $objp->status;
$facturestatic->status = $objp->status;
$facturestatic->date = $this->db->jdate($objp->date);
$facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite);

$facturestatic->paye = $objp->paye;
$facturestatic->paid = $objp->paye;
$facturestatic->alreadypaid = $objp->am;
$facturestatic->totalpaid = $objp->am;

$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
Expand All @@ -166,12 +171,13 @@ public function loadBox($max = 5)
$societestatic->email = $objp->email;
$societestatic->entity = $objp->entity;
$societestatic->tva_intra = $objp->tva_intra;
$societestatic->idprof1 = $objp->idprof1;
$societestatic->idprof2 = $objp->idprof2;
$societestatic->idprof3 = $objp->idprof3;
$societestatic->idprof4 = $objp->idprof4;
$societestatic->idprof5 = $objp->idprof5;
$societestatic->idprof6 = $objp->idprof6;

$societestatic->idprof1 = !empty($objp->idprof1) ? $objp->idprof1 : '';
$societestatic->idprof2 = !empty($objp->idprof2) ? $objp->idprof2 : '';
$societestatic->idprof3 = !empty($objp->idprof3) ? $objp->idprof3 : '';
$societestatic->idprof4 = !empty($objp->idprof4) ? $objp->idprof4 : '';
$societestatic->idprof5 = !empty($objp->idprof5) ? $objp->idprof5 : '';
$societestatic->idprof6 = !empty($objp->idprof6) ? $objp->idprof6 : '';

$late = '';
if ($facturestatic->hasDelay()) {
Expand Down Expand Up @@ -204,7 +210,7 @@ public function loadBox($max = 5)

$this->info_box_contents[$line][] = array(
'td' => 'class="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $objp->am),
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $objp->am, $objp->type),
);

$line++;
Expand Down

0 comments on commit 7fef62e

Please sign in to comment.