diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index 2a4a18a15ce..2b7e624676f 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -326,7 +326,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
- print '
'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).' | ';
+ $cursormonth = $j;
+ if ($cursormonth > 12) {
+ $cursormonth -= 12;
+ }
+ $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
+ $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
+
+ print '';
+ if (!empty($tmp['mday'])) {
+ $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
+ $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
+ print '';
+ }
+ print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
+ if (!empty($tmp['mday'])) {
+ print '';
+ }
+ print ' | ';
}
print ''.$langs->trans("Total").' | ';
@@ -366,7 +383,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
- print '| ';
+ print ' |
';
+ print '| ';
if ($row[0] == 'tobind') {
print ''.$langs->trans("Unknown").'';
} else {
@@ -380,14 +398,28 @@ if ($resql) {
print $row[1];
}
print ' | ';
- for ($i = 2; $i <= 12; $i++) {
- print ''.price($row[$i]).' | ';
+ for ($i = 2; $i <= 13; $i++) {
+ $cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
+ if ($cursormonth > 12) {
+ $cursormonth -= 12;
+ }
+ $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
+ $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
+
+ print '';
+ print price($row[$i]);
+ print ' | ';
}
- print ''.price($row[13]).' | ';
print ''.price($row[14]).' | ';
print '
';
}
$db->free($resql);
+
+ if ($num == 0) {
+ print '| ';
+ print ''.$langs->trans("NoRecordFound").'';
+ print ' |
';
+ }
} else {
print $db->lasterror(); // Show last sql error
}
@@ -410,7 +442,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
- print ''.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).' | ';
+ $cursormonth = $j;
+ if ($cursormonth > 12) {
+ $cursormonth -= 12;
+ }
+ $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
+ $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
+
+ print '';
+ if (!empty($tmp['mday'])) {
+ $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
+ $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
+ print '';
+ }
+ print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
+ if (!empty($tmp['mday'])) {
+ print '';
+ }
+ print ' | ';
}
print ''.$langs->trans("Total").' | ';
@@ -450,7 +499,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
- print '| ';
+ print ' |
';
+ print '| ';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
} else {
@@ -466,14 +516,28 @@ if ($resql) {
}
print ' | ';
- for ($i = 2; $i <= 12; $i++) {
- print ''.price($row[$i]).' | ';
+ for ($i = 2; $i <= 13; $i++) {
+ $cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
+ if ($cursormonth > 12) {
+ $cursormonth -= 12;
+ }
+ $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
+ $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
+
+ print '';
+ print price($row[$i]);
+ print ' | ';
}
- print ''.price($row[13]).' | ';
print ''.price($row[14]).' | ';
print '
';
}
$db->free($resql);
+
+ if ($num == 0) {
+ print '| ';
+ print ''.$langs->trans("NoRecordFound").'';
+ print ' |
';
+ }
} else {
print $db->lasterror(); // Show last sql error
}
diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php
index e9efb5f23b3..61b942e99bd 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -204,7 +204,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
- print '| ';
+ print ' |
';
+ print '| ';
if ($row[0] == 'tobind') {
print ''.$langs->trans("Unknown").'';
} else {
@@ -218,10 +219,11 @@ if ($resql) {
print $row[1];
}
print ' | ';
- for ($i = 2; $i <= 12; $i++) {
- print ''.price($row[$i]).' | ';
+ for ($i = 2; $i <= 13; $i++) {
+ print '';
+ print price($row[$i]);
+ print ' | ';
}
- print ''.price($row[13]).' | ';
print ''.price($row[14]).' | ';
print '
';
}
@@ -283,7 +285,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
- print '| ';
+ print ' |
';
+ print '| ';
if ($row[0] == 'tobind') {
print ''.$langs->trans("Unknown").'';
} else {
@@ -298,10 +301,11 @@ if ($resql) {
print $row[1];
}
print ' | ';
- for ($i = 2; $i <= 12; $i++) {
- print ''.price($row[$i]).' | ';
+ for ($i = 2; $i <= 13; $i++) {
+ print '';
+ print price($row[$i]);
+ print ' | ';
}
- print ''.price($row[13]).' | ';
print ''.price($row[14]).' | ';
print '
';
}
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index 1038fd25e57..406701d2500 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -321,7 +321,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
- print ''.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).' | ';
+ $cursormonth = $j;
+ if ($cursormonth > 12) {
+ $cursormonth -= 12;
+ }
+ $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
+ $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
+
+ print '';
+ if (!empty($tmp['mday'])) {
+ $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
+ $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
+ print '';
+ }
+ print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
+ if (!empty($tmp['mday'])) {
+ print '';
+ }
+ print ' | ';
}
print ''.$langs->trans("Total").' | ';
@@ -356,7 +373,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
- print '| ';
+ print ' |
';
+ print '| ';
if ($row[0] == 'tobind') {
print ''.$langs->trans("Unknown").'';
} else {
@@ -370,14 +388,21 @@ if ($resql) {
print $row[1];
}
print ' | ';
- for ($i = 2; $i <= 12; $i++) {
- print ''.price($row[$i]).' | ';
+ for ($i = 2; $i <= 13; $i++) {
+ print '';
+ print price($row[$i]);
+ print ' | ';
}
- print ''.price($row[13]).' | ';
print ''.price($row[14]).' | ';
print '
';
}
$db->free($resql);
+
+ if ($num == 0) {
+ print '| ';
+ print ''.$langs->trans("NoRecordFound").'';
+ print ' |
';
+ }
} else {
print $db->lasterror(); // Show last sql error
}
@@ -400,7 +425,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
- print ''.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).' | ';
+ $cursormonth = $j;
+ if ($cursormonth > 12) {
+ $cursormonth -= 12;
+ }
+ $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
+ $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
+
+ print '';
+ if (!empty($tmp['mday'])) {
+ $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
+ $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
+ print '';
+ }
+ print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
+ if (!empty($tmp['mday'])) {
+ print '';
+ }
+ print ' | ';
}
print ''.$langs->trans("Total").' | ';
@@ -435,7 +477,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
- print '| ';
+ print ' |
';
+ print '| ';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
} else {
@@ -449,14 +492,21 @@ if ($resql) {
print $row[1];
}
print ' | ';
- for ($i = 2; $i <= 12; $i++) {
- print ''.price($row[$i]).' | ';
+ for ($i = 2; $i <= 13; $i++) {
+ print '';
+ print price($row[$i]);
+ print ' | ';
}
- print ''.price($row[13]).' | ';
print ''.price($row[14]).' | ';
print '
';
}
$db->free($resql);
+
+ if ($num == 0) {
+ print '| ';
+ print ''.$langs->trans("NoRecordFound").'';
+ print ' |
';
+ }
} else {
print $db->lasterror(); // Show last sql error
}