27if (empty($conf) || !is_object($conf)) {
28 print
"Error, template page can't be called as URL";
33@phan-var-force CommonObject $object
34@phan-var-force int $usercancreate
35@phan-var-force string $action
36@phan-var-force Form $form
37@phan-var-force Conf $conf
38@phan-var-force Translate $langs
42print
'<!-- BEGIN object_currency_amount.tpl.php -->'.
"\n";
45if (isModEnabled(
'multicurrency')) {
47 if (isModEnabled(
"multicurrency") && (
$object->multicurrency_code &&
$object->multicurrency_code != $conf->currency)) {
51 $currencyIsEditable = (
$object->suspended == $object::STATUS_SUSPENDED);
55 $currencyIsEditable = (
$object->status == $object::STATUS_DRAFT);
61 print
'<table class="nobordernopadding centpercent"><tr><td>';
62 print $form->editfieldkey(
'Currency',
'multicurrency_code',
'',
$object, 0);
64 if ($usercancreate && $action !=
'editmulticurrencycode' && $currencyIsEditable) {
65 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editmulticurrencycode&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetMultiCurrencyCode'), 1).
'</a></td>';
67 print
'</tr></table>';
68 print
'</td><td'.($colspan == 2 ?
' colspan="2"' :
'').
'>';
69 $htmlname = (($usercancreate && $action ==
'editmulticurrencycode' && $currencyIsEditable) ?
'multicurrency_code' :
'none');
70 $form->form_multicurrency_code($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->multicurrency_code, $htmlname);
74 if (
$object->multicurrency_code != $conf->currency ||
$object->multicurrency_tx != 1) {
77 print
'<table class="nobordernopadding centpercent"><tr><td>';
78 print $form->editfieldkey(
'CurrencyRate',
'multicurrency_tx',
'',
$object, 0);
80 if ($usercancreate && $action !=
'editmulticurrencyrate' && $currencyIsEditable &&
$object->multicurrency_code &&
$object->multicurrency_code != $conf->currency) {
81 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editmulticurrencyrate&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetMultiCurrencyRate'), 1).
'</a></td>';
83 print
'</tr></table>';
84 print
'</td><td'.($colspan == 2 ?
' colspan="2"' :
'').
'>';
85 if ($action ==
'editmulticurrencyrate' || $action ==
'actualizemulticurrencyrate') {
86 if ($action ==
'actualizemulticurrencyrate') {
89 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->multicurrency_tx, ($usercancreate ?
'multicurrency_tx' :
'none'),
$object->multicurrency_code);
91 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->multicurrency_tx,
'none',
$object->multicurrency_code);
92 if (
$object->status == $object::STATUS_DRAFT &&
$object->multicurrency_code &&
$object->multicurrency_code != $conf->currency) {
93 print
'<div class="inline-block"> ';
94 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=actualizemulticurrencyrate&token='.
newToken().
'" title="'.$langs->trans(
"ActualizeCurrency").
'">';
96 print
img_picto($langs->trans(
"ActualizeCurrency"),
'undo');
105print
'<!-- END template -->';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage invoice templates.
Class to manage invoice templates.
static getIdAndTxFromCode($dbs, $code, $date_document='')
Get id and rate of currency from code.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.