Merge remote-tracking branch 'upstream/develop' into escpos
This commit is contained in:
commit
317ba9c047
@ -488,7 +488,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>';
|
if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>';
|
||||||
if (! empty($arrayfields['a.percent']['checked'])) {
|
if (! empty($arrayfields['a.percent']['checked'])) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
$formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2);
|
$formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2, 'minwidth100imp maxwidth125');
|
||||||
print ajax_combobox('selectstatus');
|
print ajax_combobox('selectstatus');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2202,11 +2202,11 @@ if ($action == 'create')
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencycode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT && $usercancreate)
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmulticurrencycode' && $usercancreate) {
|
if ($object->statut == $object::STATUS_DRAFT && $action == 'editmulticurrencycode' && $usercancreate) {
|
||||||
$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 {
|
||||||
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none');
|
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none');
|
||||||
@ -2214,29 +2214,33 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
print '<tr>';
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
print '<td>';
|
{
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<tr>';
|
||||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
print '<td>';
|
||||||
print '</td>';
|
print '<table class="nobordernopadding" width="100%"><tr>';
|
||||||
if ($action != 'editmulticurrencyrate' && $object->statut == Propal::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate)
|
print '<td>';
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
print '</tr></table>';
|
print '</td>';
|
||||||
print '</td><td>';
|
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate)
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') && $usercancreate) {
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
if($action == 'actualizemulticurrencyrate') {
|
print '</tr></table>';
|
||||||
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
print '</td><td>';
|
||||||
}
|
if ($object->statut ==$object::STATUS_DRAFT && ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') && $usercancreate) {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
if($action == 'actualizemulticurrencyrate') {
|
||||||
} else {
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
}
|
||||||
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
print '<div class="inline-block"> ';
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
print '</div>';
|
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($soc->outstanding_limit)
|
if ($soc->outstanding_limit)
|
||||||
|
|||||||
@ -2057,12 +2057,8 @@ if ($action == 'create' && $usercancreate)
|
|||||||
if ($action == 'clone') {
|
if ($action == 'clone') {
|
||||||
// Create an array for form
|
// Create an array for form
|
||||||
$formquestion = array(
|
$formquestion = array(
|
||||||
// 'text' => $langs->trans("ConfirmClone"),
|
array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=3)'))
|
||||||
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' =>
|
);
|
||||||
// 1),
|
|
||||||
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
|
|
||||||
// => 1),
|
|
||||||
array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=3)')));
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2291,25 +2287,28 @@ if ($action == 'create' && $usercancreate)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
print '<tr>';
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
print '<td>';
|
{
|
||||||
$editenable = $usercancreate && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $object->statut == Commande::STATUS_DRAFT;
|
print '<tr>';
|
||||||
print $form->editfieldkey("CurrencyRate", 'multicurrencyrate', '', $object, $editenable);
|
print '<td>';
|
||||||
print '</td><td>';
|
$editenable = $usercancreate && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $object->statut == $object::STATUS_DRAFT;
|
||||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
print $form->editfieldkey("CurrencyRate", 'multicurrencyrate', '', $object, $editenable);
|
||||||
if($action == 'actualizemulticurrencyrate') {
|
print '</td><td>';
|
||||||
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||||
}
|
if($action == 'actualizemulticurrencyrate') {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
} else {
|
}
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
} else {
|
||||||
print '<div class="inline-block"> ';
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
print '</div>';
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delivery delay
|
// Delivery delay
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/compta/facture/fiche-rec.php
|
* \file htdocs/compta/facture/card-rec.php
|
||||||
* \ingroup facture
|
* \ingroup facture
|
||||||
* \brief Page to show predefined invoice
|
* \brief Page to show predefined invoice
|
||||||
*/
|
*/
|
||||||
@ -387,6 +387,15 @@ if (empty($reshook))
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Multicurrency Code
|
||||||
|
elseif ($action == 'setmulticurrencycode' && $usercancreate) {
|
||||||
|
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multicurrency rate
|
||||||
|
elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
|
||||||
|
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int'));
|
||||||
|
}
|
||||||
|
|
||||||
// Delete line
|
// Delete line
|
||||||
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer)
|
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer)
|
||||||
@ -1346,6 +1355,52 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Multicurrency
|
||||||
|
if (! empty($conf->multicurrency->enabled))
|
||||||
|
{
|
||||||
|
// Multicurrency code
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>';
|
||||||
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
|
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||||
|
print '</td>';
|
||||||
|
if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon))
|
||||||
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</td><td>';
|
||||||
|
$htmlname = (($usercancreate && $action == 'editmulticurrencycode')?'multicurrency_code':'none');
|
||||||
|
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Multicurrency rate
|
||||||
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
|
{
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>';
|
||||||
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
|
print '</td>';
|
||||||
|
if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||||
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</td><td>';
|
||||||
|
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||||
|
if($action == 'actualizemulticurrencyrate') {
|
||||||
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
|
}
|
||||||
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate?'multicurrency_tx':'none'), $object->multicurrency_code);
|
||||||
|
} else {
|
||||||
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
|
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Help of substitution key
|
// Help of substitution key
|
||||||
$dateexample=dol_now();
|
$dateexample=dol_now();
|
||||||
if (! empty($object->frequency) && ! empty($object->date_when)) $dateexample=$object->date_when;
|
if (! empty($object->frequency) && ! empty($object->date_when)) $dateexample=$object->date_when;
|
||||||
@ -1701,11 +1756,11 @@ else
|
|||||||
{
|
{
|
||||||
if (empty($object->suspended))
|
if (empty($object->suspended))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?action=disable&id='.$object->id.'">'.$langs->trans("Disable").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?action=disable&id='.$object->id.'">'.$langs->trans("Disable").'</a></div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?action=enable&id='.$object->id.'">'.$langs->trans("Enable").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?action=enable&id='.$object->id.'">'.$langs->trans("Enable").'</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2579,7 +2579,6 @@ $title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Card');
|
|||||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
|
|
||||||
// Mode creation
|
// Mode creation
|
||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
@ -2600,18 +2599,19 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
// Parse element/subelement (ex: project_task)
|
// Parse element/subelement (ex: project_task)
|
||||||
$element = $subelement = $origin;
|
$element = $subelement = $origin;
|
||||||
|
$regs = array();
|
||||||
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||||
$element = $regs [1];
|
$element = $reg[1];
|
||||||
$subelement = $regs [2];
|
$subelement = $regs[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($element == 'project') {
|
if ($element == 'project') {
|
||||||
$projectid = $originid;
|
$projectid = $originid;
|
||||||
|
|
||||||
if (!$cond_reglement_id) {
|
if (empty($cond_reglement_id)) {
|
||||||
$cond_reglement_id = $soc->cond_reglement_id;
|
$cond_reglement_id = $soc->cond_reglement_id;
|
||||||
}
|
}
|
||||||
if (!$mode_reglement_id) {
|
if (empty($mode_reglement_id)) {
|
||||||
$mode_reglement_id = $soc->mode_reglement_id;
|
$mode_reglement_id = $soc->mode_reglement_id;
|
||||||
}
|
}
|
||||||
if (!$remise_percent) {
|
if (!$remise_percent) {
|
||||||
@ -2754,7 +2754,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
|
print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
|
||||||
if ($soc->id > 0 && ! GETPOST('fac_rec', 'alpha'))
|
if ($soc->id > 0 && ! GETPOST('fac_rec', 'int'))
|
||||||
{
|
{
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $soc->getNomUrl(1);
|
print $soc->getNomUrl(1);
|
||||||
@ -2797,7 +2797,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$exampletemplateinvoice=new FactureRec($db);
|
$exampletemplateinvoice=new FactureRec($db);
|
||||||
|
|
||||||
// Overwrite value if creation of invoice is from a predefined invoice
|
// Overwrite some values if creation of invoice is from a predefined invoice
|
||||||
if (empty($origin) && empty($originid) && GETPOST('fac_rec', 'int') > 0)
|
if (empty($origin) && empty($originid) && GETPOST('fac_rec', 'int') > 0)
|
||||||
{
|
{
|
||||||
$invoice_predefined = new FactureRec($db);
|
$invoice_predefined = new FactureRec($db);
|
||||||
@ -2811,6 +2811,9 @@ if ($action == 'create')
|
|||||||
$note_public = $invoice_predefined->note_public;
|
$note_public = $invoice_predefined->note_public;
|
||||||
$note_private = $invoice_predefined->note_private;
|
$note_private = $invoice_predefined->note_private;
|
||||||
|
|
||||||
|
if (! empty($invoice_predefined->multicurrency_code)) $currency_code = $invoice_predefined->multicurrency_code;
|
||||||
|
if (! empty($invoice_predefined->multicurrency_tx)) $currency_tx = $invoice_predefined->multicurrency_tx;
|
||||||
|
|
||||||
$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
|
$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
|
||||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
|
||||||
$sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid;
|
$sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid;
|
||||||
@ -2833,7 +2836,7 @@ if ($action == 'create')
|
|||||||
if (GETPOST('fac_rec') == $objp->rowid)
|
if (GETPOST('fac_rec') == $objp->rowid)
|
||||||
{
|
{
|
||||||
print ' selected';
|
print ' selected';
|
||||||
$exampletemplateinvoice->fetch(GETPOST('fac_rec'));
|
$exampletemplateinvoice->fetch(GETPOST('fac_rec', 'int'));
|
||||||
}
|
}
|
||||||
print '>' . $objp->title . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
|
print '>' . $objp->title . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
|
||||||
$i ++;
|
$i ++;
|
||||||
@ -2921,12 +2924,17 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Next situation invoice
|
// Next situation invoice
|
||||||
$opt = $form->selectSituationInvoices(GETPOST('originid'), $socid);
|
$opt = $form->selectSituationInvoices(GETPOST('originid'), $socid);
|
||||||
|
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
$tmp='<input type="radio" name="type" value="5"' . (GETPOST('type') == 5 && GETPOST('originid') ? ' checked' : '');
|
$tmp='<input type="radio" name="type" value="5"' . (GETPOST('type') == 5 && GETPOST('originid') ? ' checked' : '');
|
||||||
if ($opt == ('<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande')) $tmp.=' disabled';
|
if ($opt == ('<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande'))
|
||||||
|
$tmp.=' disabled';
|
||||||
$tmp.= '> ';
|
$tmp.= '> ';
|
||||||
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
|
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
|
||||||
$text .= '<select class="flat" id="situations" name="situations">';
|
$text .= '<select class="flat" id="situations" name="situations"';
|
||||||
|
if ($opt == ('<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande'))
|
||||||
|
$text .= ' disabled';
|
||||||
|
$text .='>';
|
||||||
$text .= $opt;
|
$text .= $opt;
|
||||||
$text .= '</select>';
|
$text .= '</select>';
|
||||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceSituationDesc"), 1, 'help', '', 0, 3);
|
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceSituationDesc"), 1, 'help', '', 0, 3);
|
||||||
@ -4030,29 +4038,33 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname);
|
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr>';
|
// Multicurrency rate
|
||||||
print '<td>';
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
{
|
||||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
print '<tr>';
|
||||||
print '</td>';
|
print '<td>';
|
||||||
if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
print '</tr></table>';
|
print '</td>';
|
||||||
print '</td><td>';
|
if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
if($action == 'actualizemulticurrencyrate') {
|
print '</tr></table>';
|
||||||
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
print '</td><td>';
|
||||||
}
|
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate?'multicurrency_tx':'none'), $object->multicurrency_code);
|
if($action == 'actualizemulticurrencyrate') {
|
||||||
} else {
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
}
|
||||||
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate?'multicurrency_tx':'none'), $object->multicurrency_code);
|
||||||
print '<div class="inline-block"> ';
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
print '</div>';
|
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
@ -4099,7 +4111,7 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$displayWarranty = false;
|
$displayWarranty = false;
|
||||||
if( ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY)) ) )
|
if (($object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY))))
|
||||||
{
|
{
|
||||||
// Check if this situation invoice is 100% for real
|
// Check if this situation invoice is 100% for real
|
||||||
if(!empty($object->situation_final) && !empty($object->lines)){
|
if(!empty($object->situation_final) && !empty($object->lines)){
|
||||||
@ -4179,9 +4191,7 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($displayWarranty)
|
||||||
|
|
||||||
if($displayWarranty)
|
|
||||||
{
|
{
|
||||||
// Retained Warranty payment date limit
|
// Retained Warranty payment date limit
|
||||||
print '<tr class="retained-warranty-lines" ><td>';
|
print '<tr class="retained-warranty-lines" ><td>';
|
||||||
@ -5024,7 +5034,7 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
if (! $objectidnext && count($object->lines) > 0)
|
if (! $objectidnext && count($object->lines) > 0)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -896,7 +896,7 @@ class FactureRec extends CommonInvoice
|
|||||||
* @param int $date_start_fill 1=Flag to fill start date when generating invoice
|
* @param int $date_start_fill 1=Flag to fill start date when generating invoice
|
||||||
* @param int $date_end_fill 1=Flag to fill end date when generating invoice
|
* @param int $date_end_fill 1=Flag to fill end date when generating invoice
|
||||||
* @param int $fk_fournprice Id of origin supplier price
|
* @param int $fk_fournprice Id of origin supplier price
|
||||||
* @param int $pa_ht Price (without tax) of product when it was bought
|
* @param int $pa_ht Price (without tax) of product for margin calculation
|
||||||
* @return int <0 if KO, Id of line if OK
|
* @return int <0 if KO, Id of line if OK
|
||||||
*/
|
*/
|
||||||
public function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = null, $pa_ht = 0)
|
public function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = null, $pa_ht = 0)
|
||||||
@ -920,8 +920,9 @@ class FactureRec extends CommonInvoice
|
|||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
if (empty($info_bits)) $info_bits=0;
|
if (empty($info_bits)) $info_bits=0;
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht = price2num($pu_ht);
|
||||||
$pu_ttc=price2num($pu_ttc);
|
$pu_ttc = price2num($pu_ttc);
|
||||||
|
$pu_ht_devise = price2num($pu_ht_devise);
|
||||||
$txtva=price2num($txtva);
|
$txtva=price2num($txtva);
|
||||||
$txlocaltax1 = price2num($txlocaltax1);
|
$txlocaltax1 = price2num($txlocaltax1);
|
||||||
$txlocaltax2 = price2num($txlocaltax2);
|
$txlocaltax2 = price2num($txlocaltax2);
|
||||||
@ -1258,7 +1259,7 @@ class FactureRec extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id;
|
$url = DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$this->id;
|
||||||
|
|
||||||
if ($short) return $url;
|
if ($short) return $url;
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,7 @@ function invoice_rec_prepare_head($object)
|
|||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card-rec.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("CardBill");
|
$head[$h][1] = $langs->trans("CardBill");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -1393,19 +1393,41 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
*
|
*
|
||||||
* @param User $user User making the clone
|
* @param User $user User making the clone
|
||||||
|
* @param int $socid Id of thirdparty
|
||||||
* @return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
public function createFromClone(User $user)
|
public function createFromClone(User $user, $socid = 0)
|
||||||
{
|
{
|
||||||
global $hookmanager;
|
global $conf, $user,$hookmanager;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
// get lines so they will be clone
|
||||||
|
foreach($this->lines as $line)
|
||||||
|
$line->fetch_optionals();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$objFrom = clone $this;
|
$objFrom = clone $this;
|
||||||
|
|
||||||
|
// Change socid if needed
|
||||||
|
if (! empty($socid) && $socid != $this->socid)
|
||||||
|
{
|
||||||
|
$objsoc = new Societe($this->db);
|
||||||
|
|
||||||
|
if ($objsoc->fetch($socid)>0)
|
||||||
|
{
|
||||||
|
$this->socid = $objsoc->id;
|
||||||
|
$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
|
||||||
|
$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
|
||||||
|
$this->fk_project = 0;
|
||||||
|
$this->fk_delivery_address = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO Change product price if multi-prices
|
||||||
|
}
|
||||||
|
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
$this->statut=self::STATUS_DRAFT;
|
$this->statut=self::STATUS_DRAFT;
|
||||||
|
|
||||||
|
|||||||
@ -963,7 +963,9 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$result=$object->createFromClone($user);
|
$orig = clone $object;
|
||||||
|
|
||||||
|
$result=$object->createFromClone($user, $socid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
|
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
|
||||||
@ -972,6 +974,7 @@ if (empty($reshook))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$object = $orig;
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1789,7 +1792,7 @@ elseif (! empty($object->id))
|
|||||||
{
|
{
|
||||||
// Create an array for form
|
// Create an array for form
|
||||||
$formquestion=array(
|
$formquestion=array(
|
||||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1)
|
array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.fournisseur=1)'))
|
||||||
);
|
);
|
||||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||||
@ -2068,7 +2071,7 @@ elseif (! empty($object->id))
|
|||||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencycode' && $object->statut == CommandeFournisseur::STATUS_DRAFT)
|
if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT)
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
@ -2080,29 +2083,33 @@ elseif (! empty($object->id))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
print '<tr>';
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
print '<td>';
|
{
|
||||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
print '<tr>';
|
||||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
print '<td>';
|
||||||
print '</td>';
|
print '<table class="nobordernopadding centpercent"><tr>';
|
||||||
if ($action != 'editmulticurrencyrate' && $object->statut == CommandeFournisseur::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
print '<td>';
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
print '</tr></table>';
|
print '</td>';
|
||||||
print '</td><td>';
|
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
if($action == 'actualizemulticurrencyrate') {
|
print '</tr></table>';
|
||||||
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
print '</td><td>';
|
||||||
}
|
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
if($action == 'actualizemulticurrencyrate') {
|
||||||
} else {
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
}
|
||||||
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
print '<div class="inline-block"> ';
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
print '</div>';
|
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
@ -2891,8 +2898,6 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -2557,7 +2557,7 @@ else
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencycode' && $object->statut == FactureFournisseur::STATUS_DRAFT)
|
if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT)
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&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 colspan="3">';
|
||||||
@ -2569,29 +2569,32 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
print '<tr>';
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
print '<td>';
|
{
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<tr>';
|
||||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
print '<td>';
|
||||||
print '</td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
if ($action != 'editmulticurrencyrate' && $object->statut == FactureFournisseur::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '</td>';
|
||||||
print '</tr></table>';
|
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||||
print '</td><td colspan="3">';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
print '</tr></table>';
|
||||||
if ($action == 'actualizemulticurrencyrate') {
|
print '</td><td colspan="3">';
|
||||||
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||||
}
|
if ($action == 'actualizemulticurrencyrate') {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
} else {
|
}
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
} else {
|
||||||
print '<div class="inline-block"> ';
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
print '</div>';
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
|
|||||||
@ -93,6 +93,8 @@ if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$ob
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'mymodule', $object->id);
|
//$result = restrictedArea($user, 'mymodule', $object->id);
|
||||||
|
|
||||||
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -156,7 +158,7 @@ if ($object->id > 0)
|
|||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->mymodule->creer)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
|||||||
@ -105,11 +105,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
|||||||
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
|
||||||
//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
$permissionnote = $user->rights->mymodule->write; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->mymodule->write; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php
|
||||||
$permissionedit = $user->rights->mymodule->write; // Used by the include of actions_lineupdown.inc.php
|
$permissionedit = $user->rights->mymodule->myobject->write; // Used by the include of actions_lineupdown.inc.php
|
||||||
$permissiontoadd = $user->rights->mymodule->write; // Used by the include of actions_addupdatedelete.inc.php
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
$permissiontodelete = $user->rights->mymodule->delete || ($permissiontoadd && $object->status == 0);
|
$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && $object->status == 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -319,8 +319,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
/*
|
/*
|
||||||
// Ref bis
|
// Ref bis
|
||||||
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->myobject->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->myobject->creer, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
@ -328,7 +328,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->mymodule->write)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
@ -451,13 +451,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||||
|
|
||||||
// Back to draft
|
// Back to draft
|
||||||
if (! empty($user->rights->mymodule->write) && $object->status == BOM::STATUS_VALIDATED)
|
if (! empty($user->rights->mymodule->myobject->write) && $object->status == BOM::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=setdraft">' . $langs->trans("SetToDraft") . '</a>';
|
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=setdraft">' . $langs->trans("SetToDraft") . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if (! empty($user->rights->mymodule->write))
|
if (! empty($user->rights->mymodule->myobject->write))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||||
}
|
}
|
||||||
@ -467,13 +467,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if (! empty($user->rights->mymodule->write))
|
if (! empty($user->rights->mymodule->myobject->write))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=order">' . $langs->trans("ToClone") . '</a>'."\n";
|
print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=order">' . $langs->trans("ToClone") . '</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($user->rights->mymodule->write)
|
if ($user->rights->mymodule->myobject->write)
|
||||||
{
|
{
|
||||||
if ($object->status == 1)
|
if ($object->status == 1)
|
||||||
{
|
{
|
||||||
@ -487,7 +487,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||||
if (! empty($user->rights->mymodule->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mymodule->write)))
|
if (! empty($user->rights->mymodule->myobject->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mymodule->myobject->write)))
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||||
}
|
}
|
||||||
@ -515,8 +515,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$relativepath = $objref . '/' . $objref . '.pdf';
|
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||||
$filedir = $conf->mymodule->dir_output . '/' . $objref;
|
$filedir = $conf->mymodule->dir_output . '/' . $objref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
|
$genallowed = $user->rights->mymodule->myobject->read; // If you can read, you can build the PDF to read content
|
||||||
$delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
|
$delallowed = $user->rights->mymodule->myobject->create; // If you can create/edit, you can remove a file on card
|
||||||
print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,8 @@ if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$ob
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'mymodule', $object->id);
|
//$result = restrictedArea($user, 'mymodule', $object->id);
|
||||||
|
|
||||||
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -146,9 +148,9 @@ if ($object->id)
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
$modulepart = 'mymodule';
|
$modulepart = 'mymodule';
|
||||||
//$permission = $user->rights->mymodule->create;
|
//$permission = $user->rights->mymodule->myobject->write;
|
||||||
$permission = 1;
|
$permission = 1;
|
||||||
//$permtoedit = $user->rights->mymodule->create;
|
//$permtoedit = $user->rights->mymodule->myobject->write;
|
||||||
$permtoedit = 1;
|
$permtoedit = 1;
|
||||||
$param = '&id=' . $object->id;
|
$param = '&id=' . $object->id;
|
||||||
|
|
||||||
|
|||||||
@ -67,8 +67,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id;
|
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id;
|
||||||
|
|
||||||
$permissionnote=1;
|
$permissionnote=$user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
||||||
//$permissionnote=$user->rights->mymodule->creer; // Used by the include of actions_setnotes.inc.php
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->mymodule->creer)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
|||||||
@ -1572,7 +1572,7 @@ if ($action == 'create')
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmode' && $object->statut == SupplierProposal::STATUS_VALIDATED)
|
if ($action != 'editmode' && $object->statut == $object::STATUS_VALIDATED)
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
@ -1592,7 +1592,7 @@ if ($action == 'create')
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmulticurrencycode' && $object->statut == SupplierProposal::STATUS_VALIDATED)
|
if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_VALIDATED)
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&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 colspan="3">';
|
||||||
@ -1604,29 +1604,32 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Multicurrency rate
|
// Multicurrency rate
|
||||||
print '<tr>';
|
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)
|
||||||
print '<td>';
|
{
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<tr>';
|
||||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
print '<td>';
|
||||||
print '</td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
if ($action != 'editmulticurrencyrate' && $object->statut == SupplierProposal::STATUS_VALIDATED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
print '</td>';
|
||||||
print '</tr></table>';
|
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_VALIDATED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
|
||||||
print '</td><td colspan="3">';
|
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||||
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
print '</tr></table>';
|
||||||
if ($action == 'actualizemulticurrencyrate') {
|
print '</td><td colspan="3">';
|
||||||
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
|
||||||
}
|
if ($action == 'actualizemulticurrencyrate') {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
|
||||||
} else {
|
}
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
if ($object->statut == SupplierProposal::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
} else {
|
||||||
print '<div class="inline-block"> ';
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||||
print '</div>';
|
print '<div class="inline-block"> ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not for supplier proposals
|
/* Not for supplier proposals
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user