|
@@ -27,9 +27,9 @@ require '../main.inc.php';
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
|
|
-if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
|
|
-if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
|
|
-if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
|
|
+if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
|
|
+if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
|
|
+if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
|
|
|
|
|
// L'espace compta/treso doit toujours etre actif car c'est un espace partage
|
|
|
// par de nombreux modules (banque, facture, commande a facturer, etc...) independamment
|
|
@@ -40,7 +40,7 @@ if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/
|
|
|
|
|
|
$langs->load("compta");
|
|
|
$langs->load("bills");
|
|
|
-if ($conf->commande->enabled) $langs->load("orders");
|
|
|
+if (! empty($conf->commande->enabled)) $langs->load("orders");
|
|
|
|
|
|
// Security check
|
|
|
$socid='';
|
|
@@ -349,7 +349,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastCustomerBills",$max).'</td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
|
|
print '<td width="16"> </td>';
|
|
@@ -388,7 +388,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
$thirdpartystatic->client=1;
|
|
|
print $thirdpartystatic->getNomUrl(1,'customer',44);
|
|
|
print '</td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
|
|
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
|
|
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
|
|
|
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
|
|
@@ -404,7 +404,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
else
|
|
|
{
|
|
|
$colspan=5;
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
|
|
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
|
|
}
|
|
|
print '</table><br>';
|
|
@@ -446,7 +446,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastSupplierBills",$max).'</td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
|
|
print '<td width="16"> </td>';
|
|
@@ -469,7 +469,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
$thirdpartystatic->fournisseur=1;
|
|
|
print $thirdpartystatic->getNomUrl(1,'supplier',44);
|
|
|
print '</td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
|
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
|
|
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
|
|
|
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
|
|
@@ -484,7 +484,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
else
|
|
|
{
|
|
|
$colspan=5;
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
|
|
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
|
|
}
|
|
|
print '</table><br>';
|
|
@@ -742,7 +742,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
print "<tr class=\"liste_titre\">";
|
|
|
print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?status=3&afacturer=1">('.$num.')</a></td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("ToBill").'</td>';
|
|
|
print '<td align="center" width="16"> </td>';
|
|
@@ -781,7 +781,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|
|
$societestatic->client=1;
|
|
|
print $societestatic->getNomUrl(1,'customer',44);
|
|
|
print '</a></td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
|
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
|
|
print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
|
|
|
print '<td>'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).'</td>';
|
|
@@ -795,7 +795,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|
|
}
|
|
|
|
|
|
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($tot_ht).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($tot_ht).'</td>';
|
|
|
print '<td align="right">'.price($tot_ttc).'</td>';
|
|
|
print '<td align="right">'.price($tot_tobill).'</td>';
|
|
|
print '<td> </td>';
|
|
@@ -840,7 +840,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">('.$num.')</a></td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("Received").'</td>';
|
|
|
print '<td width="16"> </td>';
|
|
@@ -880,7 +880,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
$societestatic->client=1;
|
|
|
print $societestatic->getNomUrl(1,'customer',44);
|
|
|
print '</a></td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
|
|
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
|
|
print '<td align="right">'.price($obj->am).'</td>';
|
|
|
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
|
|
@@ -894,7 +894,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
}
|
|
|
|
|
|
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
|
|
|
print '<td align="right">'.price($total_ttc).'</td>';
|
|
|
print '<td align="right">'.price($totalam).'</td>';
|
|
|
print '<td> </td>';
|
|
@@ -903,7 +903,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
|
else
|
|
|
{
|
|
|
$colspan=5;
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
|
|
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
|
|
}
|
|
|
print '</table><br>';
|
|
@@ -944,7 +944,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php">('.$num.')</a></td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
|
|
print '<td align="right">'.$langs->trans("Paid").'</td>';
|
|
|
print '<td width="16"> </td>';
|
|
@@ -967,7 +967,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
$societestatic->nom=$obj->nom;
|
|
|
$societestatic->client=0;
|
|
|
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
|
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
|
|
print '<td align="right">'.price($obj->am).'</td>';
|
|
|
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
|
|
@@ -980,7 +980,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
}
|
|
|
|
|
|
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>';
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
|
|
|
print '<td align="right">'.price($total_ttc).'</td>';
|
|
|
print '<td align="right">'.price($totalam).'</td>';
|
|
|
print '<td> </td>';
|
|
@@ -989,7 +989,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
|
else
|
|
|
{
|
|
|
$colspan=5;
|
|
|
- if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
|
|
|
+ if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
|
|
|
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
|
|
|
}
|
|
|
print '</table><br>';
|