From 126fbf9f631a3ff7d226e8719d0c3b12a8c2dc20 Mon Sep 17 00:00:00 2001
From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com>
Date: Tue, 2 Nov 2021 15:46:04 +0100
Subject: [PATCH 1/8] Change date format to be equal to mass stock transfert
---
htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +-
htdocs/product/stock/tpl/stocktransfer.tpl.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 05d628902fb..e1a5e734016 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -155,7 +155,7 @@ print '
'.$langs->trans("MovementLabel").' | ';
print '';
print '';
print ' | ';
-print ''.$langs->trans("InventoryCode").' | | ';
+print ''.$langs->trans("InventoryCode").' | | ';
print '';
print '';
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index 27c9b2acb21..711e5a0c9ac 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -130,7 +130,7 @@ print ''.$langs->trans("MovementLabel").' | ';
print '';
print '';
print ' | ';
-print ''.$langs->trans("InventoryCode").' | | ';
+print ''.$langs->trans("InventoryCode").' | | ';
print '';
print '';
From 0c1d4c9d5104717bc9957ac0cde20bba21872881 Mon Sep 17 00:00:00 2001
From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com>
Date: Tue, 2 Nov 2021 15:48:12 +0100
Subject: [PATCH 2/8] No need of escape htmltag thanks to GETPOST before
---
htdocs/product/stock/tpl/stocktransfer.tpl.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index 711e5a0c9ac..b71e1e8b248 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -124,11 +124,11 @@ if (!empty($conf->productbatch->enabled) &&
}
// Label
-$valformovementlabel = (GETPOST("label") ?GETPOST("label") : $langs->trans("MovementTransferStock", $productref));
+$valformovementlabel = (GETPOST("label") ? GETPOST("label") : $langs->trans("MovementTransferStock", $productref));
print '';
print '| '.$langs->trans("MovementLabel").' | ';
print '';
-print '';
+print '';
print ' | ';
print ''.$langs->trans("InventoryCode").' | | ';
print '
';
From 49d955b7948a1c730c519402f5c003fb5f2dfb5d Mon Sep 17 00:00:00 2001
From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com>
Date: Tue, 2 Nov 2021 15:53:57 +0100
Subject: [PATCH 3/8] Uniformization of the table code as the line above
---
htdocs/product/stock/tpl/stockcorrection.tpl.php | 5 ++++-
htdocs/product/stock/tpl/stocktransfer.tpl.php | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index e1a5e734016..e4dfd8b5d7c 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -155,7 +155,10 @@ print ''.$langs->trans("MovementLabel").' | ';
print '';
print '';
print ' | ';
-print ''.$langs->trans("InventoryCode").' | | ';
+print ''.$langs->trans("InventoryCode").' | ';
+print '';
+print '';
+print ' | ';
print '';
print '';
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index b71e1e8b248..31a3103c3eb 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -130,7 +130,10 @@ print ''.$langs->trans("MovementLabel").' | ';
print '';
print '';
print ' | ';
-print ''.$langs->trans("InventoryCode").' | | ';
+print ''.$langs->trans("InventoryCode").' | ';
+print '';
+print '';
+print ' | ';
print '';
print '';
From 973f408b6e3caa54a862b887f759279d214d487b Mon Sep 17 00:00:00 2001
From: daraelmin
Date: Wed, 3 Nov 2021 20:35:57 +0100
Subject: [PATCH 4/8] Fix default enddate subscription must be in futur
---
htdocs/adherents/subscription.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 1316a337610..839680c3874 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -943,8 +943,10 @@ if ($rowid > 0) {
}
if (!$datefrom) {
$datefrom = $object->datevalid;
- if ($object->datefin > 0) {
- $datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
+ if ($object->datefin > 0 && dol_now() > dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd') {
+ $datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
+ } else {
+ $datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
}
}
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
From 0e91b32e990e764fade7abec6e03ea6d7a605b9c Mon Sep 17 00:00:00 2001
From: daraelmin
Date: Wed, 3 Nov 2021 20:40:09 +0100
Subject: [PATCH 5/8] Update subscription.php
---
htdocs/adherents/subscription.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 839680c3874..11b3aed8f00 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -943,7 +943,7 @@ if ($rowid > 0) {
}
if (!$datefrom) {
$datefrom = $object->datevalid;
- if ($object->datefin > 0 && dol_now() > dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd') {
+ if ($object->datefin > 0 && dol_now() > dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd')) {
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} else {
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
From f9db196512ac5b405780368bc2ea2667e43db5a3 Mon Sep 17 00:00:00 2001
From: daraelmin
Date: Wed, 3 Nov 2021 22:31:45 +0100
Subject: [PATCH 6/8] Update subscription.php
---
htdocs/adherents/subscription.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 11b3aed8f00..f38562da5a0 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -943,7 +943,7 @@ if ($rowid > 0) {
}
if (!$datefrom) {
$datefrom = $object->datevalid;
- if ($object->datefin > 0 && dol_now() > dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd')) {
+ if ($object->datefin > 0 && dol_now() < dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd')) {
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} else {
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
From 586005ff2e5daf46870bb62c908052aa947cd28c Mon Sep 17 00:00:00 2001
From: stickler-ci
Date: Wed, 3 Nov 2021 21:43:30 +0000
Subject: [PATCH 7/8] Fixing style errors.
---
htdocs/adherents/subscription.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index f38562da5a0..e8a703a6efb 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -944,7 +944,7 @@ if ($rowid > 0) {
if (!$datefrom) {
$datefrom = $object->datevalid;
if ($object->datefin > 0 && dol_now() < dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd')) {
- $datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
+ $datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} else {
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
}
From 9d7f7e2090fa84ebece603aefa7fb34e7952bdb5 Mon Sep 17 00:00:00 2001
From: daraelmin
Date: Fri, 5 Nov 2021 14:03:56 +0100
Subject: [PATCH 8/8] Better condition
---
htdocs/adherents/subscription.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index e8a703a6efb..05e55206c02 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -943,7 +943,7 @@ if ($rowid > 0) {
}
if (!$datefrom) {
$datefrom = $object->datevalid;
- if ($object->datefin > 0 && dol_now() < dol_time_plus_duree(dol_time_plus_duree($object->datefin, 2 * $defaultdelay, $defaultdelayunit), -1, 'd')) {
+ if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) < dol_now()) {
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} else {
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));