diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c1dfd1ae43b..7da9fcca7d1 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2542,6 +2542,11 @@ if ($action == 'create' && $usercancreate) // Note that $action and $object may be modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); if (empty($reshook)) { + // Reopen a closed order + if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) { + print '
'.$langs->trans('ReOpen').'
'; + } + // Send if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($usercansend) { @@ -2619,11 +2624,6 @@ if ($action == 'create' && $usercancreate) } } - // Reopen a closed order - if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) { - print '
'.$langs->trans('ReOpen').'
'; - } - // Set to shipped if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) { print '
'.$langs->trans('ClassifyShipped').'
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6e5ed9de613..3057d5ebe11 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -103,7 +103,9 @@ $extrafields = new ExtraFields($db); // Load object if ($id > 0 || !empty($ref)) { - $ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); + if ($action != 'add') { + $ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); + } } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -134,6 +136,7 @@ if ($user->socid) $socid = $user->socid; $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft); + /* * Actions */ @@ -941,11 +944,13 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); + $action = 'create'; } if (!($_POST['fac_replacement'] > 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); + $action = 'create'; } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); @@ -992,6 +997,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors'); + $action = 'create'; } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); @@ -999,6 +1005,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); + $action = 'create'; } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); @@ -1181,6 +1188,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); + $action = 'create'; } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); @@ -1223,6 +1231,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); + $action = 'create'; } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); @@ -1230,6 +1239,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); + $action = 'create'; } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); @@ -1642,6 +1652,7 @@ if (empty($reshook)) $error++; $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("InvoiceSituation")); setEventMessages($mesg, null, 'errors'); + $action = 'create'; } if (!$error) { @@ -2939,7 +2950,7 @@ if ($action == 'create') if (($origin == 'propal') || ($origin == 'commande')) { print ''; - $arraylist = array('amount' => $langs->transnoentitiesnoconv('FixAmount'), 'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit'))); + $arraylist = array('amount' => $langs->transnoentitiesnoconv('FixAmount', $langs->transnoentitiesnoconv('Deposit')), 'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit'))); print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); print ''; print ''.$langs->trans('Value').':'; @@ -5082,21 +5093,6 @@ elseif ($id > 0 || !empty($ref)) } } - // Clone - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate) - { - print ''.$langs->trans("ToClone").''; - } - - // Clone as predefined / Create template - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $usercancreate) - { - if (!$objectidnext && count($object->lines) > 0) - { - print ''.$langs->trans("ChangeIntoRepeatableInvoice").''; - } - } - // Create a credit note if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) { @@ -5123,6 +5119,21 @@ elseif ($id > 0 || !empty($ref)) } } + // Clone + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate) + { + print ''.$langs->trans("ToClone").''; + } + + // Clone as predefined / Create template + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $usercancreate) + { + if (!$objectidnext && count($object->lines) > 0) + { + print ''.$langs->trans("ChangeIntoRepeatableInvoice").''; + } + } + // Remove situation from cycle if ($object->statut > Facture::STATUS_DRAFT && $object->type == Facture::TYPE_SITUATION diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 12bb5053a46..408a2a6f5b2 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -135,7 +135,13 @@ else echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { if (!empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); - echo $text.' '.dol_htmlentitiesbr($line->description); + if (preg_match('/^\(DEPOSIT\)/', $line->description)) { + $newdesc = preg_replace('/^\(DEPOSIT\)/', $langs->trans("Deposit"), $line->description); + echo $text.' '.dol_htmlentitiesbr($newdesc); + } + else { + echo $text.' '.dol_htmlentitiesbr($line->description); + } } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 9872874a1d0..d7a258b517e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1845,7 +1845,7 @@ if ($action == 'create') if (($origin == 'propal') || ($origin == 'commande')) { print ''; - $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); + $arraylist = array('amount' => $langs->transnoentitiesnoconv('FixAmount', $langs->transnoentitiesnoconv('Deposit')), 'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit'))); print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); print ''; print '' . $langs->trans('Value') . ':'; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index e6ea4390fd8..83ebdece24b 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -416,7 +416,7 @@ PaymentConditionShort14D=14 days PaymentCondition14D=14 days PaymentConditionShort14DENDMONTH=14 days of month-end PaymentCondition14DENDMONTH=Within 14 days following the end of the month -FixAmount=Fixed amount +FixAmount=Fixed amount - 1 line with label '%s' VarAmount=Variable amount (%% tot.) VarAmountOneLine=Variable amount (%% tot.) - 1 line with label '%s' # PaymentType