diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 4d59a75fb1b..f578aa75cf5 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -158,7 +158,7 @@ if (empty($reshook)) {
$action = "";
}
- // set accountancy code
+ // Set accountancy code
if ($action == 'setcustomeraccountancycode') {
$result = $object->fetch($id);
$object->code_compta_client = GETPOST("customeraccountancycode");
@@ -169,7 +169,7 @@ if (empty($reshook)) {
}
}
- // terms of the settlement
+ // Payment terms of the settlement
if ($action == 'setconditions' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
@@ -178,7 +178,7 @@ if (empty($reshook)) {
}
}
- // mode de reglement
+ // Payment mode
if ($action == 'setmode' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
@@ -187,7 +187,7 @@ if (empty($reshook)) {
}
}
- // transport mode
+ // Transport mode
if ($action == 'settransportmode' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setTransportMode(GETPOST('transport_mode_id', 'alpha'));
@@ -421,7 +421,7 @@ if ($object->id > 0) {
print "";
print '';
- // Mode de reglement par defaut
+ // Default payment mode
print '
';
print '| ';
print $langs->trans('PaymentMode');
@@ -440,7 +440,7 @@ if ($object->id > 0) {
print ' | ';
if (isModEnabled("banque")) {
- // Compte bancaire par défaut
+ // Default bank account for payments
print '';
print '| ';
print $langs->trans('PaymentBankAccount');
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 2c929aa40ba..f3260d8ea48 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -106,7 +106,7 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- // terms of the settlement
+ // Set payment terms of the settlement
if ($action == 'setconditions' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setPaymentTerms(GETPOST('cond_reglement_supplier_id', 'int'));
@@ -114,7 +114,7 @@ if (empty($reshook)) {
dol_print_error($db, $object->error);
}
}
- // mode de reglement
+ // Payment mode
if ($action == 'setmode' && $user->rights->societe->creer) {
$object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_supplier_id', 'int'));
@@ -123,6 +123,15 @@ if (empty($reshook)) {
}
}
+ // Bank account
+ if ($action == 'setbankaccount' && $user->rights->societe->creer) {
+ $object->fetch($id);
+ $result = $object->setBankAccount(GETPOST('fk_account', 'int'));
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
+
// update supplier order min amount
if ($action == 'setsupplier_order_min_amount') {
$object->fetch($id);
@@ -276,7 +285,7 @@ if ($object->id > 0) {
print " | ";
print ' ';
- // Mode de reglement par defaut
+ // Default payment mode
print '';
print '| ';
print $langs->trans('PaymentMode');
@@ -294,6 +303,26 @@ if ($object->id > 0) {
print " | ";
print ' ';
+ if (isModEnabled("banque")) {
+ // Default bank account for payments
+ print '| ';
+ print '';
+ print ' | ';
+ if ($action == 'editbankaccount') {
+ $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'fk_account', 1);
+ } else {
+ $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'none');
+ }
+ print " | ";
+ print ' ';
+ }
+
// Relative discounts (Discounts-Drawbacks-Rebates)
print '';
print '| ';
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index 7f198db6042..47671f4e7c3 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -44,7 +44,7 @@ create table llx_societe
town varchar(50), -- town
fk_departement integer DEFAULT 0, --
fk_pays integer DEFAULT 0, --
- fk_account integer DEFAULT 0, --
+ fk_account integer DEFAULT 0, -- default bank account
phone varchar(20), -- phone number
fax varchar(20), -- fax number
url varchar(255), --
|
|
|
|
|