Merge pull request #4707 from marcosgdf/misc2

Removed deprecated usage of Account::account_currency_code and started using Account::canBeReconciliated
This commit is contained in:
Laurent Destailleur 2016-03-10 13:21:51 +01:00
commit 4fa84c8d8f
5 changed files with 24 additions and 26 deletions

View File

@ -140,10 +140,6 @@ class Commande extends CommonOrder
*/
var $lines = array();
// Pour board
var $nbtodo;
var $nbtodolate;
// Multicurrency
var $fk_multicurrency;
var $multicurrency_code;

View File

@ -397,15 +397,11 @@ if ($id > 0 || ! empty($ref))
}
}
if ($object->type != 2 && $object->rappro)
{
if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
if ($user->rights->banque->consolidate) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline ? '&amp;vline='.$vline : '').'">'.$langs->trans("Conciliate").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
@ -529,8 +525,11 @@ if ($id > 0 || ! empty($ref))
print '<td align="right">'.$langs->trans("Credit").'</td>';
print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '<td align="center" width="60">';
if ($object->type != 2 && $object->rappro) print $langs->trans("AccountStatementShort");
else print '&nbsp;';
if ($object->canBeConciliated() > 0) {
print $langs->trans("AccountStatementShort");
} else {
print '&nbsp;';
}
print '</td></tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';

View File

@ -292,7 +292,7 @@ if ($action == 'create')
// Currency
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
print '<td colspan="3">';
$selectedcode=$account->account_currency_code;
$selectedcode=$account->currency_code;
if (! $selectedcode) $selectedcode=$conf->currency;
print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
//print $langs->trans("Currency".$conf->currency);
@ -583,7 +583,7 @@ else
// Currency
print '<tr><td>'.$langs->trans("Currency").'</td>';
print '<td colspan="3">';
$selectedcode=$account->account_currency_code;
$selectedcode=$account->currency_code;
if (! $selectedcode) $selectedcode=$conf->currency;
print $langs->trans("Currency".$selectedcode);
print '</td></tr>';
@ -851,7 +851,7 @@ else
print '<input type="hidden" value="'.$account->currency_code.'">';
print '</td>';
print '<td colspan="3">';
$selectedcode=$account->account_currency_code;
$selectedcode=$account->currency_code;
if (! $selectedcode) $selectedcode=$conf->currency;
print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
//print $langs->trans("Currency".$conf->currency);

View File

@ -166,6 +166,13 @@ class Account extends CommonObject
*/
public $currency_code;
/**
* Currency code
* @var string
* @deprecated Use currency_code instead
*/
public $account_currency_code;
/**
* Authorized minimum balance
* @var float

View File

@ -143,16 +143,12 @@ if (empty($num))
dol_fiche_end();
print '<div class="tabsAction">';
if ($object->type != 2 && $object->rappro)
{
if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
if ($user->rights->banque->consolidate) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline ? '&amp;vline='.$vline : '').'">'.$langs->trans("Conciliate").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}