Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-07-09 13:35:08 +02:00
commit af8c973050
4 changed files with 121 additions and 92 deletions

View File

@ -255,7 +255,7 @@ if ($action == 'update') {
$_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer $_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
exit; exit;
} }
@ -281,6 +281,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="page_y" value="">';
clearstatcache(); clearstatcache();
@ -292,8 +293,9 @@ print '</tr>';
// Default language // Default language
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
print img_picto('', 'language', 'class="pictofixedwidth"');
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2); print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">'; //print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -303,12 +305,24 @@ print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</table><br>'."\n"; print '</table>'."\n";
print '</div>'; print '</div>';
print '<br>';
print '<div class="center">';
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '<br><br>';
// Themes and themes options // Themes and themes options
showSkins(null, 1); showSkins(null, 1);
print '<br>'; print '<br>';
print '<div class="center">';
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '<br><br>';
// Other // Other
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
@ -440,6 +454,12 @@ print '</div>';
print '<br>'; print '<br>';
print '<div class="center">';
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '<br><br>';
// Other // Other
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent editmode tableforfield">'; print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
@ -497,7 +517,7 @@ print '</div>';
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">'; print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';

View File

@ -98,44 +98,6 @@ if (GETPOST("account") || GETPOST("ref")) {
print dol_get_fiche_end(); print dol_get_fiche_end();
print '<br>';
$solde = $object->solde(0);
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
$colspan = 6;
} else {
$colspan = 5;
}
// Show next coming entries
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
// Ligne de titre tableau des ecritures
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("DateDue").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
print '<td>'.$langs->trans("Entity").'</td>';
}
print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td class="right">'.$langs->trans("Debit").'</td>';
print '<td class="right">'.$langs->trans("Credit").'</td>';
print '<td class="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '</tr>';
// Current balance
print '<tr class="liste_total">';
print '<td class="left" colspan="5">'.$langs->trans("CurrentBalance").'</td>';
print '<td class="nowrap right">'.price($solde).'</td>';
print '</tr>';
print '<tr class="liste_titre">';
print '<td class="left" colspan="'.$colspan.'">'.$langs->trans("RemainderToPay").'</td>';
print '<td class="nowrap right">&nbsp;</td>';
print '</tr>';
// Remainder to pay in future // Remainder to pay in future
$sqls = array(); $sqls = array();
@ -183,10 +145,12 @@ if (GETPOST("account") || GETPOST("ref")) {
$error = 0; $error = 0;
$tab_sqlobjOrder = array(); $tab_sqlobjOrder = array();
$tab_sqlobj = array(); $tab_sqlobj = array();
$nbtotalofrecords = 0;
foreach ($sqls as $sql) { foreach ($sqls as $sql) {
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$nbtotalofrecords += $db->num_rows($resql);
while ($sqlobj = $db->fetch_object($resql)) { while ($sqlobj = $db->fetch_object($resql)) {
$tmpobj = new stdClass(); $tmpobj = new stdClass();
$tmpobj->family = $sqlobj->family; $tmpobj->family = $sqlobj->family;
@ -194,7 +158,7 @@ if (GETPOST("account") || GETPOST("ref")) {
$tmpobj->ref = $sqlobj->ref; $tmpobj->ref = $sqlobj->ref;
$tmpobj->total_ttc = $sqlobj->total_ttc; $tmpobj->total_ttc = $sqlobj->total_ttc;
$tmpobj->type = $sqlobj->type; $tmpobj->type = $sqlobj->type;
$tmpobj->dlt = $sqlobj->dlr; $tmpobj->dlr = $db->jdate($sqlobj->dlr);
$tmpobj->socid = $sqlobj->socid; $tmpobj->socid = $sqlobj->socid;
$tmpobj->name = $sqlobj->name; $tmpobj->name = $sqlobj->name;
$tmpobj->fournisseur = $sqlobj->fournisseur; $tmpobj->fournisseur = $sqlobj->fournisseur;
@ -208,6 +172,48 @@ if (GETPOST("account") || GETPOST("ref")) {
} }
} }
$param = '';
$sortfield = '';
$sortorder = '';
$massactionbutton = '';
$num = 0;
$picto = '';
$morehtml = '';
$limit = 0;
print_barre_liste($langs->trans("RemainderToPay"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1);
$solde = $object->solde(0);
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
$colspan = 6;
} else {
$colspan = 5;
}
// Show next coming entries
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
// Ligne de titre tableau des ecritures
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("DateDue").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
print '<td>'.$langs->trans("Entity").'</td>';
}
print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td class="right">'.$langs->trans("Debit").'</td>';
print '<td class="right">'.$langs->trans("Credit").'</td>';
print '<td class="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '</tr>';
// Current balance
print '<tr class="liste_total">';
print '<td class="left" colspan="5">'.$langs->trans("CurrentBalance").'</td>';
print '<td class="nowrap right">'.price($solde).'</td>';
print '</tr>';
// Sort array // Sort array
if (!$error) { if (!$error) {
array_multisort($tab_sqlobjOrder, $tab_sqlobj); array_multisort($tab_sqlobjOrder, $tab_sqlobj);
@ -220,60 +226,60 @@ if (GETPOST("account") || GETPOST("ref")) {
$refcomp = ''; $refcomp = '';
$totalpayment = ''; $totalpayment = '';
$obj = array_shift($tab_sqlobj); $tmpobj = array_shift($tab_sqlobj);
if ($obj->family == 'invoice_supplier') { if ($tmpobj->family == 'invoice_supplier') {
$showline = 1; $showline = 1;
// Uncomment this line to avoid to count suppliers credit note (ff.type = 2) // Uncomment this line to avoid to count suppliers credit note (ff.type = 2)
//$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2)) //$showline=(($tmpobj->total_ttc < 0 && $tmpobj->type != 2) || ($tmpobj->total_ttc > 0 && $tmpobj->type == 2))
if ($showline) { if ($showline) {
$ref = $obj->ref; $ref = $tmpobj->ref;
$facturefournstatic->ref = $ref; $facturefournstatic->ref = $ref;
$facturefournstatic->id = $obj->objid; $facturefournstatic->id = $tmpobj->objid;
$facturefournstatic->type = $obj->type; $facturefournstatic->type = $tmpobj->type;
$ref = $facturefournstatic->getNomUrl(1, ''); $ref = $facturefournstatic->getNomUrl(1, '');
$societestatic->id = $obj->socid; $societestatic->id = $tmpobj->socid;
$societestatic->name = $obj->name; $societestatic->name = $tmpobj->name;
$refcomp = $societestatic->getNomUrl(1, '', 24); $refcomp = $societestatic->getNomUrl(1, '', 24);
$totalpayment = -1 * $facturefournstatic->getSommePaiement(); // Payment already done $totalpayment = -1 * $facturefournstatic->getSommePaiement(); // Payment already done
} }
} }
if ($obj->family == 'invoice') { if ($tmpobj->family == 'invoice') {
$facturestatic->ref = $obj->ref; $facturestatic->ref = $tmpobj->ref;
$facturestatic->id = $obj->objid; $facturestatic->id = $tmpobj->objid;
$facturestatic->type = $obj->type; $facturestatic->type = $tmpobj->type;
$ref = $facturestatic->getNomUrl(1, ''); $ref = $facturestatic->getNomUrl(1, '');
$societestatic->id = $obj->socid; $societestatic->id = $tmpobj->socid;
$societestatic->name = $obj->name; $societestatic->name = $tmpobj->name;
$refcomp = $societestatic->getNomUrl(1, '', 24); $refcomp = $societestatic->getNomUrl(1, '', 24);
$totalpayment = $facturestatic->getSommePaiement(); // Payment already done $totalpayment = $facturestatic->getSommePaiement(); // Payment already done
$totalpayment += $facturestatic->getSumDepositsUsed(); $totalpayment += $facturestatic->getSumDepositsUsed();
$totalpayment += $facturestatic->getSumCreditNotesUsed(); $totalpayment += $facturestatic->getSumCreditNotesUsed();
} }
if ($obj->family == 'social_contribution') { if ($tmpobj->family == 'social_contribution') {
$socialcontribstatic->ref = $obj->ref; $socialcontribstatic->ref = $tmpobj->ref;
$socialcontribstatic->id = $obj->objid; $socialcontribstatic->id = $tmpobj->objid;
$socialcontribstatic->label = $obj->type; $socialcontribstatic->label = $tmpobj->type;
$ref = $socialcontribstatic->getNomUrl(1, 24); $ref = $socialcontribstatic->getNomUrl(1, 24);
$totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done $totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done
} }
$parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment); $parameters = array('obj' => $tmpobj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment);
$reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
$ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref;
$refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp;
$totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment; $totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment;
} }
$total_ttc = $obj->total_ttc; $total_ttc = $tmpobj->total_ttc;
if ($totalpayment) { if ($totalpayment) {
$total_ttc = $obj->total_ttc - $totalpayment; $total_ttc = $tmpobj->total_ttc - $totalpayment;
} }
$solde += $total_ttc; $solde += $total_ttc;
@ -282,26 +288,26 @@ if (GETPOST("account") || GETPOST("ref")) {
// Show line // Show line
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
if ($obj->dlr) { if ($tmpobj->dlr) {
print dol_print_date($db->jdate($obj->dlr), "day"); print dol_print_date($tmpobj->dlr, "day");
} else { } else {
print $langs->trans("NotDefined"); print $langs->trans("NotDefined");
} }
print "</td>"; print "</td>";
print "<td>".$ref."</td>"; print "<td>".$ref."</td>";
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
if ($obj->family == 'invoice') { if ($tmpobj->family == 'invoice') {
$mc->getInfo($obj->entity); $mc->getInfo($tmpobj->entity);
print "<td>".$mc->label."</td>"; print "<td>".$mc->label."</td>";
} else { } else {
print "<td></td>"; print "<td></td>";
} }
} }
print "<td>".$refcomp."</td>"; print "<td>".$refcomp."</td>";
if ($obj->total_ttc < 0) { if ($tmpobj->total_ttc < 0) {
print '<td class="nowrap right">'.price(abs($total_ttc))."</td><td>&nbsp;</td>"; print '<td class="nowrap right">'.price(abs($total_ttc))."</td><td>&nbsp;</td>";
}; };
if ($obj->total_ttc >= 0) { if ($tmpobj->total_ttc >= 0) {
print '<td>&nbsp;</td><td class="nowrap right">'.price($total_ttc)."</td>"; print '<td>&nbsp;</td><td class="nowrap right">'.price($total_ttc)."</td>";
}; };
print '<td class="nowrap right">'.price($solde).'</td>'; print '<td class="nowrap right">'.price($solde).'</td>';

View File

@ -43,7 +43,7 @@ $idprod = GETPOST('idprod', 'int');
$prices = array(); $prices = array();
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("stocks", "margins")); $langs->loadLangs(array("stocks", "margins", "products"));
/* /*

View File

@ -2739,14 +2739,17 @@ if ($action == 'create') {
// Label // Label
print '<tr>'; print '<tr>';
print '<td>'.$form->editfieldkey("Label", 'label', $object->label, $object, ($usercancreate)).'</td>'; print '<td>'.$form->editfieldkey("Label", 'label', $object->label, $object, $usercancreate).'</td>';
print '<td>'.$form->editfieldval("Label", 'label', $object->label, $object, ($usercancreate)).'</td>'; print '<td>'.$form->editfieldval("Label", 'label', $object->label, $object, $usercancreate).'</td>';
print '</tr>'; print '</tr>';
$form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0);
$form_permission2 = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate;
// Date // Date
print '<tr><td>'.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').'</td><td colspan="3">'; print '<tr><td>';
print $form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker');
print '</td><td colspan="3">';
print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker'); print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker');
print '</td>'; print '</td>';
@ -2756,11 +2759,11 @@ if ($action == 'create') {
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('PaymentConditions'); print $langs->trans('PaymentConditions');
print '<td>'; print '<td>';
if ($action != 'editconditions' && $usercancreate) { if ($action != 'editconditions' && $form_permission) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td>';
if ($action == 'editconditions') { if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else { } else {
@ -2770,8 +2773,10 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
// Due date // Due date
print '<tr><td>'.$form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker').'</td><td colspan="3">'; print '<tr><td>';
print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker');
print '</td><td>';
print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker');
if ($action != 'editdate_lim_reglement' && $object->hasDelay()) { if ($action != 'editdate_lim_reglement' && $object->hasDelay()) {
print img_warning($langs->trans('Late')); print img_warning($langs->trans('Late'));
} }
@ -2783,11 +2788,11 @@ if ($action == 'create') {
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
print '</td>'; print '</td>';
if ($action != 'editmode' && $usercancreate) { if ($action != 'editmode' && $form_permission2) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td>';
if ($action == 'editmode') { if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT', 1, 1); $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT', 1, 1);
} else { } else {
@ -2807,7 +2812,7 @@ if ($action == 'create') {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td>';
if ($action == 'editmulticurrencycode') { if ($action == 'editmulticurrencycode') {
$form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, 'multicurrency_code'); $form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, 'multicurrency_code');
} else { } else {
@ -2819,14 +2824,14 @@ if ($action == 'create') {
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding centpercent"><tr><td>';
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
print '</td>'; print '</td>';
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td>';
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
if ($action == 'actualizemulticurrencyrate') { if ($action == 'actualizemulticurrencyrate') {
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
@ -2854,7 +2859,7 @@ if ($action == 'create') {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td>';
if ($action == 'editbankaccount') { if ($action == 'editbankaccount') {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
} else { } else {
@ -2877,7 +2882,7 @@ if ($action == 'create') {
} }
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
print '<td colspan="3">'; print '<td>';
if ($action != 'editincoterm') { if ($action != 'editincoterm') {
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
} else { } else {
@ -2898,7 +2903,6 @@ if ($action == 'create') {
} }
print '</tr></table>'; print '</tr></table>';
print '</td>'; print '</td>';
print '<td>'; print '<td>';
if ($action == 'editmode') { if ($action == 'editmode') {
$form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1, 1); $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1, 1);
@ -2913,8 +2917,8 @@ if ($action == 'create') {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
print '<div class="ficheaddleft">'; print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
@ -2933,7 +2937,7 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
// Multicurrency Amount TTC // Multicurrency Amount TTC
print '<tr><td height="10">'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).'</td>'; print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).'</td>';
print '<td>'.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>'; print '<td>'.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>'; print '</tr>';
} }
@ -2977,9 +2981,8 @@ if ($action == 'create') {
print '</table>'; print '</table>';
/*
* List of payments // List of payments
*/
$totalpaye = 0; $totalpaye = 0;