Skip to content

Commit

Permalink
Use list of account instead of simple input
Browse files Browse the repository at this point in the history
  • Loading branch information
aspangaro committed Oct 10, 2024
1 parent 6aa9f13 commit afdd932
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions htdocs/comm/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
if (isModEnabled('intervention')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
}

// Load translation files required by the page
$langs->loadLangs(array('companies', 'banks'));
Expand Down Expand Up @@ -373,12 +377,20 @@
print '</td></tr>';

if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$formaccounting = new FormAccounting($db);

print '<tr>';
print '<td>';
print $form->editfieldkey("CustomerAccountancyCodeGeneral", 'customeraccountancycodegeneral', length_accountg($object->accountancy_code_customer_general), $object, $user->hasRight('societe', 'creer'));
print '</td><td>';
print $form->editfieldval("CustomerAccountancyCodeGeneral", 'customeraccountancycodegeneral', length_accountg($object->accountancy_code_customer_general), $object, $user->hasRight('societe', 'creer'));
if ($action == 'editcustomeraccountancycodegeneral' && $user->hasRight('societe', 'creer')) {
print $formaccounting->formAccountingAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->accountancy_code_customer_general, 'customeraccountancycodegeneral', 0, 1, '', 1);
} else {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(0, $object->accountancy_code_customer_general, 1);

print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
}
$accountingAccountByDefault = " (" . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) . ")";
print (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') ? $accountingAccountByDefault : '');
print '</td>';
Expand Down

0 comments on commit afdd932

Please sign in to comment.