diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index e89f8ceb9b4..1743a60714d 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -627,6 +627,7 @@ if ($action == 'create') {
if (isModEnabled('accounting')) {
print '
| '.$langs->trans("AccountancyCode").' | ';
print '';
+ print img_picto('', 'accounting_account', 'class="pictofixedwidth"');
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
if ($formaccounting->nbaccounts == 0) {
$langs->load("errors");
@@ -1081,7 +1082,13 @@ if ($action == 'create') {
print ' |
| '.$langs->trans("AccountancyCode").' | ';
print '';
if (isModEnabled('accounting')) {
+ print img_picto('', 'accounting_account', 'class="pictofixedwidth"');
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
+ if ($formaccounting->nbaccounts == 0) {
+ $langs->load("errors");
+ $htmltext = $langs->transnoentitiesnoconv("WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Chartofaccounts"));
+ print $form->textwithpicto('', $htmltext);
+ }
} else {
print 'account_number).'">';
}
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index 12868ff1bb3..2a943073314 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -376,7 +376,7 @@ class FormAccounting extends Form
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.labelshort, aa.rowid, aa.fk_pcg_version";
$sql .= " FROM ".$this->db->prefix()."accounting_account as aa";
$sql .= " INNER JOIN ".$this->db->prefix()."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
- $sql .= " AND asy.rowid = 11111".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
+ $sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
if ($active === '1') {
$sql .= " AND aa.active = 1";
} elseif ($active === '0') {
|