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(); var $lines = array();
// Pour board
var $nbtodo;
var $nbtodolate;
// Multicurrency // Multicurrency
var $fk_multicurrency; var $fk_multicurrency;
var $multicurrency_code; 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 not cash account and can be reconciliate
if ($user->rights->banque->consolidate) 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>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>'; } else {
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>'; 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">'.$langs->trans("Credit").'</td>';
print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>'; print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '<td align="center" width="60">'; print '<td align="center" width="60">';
if ($object->type != 2 && $object->rappro) print $langs->trans("AccountStatementShort"); if ($object->canBeConciliated() > 0) {
else print '&nbsp;'; print $langs->trans("AccountStatementShort");
} else {
print '&nbsp;';
}
print '</td></tr>'; print '</td></tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';

View File

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

View File

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

View File

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