diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index ab6f0f5e574..3595de67759 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -35,6 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
if (!empty($conf->banque->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
+if (!empty($conf->margin->enabled)) {
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
+}
// Load translation files required by the page
$langs->loadLangs(array('bills', 'banks', 'companies'));
@@ -359,10 +362,15 @@ if ($resql) {
print '
';
print '| '.$langs->trans('Bill').' | ';
+
print ''.$langs->trans('Company').' | ';
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
print ''.$langs->trans('Entity').' | ';
}
+ //Add Margin
+ if (!empty($conf->margin->enabled)) {
+ print ''.$langs->trans('Margin').' | ';
+ }
print ''.$langs->trans('ExpectedToPay').' | ';
print ''.$langs->trans('PayedByThisPayment').' | ';
print ''.$langs->trans('RemainderToPay').' | ';
@@ -378,6 +386,14 @@ if ($resql) {
$invoice = new Facture($db);
$invoice->fetch($objp->facid);
+ // Add Margin
+ if (!empty($conf->margin->enabled)) {
+ $formmargin = new FormMargin($db);
+ $marginInfo = array();
+ $invoice->fetch_lines();
+ $marginInfo = $formmargin->getMarginInfosArray($invoice);
+ }
+
$paiement = $invoice->getSommePaiement();
$creditnotes = $invoice->getSumCreditNotesUsed();
$deposits = $invoice->getSumDepositsUsed();
@@ -403,6 +419,12 @@ if ($resql) {
print $mc->label;
print '';
}
+
+ // Add margin
+ if (!empty($conf->margin->enabled)) {
+ print ''.price($marginInfo['total_margin']).' | ';
+ }
+
// Expected to pay
print ''.price($objp->total_ttc).' | ';