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 '
';
+ }
+
// 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 '';
- }
-
// Set to shipped
if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
print '';
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 6e5ed9de613..ffed0ec77b0 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) {
@@ -2123,7 +2134,7 @@ if (empty($reshook))
if (!GETPOST('qty')) $special_code = 3;
$line = new FactureLigne($db);
- $line->fetch(GETPOST('lineid'));
+ $line->fetch(GETPOST('lineid', 'int'));
$percent = $line->get_prev_progress($object->id);
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0)
@@ -2283,17 +2294,17 @@ if (empty($reshook))
}
}
- elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier'))
+ elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) // Update all lines of situation invoice
{
if (!$object->fetch($id) > 0) dol_print_error($db);
- if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
+ if (GETPOST('all_progress') != "")
{
$all_progress = GETPOST('all_progress', 'int');
foreach ($object->lines as $line)
{
$percent = $line->get_prev_progress($object->id);
if (floatval($all_progress) < floatval($percent)) {
- $mesg = $langs->trans("Line").' '.$i.' '.$line->ref.' : '.$langs->trans("CantBeLessThanMinPercent");
+ $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent");
setEventMessages($mesg, null, 'warnings');
$result = -1;
} else
@@ -2303,7 +2314,7 @@ if (empty($reshook))
}
elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) {
- header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition
+ header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // To show again edited page
exit();
}
@@ -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').': ';
@@ -2992,14 +3003,16 @@ if ($action == 'create')
exit();
}
$options = "";
- foreach ($facids as $facparam)
- {
- $options .= 'LibStatut(0, $facparam ['status']).')';
- $options .= ' ';
+ if (is_array($facids)) {
+ foreach ($facids as $facparam)
+ {
+ $options .= 'LibStatut(0, $facparam ['status']).')';
+ $options .= ' ';
+ }
}
print '';
@@ -4240,7 +4253,7 @@ elseif ($id > 0 || !empty($ref))
}
else
{
- print $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none');
+ $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none');
if (!$displayWarranty) {
print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" ');
}
@@ -4557,7 +4570,7 @@ elseif ($id > 0 || !empty($ref))
print '';
// Payments already done (from payment on this invoice)
- $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
+ $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,';
$sql .= ' c.code as payment_code, c.libelle as payment_label,';
$sql .= ' pf.amount,';
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
@@ -4583,7 +4596,7 @@ elseif ($id > 0 || !empty($ref))
$paymentstatic->id = $objp->rowid;
$paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = $objp->ref;
- $paymentstatic->num_paiement = $objp->num_paiement;
+ $paymentstatic->num_payment = $objp->num_payment;
$paymentstatic->payment_code = $objp->payment_code;
print ' ';
@@ -4591,7 +4604,7 @@ elseif ($id > 0 || !empty($ref))
print ' ';
print ''.dol_print_date($db->jdate($objp->dp), 'dayhour').' ';
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
- print ''.$label.' '.$objp->num_paiement.' ';
+ print ''.$label.' '.$objp->num_payment.' ';
if (!empty($conf->banque->enabled))
{
$bankaccountstatic->id = $objp->baid;
@@ -5082,21 +5095,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 +5121,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/compta/paiement.php b/htdocs/compta/paiement.php
index 67da7f0d766..5b297eed309 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -637,7 +637,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
- print '';
+ print ' ';
print '';
print $invoice->getNomUrl(1, '');
@@ -715,7 +715,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
// Price
- print ' id == $facid) ? ' style="font-weight: bold" ' : '').'>'.price($sign * $objp->total_ttc).' ';
+ print ''.price($sign * $objp->total_ttc).' ';
// Received or paid back
print ''.price($sign * $paiement);
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 7d344717514..4136cef1be5 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -309,7 +309,7 @@ class Conf
{
if (!empty($this->$module->enabled))
{
- foreach ($dirs as $type => $name)
+ foreach ($dirs as $type => $name) // $type is 'output' or 'temp'
{
$subdir = ($type == 'temp' ? '/temp' : '');
// For multicompany sharings
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6c5a049597e..4e55a219d38 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4515,7 +4515,8 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
/**
* Function that return a number with universal decimal format (decimal separator is '.') from an amount typed by a user.
- * Function to use on each input amount before any numeric test or database insert
+ * Function to use on each input amount before any numeric test or database insert. A better name for this function
+ * should be text2num().
*
* @param float $amount Amount to convert/clean
* @param string $rounding ''=No rounding
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/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 53ccf3d4d58..e9198ebcc91 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -606,7 +606,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$multicurrency_remaintopay = price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits, 'MT');
}
- print ' ';
+ print ' ';
// Ref
print '';
@@ -619,7 +619,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Date
if ($objp->df > 0)
{
- print ' ';
+ print ' ';
print dol_print_date($db->jdate($objp->df), 'day').' ';
}
else
@@ -630,7 +630,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Date Max Payment
if ($objp->dlr > 0)
{
- print '';
+ print ' ';
print dol_print_date($db->jdate($objp->dlr), 'day');
if ($invoice->hasDelay())
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 011bb0b613d..020e61f721a 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1766,6 +1766,7 @@ GoOntoUserCardToAddMore=Go to the tab "Notifications" of a user to add or remove
GoOntoContactCardToAddMore=Go to the tab "Notifications" of a third party to add or remove notifications for contacts/addresses
Threshold=Threshold
BackupDumpWizard=Wizard to build the backup file
+BackupZipWizard=Wizard to archive the documents
SomethingMakeInstallFromWebNotPossible=Installation of external module is not possible from the web interface for the following reason:
SomethingMakeInstallFromWebNotPossible2=For this reason, process to upgrade described here is a manual process only a privileged user may perform.
InstallModuleFromWebHasBeenDisabledByFile=Install of external module from application has been disabled by your administrator. You must ask him to remove the file %s to allow this feature.
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