diff --git a/.gitignore b/.gitignore
index 30151359365..f39d19b1208 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ default.properties
.DS_Store
.idea
*.iml
+*.orig
Thumbs.db
/dolibarr_genesis.mp4
# Log files
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index b71c633b1e5..6c15fd6615c 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -87,6 +87,7 @@ if (empty($search_date_start) && !GETPOSTISSET('formfilteraction'))
} else {
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
$year_start = dol_print_date(dol_now(), '%Y');
+ if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)
diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php
index c8c082db6ae..b017230c677 100644
--- a/htdocs/admin/accountant.php
+++ b/htdocs/admin/accountant.php
@@ -66,6 +66,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
if ($action != 'updateedit' && !$error)
{
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 00bd17e865f..02091124b15 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -256,6 +256,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
if (!$error)
{
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
$db->commit();
}
else
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index cce441c4052..92675cbc883 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -577,6 +577,7 @@ if ($id == 11)
// 'contract' => $langs->trans('Contract'),
'project' => $langs->trans('Project'),
'project_task' => $langs->trans('Task'),
+ 'ticket' => $langs->trans('Ticket'),
'agenda' => $langs->trans('Agenda'),
'dolresource' => $langs->trans('Resource'),
// old deprecated
@@ -1454,6 +1455,7 @@ if ($id)
foreach ($fieldlist as $field => $value)
{
//var_dump($fieldlist);
+
$class = '';
$showfield = 1;
$valuetoshow = $obj->{$fieldlist[$field]};
diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php
index d4886bb2a57..05e0658d1d7 100644
--- a/htdocs/admin/openinghours.php
+++ b/htdocs/admin/openinghours.php
@@ -57,6 +57,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
if ($action != 'updateedit' && !$error)
{
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php
index b1124e88add..22bd07155d8 100644
--- a/htdocs/admin/system/filecheck.php
+++ b/htdocs/admin/system/filecheck.php
@@ -273,7 +273,7 @@ if (!$error && $xml)
}
else
{
- $out .= '
| '.$langs->trans("None").' |
';
+ $out .= '| '.$langs->trans("None").' |
';
}
$out .= '';
$out .= '';
@@ -328,7 +328,7 @@ if (!$error && $xml)
}
else
{
- $out .= '| '.$langs->trans("None").' |
';
+ $out .= '| '.$langs->trans("None").' |
';
}
$out .= '';
$out .= '';
@@ -383,7 +383,7 @@ if (!$error && $xml)
}
else
{
- $out .= '| '.$langs->trans("None").' |
';
+ $out .= '| '.$langs->trans("None").' |
';
}
$out .= '';
$out .= '';
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 591e9a69d88..2507f0cfa97 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -185,6 +185,8 @@ if (empty($reshook))
unset($_POST['disable_stock_change']);
$object->fetchLines();
+
+ $object->calculateCosts();
}
}
}
@@ -196,7 +198,7 @@ if (empty($reshook))
$error = 0;
// Set if we used free entry or predefined product
- $qty = price2num(GETPOST('qty', 'int'));
+ $qty = price2num(GETPOST('qty', 'alpha'));
$qty_frozen = GETPOST('qty_frozen', 'int');
$disable_stock_change = GETPOST('disable_stock_change', 'int');
$efficiency = price2num(GETPOST('efficiency', 'int'));
@@ -227,6 +229,8 @@ if (empty($reshook))
unset($_POST['disable_stock_change']);
$object->fetchLines();
+
+ $object->calculateCosts();
}
}
}
diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php
index eeffb625381..20d523ff512 100644
--- a/htdocs/bom/tpl/objectline_create.tpl.php
+++ b/htdocs/bom/tpl/objectline_create.tpl.php
@@ -116,7 +116,6 @@ if ($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '';
- print $form->selectUnits($line->fk_unit, "units");
print ' | ';
}
diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php
index 3840f495dea..31a4b1ee008 100644
--- a/htdocs/bom/tpl/objectline_edit.tpl.php
+++ b/htdocs/bom/tpl/objectline_edit.tpl.php
@@ -112,7 +112,6 @@ if ($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '';
- print $form->selectUnits($line->fk_unit, "units");
print ' | ';
}
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index e1e94dc2076..c9770465458 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -82,7 +82,7 @@ print '';
if ($conf->global->PRODUCT_USE_UNITS)
{
print '';
- $label = $line->getLabelOfUnit('short');
+ $label = $tmpproduct->getLabelOfUnit('short');
if ($label !== '') {
print $langs->trans($label);
}
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index d3dec6fde82..1cfd72d26cc 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -277,10 +277,8 @@ print ' | ';
// Bank account
if (!empty($conf->banque->enabled))
{
- if ($object->fk_account > 0)
- {
- if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0)
- {
+ if ($object->fk_account > 0) {
+ if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php');
$bordereau = new RemiseCheque($db);
$bordereau->fetch($bankline->fk_bordereau);
@@ -297,7 +295,12 @@ if (!empty($conf->banque->enabled))
print '';
print '| '.$langs->trans('BankTransactionLine').' | ';
print '';
- print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
+ if ($object->fk_account > 0) {
+ print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
+ } else {
+ $langs->load("admin");
+ print ''.$langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name")).'';
+ }
print ' | ';
print '
';
}
diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php
index 509e20f3613..715a0851c65 100644
--- a/htdocs/compta/paiement_charge.php
+++ b/htdocs/compta/paiement_charge.php
@@ -224,7 +224,7 @@ if ($action == 'create')
print '| '.$langs->trans("Date").' | ';
$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
- $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : 0;
+ $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : '';
print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1);
print " | ";
print '
';
diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php
index 8574b7ce01b..8008d731a1a 100644
--- a/htdocs/core/boxes/box_shipments.php
+++ b/htdocs/core/boxes/box_shipments.php
@@ -106,6 +106,7 @@ class box_shipments extends ModeleBoxes
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql .= " AND e.fk_statut = 1";
+ if ($user->socid > 0) $sql.= " AND s.rowid = ".$user->socid;
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND sc.fk_user = ".$user->id;
else $sql .= " ORDER BY e.date_delivery, e.ref DESC ";
$sql .= $this->db->plimit($max, 0);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 023ade28052..6921f9f967a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4725,7 +4725,7 @@ function price2num($amount, $rounding = '', $option = 0)
if ($option != 1) { // If not a PHP number or unknown, we change or clean format
//print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'
';
if (!is_numeric($amount)) {
- $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>]/', '', $amount);
+ $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount);
}
if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come frominput data, so 1.123 is 1123
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index f8b7908654b..3c7c74d0362 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -343,7 +343,7 @@ class pdf_strato extends ModelePDFContract
}
$txtpredefinedservice = '';
- $txtpredefinedservice = $objectligne->product_label;
+ $txtpredefinedservice = $objectligne->product_ref;
if ($objectligne->product_label)
{
$txtpredefinedservice .= ' - ';
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index 2e0733f1ba2..43a7a9ba11f 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -373,14 +373,15 @@ class pdf_rouget extends ModelePdfExpedition
$tab_top_alt = $tab_top;
$pdf->SetFont('', 'B', $default_font_size - 2);
- $pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
- $tab_top_alt = $pdf->GetY();
//$tab_top_alt += 1;
// Tracking number
if (!empty($object->tracking_number))
{
+ $pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
+ $tab_top_alt = $pdf->GetY();
+
$object->getUrlTrackingStatus($object->tracking_number);
if (!empty($object->tracking_url))
{
diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php
index 186caca619a..592dd23388e 100644
--- a/htdocs/core/modules/mrp/mod_mo_advanced.php
+++ b/htdocs/core/modules/mrp/mod_mo_advanced.php
@@ -68,7 +68,7 @@ class mod_mo_advanced extends ModeleNumRefMos
$texte .= '