diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 9525f63b722..023b2049ee9 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -3721,11 +3721,14 @@ else if ($id > 0 || ! empty($ref))
$bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref;
$bankaccountstatic->number = $objp->banumber;
- $bankaccountstatic->account_number = $objp->account_number;
- $accountingjournal = new AccountingJournal($db);
- $accountingjournal->fetch($objp->fk_accountancy_journal);
- $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
+ if (! empty($conf->accounting->enabled)) {
+ $bankaccountstatic->account_number = $objp->account_number;
+
+ $accountingjournal = new AccountingJournal($db);
+ $accountingjournal->fetch($objp->fk_accountancy_journal);
+ $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
+ }
print '
';
if ($bankaccountstatic->id)
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index f930ad87979..838e5cf25c0 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -8,7 +8,7 @@
* Copyright (C) 2013-2015 Philippe Grand
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014-2016 Marcos GarcĂa
- * Copyright (C) 2016 Alexandre Spangaro
+ * Copyright (C) 2016-2017 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -49,6 +49,7 @@ if (!empty($conf->projet->enabled)) {
if (!empty($conf->variants->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
}
+if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
$langs->load('bills');
@@ -2317,7 +2318,7 @@ else
$sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
$sql.= ' c.id as paiement_type,';
$sql.= ' pf.amount,';
- $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label';
+ $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
@@ -2365,6 +2366,16 @@ else
$bankaccountstatic->id=$objp->baid;
$bankaccountstatic->ref=$objp->baref;
$bankaccountstatic->label=$objp->baref;
+ $bankaccountstatic->number = $objp->banumber;
+
+ if (! empty($conf->accounting->enabled)) {
+ $bankaccountstatic->account_number = $objp->account_number;
+
+ $accountingjournal = new AccountingJournal($db);
+ $accountingjournal->fetch($objp->fk_accountancy_journal);
+ $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
+ }
+
print '| ';
if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions');
print ' | ';
|