37 print
"Error, template page can't be called as URL";
42@phan-var-force CommonObject $object
43@phan-var-force int $usercancreate
44@phan-var-force string $action
45@phan-var-force Form $form
46@phan-var-force Conf $conf
47@phan-var-force Translate $langs
51print
'<!-- BEGIN object_currency_amount.tpl.php -->'.
"\n";
54if (isModEnabled(
'multicurrency')) {
56 if (isModEnabled(
"multicurrency") && (
$object->multicurrency_code &&
$object->multicurrency_code !=
$conf->currency)) {
60 $currencyIsEditable = (
$object->suspended == $object::STATUS_SUSPENDED);
64 $currencyIsEditable = (
$object->status == $object::STATUS_DRAFT);
70 print
'<table class="nobordernopadding centpercent"><tr><td>';
71 print $form->editfieldkey(
'Currency',
'multicurrency_code',
'',
$object, 0);
73 if ($usercancreate && $action !=
'editmulticurrencycode' && $currencyIsEditable) {
74 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>';
76 print
'</tr></table>';
77 print
'</td><td'.($colspan == 2 ?
' colspan="2"' :
'').
'>';
78 $htmlname = (($usercancreate && $action ==
'editmulticurrencycode' && $currencyIsEditable) ?
'multicurrency_code' :
'none');
79 $form->form_multicurrency_code($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->multicurrency_code, $htmlname);
86 print
'<table class="nobordernopadding centpercent"><tr><td>';
87 print $form->editfieldkey(
'CurrencyRate',
'multicurrency_tx',
'',
$object, 0);
89 if ($usercancreate && $action !=
'editmulticurrencyrate' && $currencyIsEditable &&
$object->multicurrency_code &&
$object->multicurrency_code !=
$conf->currency) {
90 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>';
92 print
'</tr></table>';
93 print
'</td><td'.($colspan == 2 ?
' colspan="2"' :
'').
'>';
94 if ($action ==
'editmulticurrencyrate' || $action ==
'actualizemulticurrencyrate') {
95 if ($action ==
'actualizemulticurrencyrate') {
98 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->multicurrency_tx, ($usercancreate ?
'multicurrency_tx' :
'none'),
$object->multicurrency_code);
100 $form->form_multicurrency_rate($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->multicurrency_tx,
'none',
$object->multicurrency_code);
101 if (
$object->status == $object::STATUS_DRAFT &&
$object->multicurrency_code &&
$object->multicurrency_code !=
$conf->currency) {
102 print
'<div class="inline-block"> ';
103 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=actualizemulticurrencyrate&token='.
newToken().
'" title="'.$langs->trans(
"ActualizeCurrency").
'">';
105 print
img_picto($langs->trans(
"ActualizeCurrency"),
'undo');
114print
'<!-- 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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...