Skip to content

Commit

Permalink
New box comm card (#30220)
Browse files Browse the repository at this point in the history
* hook retour completeListOfReferent

* box comm card.php

* commit
  • Loading branch information
atm-jonathan authored Jul 3, 2024
1 parent be87065 commit 3ddd6cc
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions htdocs/comm/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,9 @@
// print $formfile->getDocumentsLink($contrat->element, $filename, $filedir);
print $late;
print "</td>\n";
print '<td class="nowrap">'.dol_trunc($objp->refsup, 12)."</td>\n";
print '<td class="nowrap">';
print dol_trunc(strtolower(get_class($object)) == strtolower(Client::class) ? $objp->refcus : $objp->refsup, 12);
print "</td>\n";
//print '<td class="right" width="80px"><span title="'.$langs->trans("DateCreation").'">'.dol_print_date($db->jdate($objp->dc), 'day')."</span></td>\n";
print '<td class="right" width="80px"><span title="'.$langs->trans("DateContract").'">'.dol_print_date($db->jdate($objp->dcon), 'day')."</span></td>\n";
print '<td width="20">&nbsp;</td>';
Expand Down Expand Up @@ -1422,7 +1424,7 @@
* Latest invoices
*/
if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) {
$sql = 'SELECT f.rowid as facid, f.ref, f.type';
$sql = 'SELECT f.rowid as facid, f.ref, f.type, f.ref_client';
$sql .= ', f.total_ht';
$sql .= ', f.total_tva';
$sql .= ', f.total_ttc';
Expand Down Expand Up @@ -1452,6 +1454,9 @@
if (getDolGlobalString('MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES')) {
$colspan++;
}
if (getDolGlobalString('MAIN_SHOW_REF_CUSTOMER_INVOICES')) {
$colspan++;
}
print '<td colspan="'.$colspan.'">';
print '<table class="centpercent nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans("AllBills").'</span><span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
Expand All @@ -1466,6 +1471,7 @@

$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->ref_client = $objp->ref_client;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
Expand Down Expand Up @@ -1511,6 +1517,11 @@
// $urlsource = '/compta/facture/card.php?id='.$objp->cid;
//print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';
if (getDolGlobalString('MAIN_SHOW_REF_CUSTOMER_INVOICES')) {
print '<td class="left nowraponall">';
print $objp->ref_client;
print '</td>';
}
if ($objp->df > 0) {
print '<td width="80px" title="'.dol_escape_htmltag($langs->trans('DateInvoice')).'">'.dol_print_date($db->jdate($objp->df), 'day').'</td>';
} else {
Expand All @@ -1521,6 +1532,7 @@
} else {
print '<td><b>!!!</b></td>';
}

print '<td class="right nowraponall">';
print price($objp->total_ht);
print '</td>';
Expand Down

0 comments on commit 3ddd6cc

Please sign in to comment.