diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index f1bea3bd4a1..c07f15a6ef4 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -213,8 +213,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '
' . $langs->trans("Total") . ' | ';
-$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
-$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
+$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
+$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -240,8 +240,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
- print '| ' . length_accountg($row[0]) . ' | ';
- print '' . $row[1] . ' | ';
+ print '
| ';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("Unknown");
+ }
+ else print length_accountg($row[0]);
+ print ' | ';
+ print '';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
+ }
+ else print $row[1];
+ print ' | ';
for($i = 2; $i <= 12; $i ++) {
print '' . price($row[$i]) . ' | ';
}
@@ -269,8 +281,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '' . $langs->trans("Total") . ' |
';
-$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
-$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
+$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
+$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -296,7 +308,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
- print '| ' . length_accountg($row[0]) . ' | ';
+ print '
| ';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("Unknown");
+ }
+ else print length_accountg($row[0]);
+ print ' | ';
+ print '';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
+ }
+ else print $row[1];
+ print ' | ';
print '' . $row[1] . ' | ';
for($i = 2; $i <= 12; $i ++) {
print '' . price($row[$i]) . ' | ';
@@ -363,7 +388,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
}
print "\n";
-
+
if (! empty($conf->margin->enabled)) {
print "
\n";
print '';
diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php
index b17aeedb4bd..19a0a6b5187 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -94,7 +94,7 @@ if ($action == 'validatehistory') {
}
dol_syslog('htdocs/accountancy/expensereport/index.php');
-
+
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
@@ -139,7 +139,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
-
+
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
@@ -194,8 +194,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '| ' . $langs->trans("Total") . ' | ';
-$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
-$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
+$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
+$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -217,9 +217,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
- print '| ' . length_accountg($row[0]) . ' | ';
- print '' . $row[1] . ' | ';
- for($i = 2; $i <= 12; $i ++) {
+ print '
| ';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("Unknown");
+ }
+ else print length_accountg($row[0]);
+ print ' | ';
+ print '';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
+ }
+ else print $row[1];
+ print ' | ';
+ for($i = 2; $i <= 12; $i ++) {
print '' . price($row[$i]) . ' | ';
}
print '' . price($row[13]) . ' | ';
@@ -247,8 +259,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '' . $langs->trans("Total") . ' |
';
-$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
-$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
+$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
+$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -270,9 +282,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
- print '| ' . length_accountg($row[0]) . ' | ';
- print '' . $row[1] . ' | ';
- for($i = 2; $i <= 12; $i ++) {
+ print '
| ';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("Unknown");
+ }
+ else print length_accountg($row[0]);
+ print ' | ';
+ print '';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
+ }
+ else print $row[1];
+ print ' | ';
+ for($i = 2; $i <= 12; $i ++) {
print '' . price($row[$i]) . ' | ';
}
print '' . price($row[13]) . ' | ';
@@ -292,9 +316,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
{
print '
';
print '
';
-
+
print_fiche_titre($langs->trans("OtherInfo"), '', '');
-
+
print "
\n";
print '';
print '| ' . $langs->trans("Total") . ' | ';
@@ -302,7 +326,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . ' | ';
}
print '' . $langs->trans("Total") . ' |
';
-
+
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
@@ -314,12 +338,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND er.fk_statut > 0 ";
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
-
+
dol_syslog('htdocs/accountancy/expensereport/index.php');
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
-
+
while ( $row = $db->fetch_row($resql)) {
print '| ' . $row[0] . ' | ';
for($i = 1; $i <= 12; $i ++) {
@@ -328,7 +352,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '' . price($row[13]) . ' | ';
print '
';
}
-
+
$db->free($resql);
} else {
print $db->lasterror(); // Show last sql error
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index f862feb5ba3..3dac6a23567 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -190,8 +190,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '' . $langs->trans("Total") . ' | ';
-$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
-$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
+$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
+$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -213,8 +213,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
- print '| ' . length_accountg($row[0]) . ' | ';
- print '' . $row[1] . ' | ';
+ print '
| ';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("Unknown");
+ }
+ else print length_accountg($row[0]);
+ print ' | ';
+ print '';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
+ }
+ else print $row[1];
+ print ' | ';
for($i = 2; $i <= 12; $i ++) {
print '' . price($row[$i]) . ' | ';
}
@@ -244,8 +256,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '' . $langs->trans("Total") . ' |
';
-$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
-$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
+$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
+$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -267,9 +279,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
- print '| ' . length_accountg($row[0]) . ' | ';
- print '' . $row[1] . ' | ';
- for($i = 2; $i <= 12; $i ++) {
+ print '
| ';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("Unknown");
+ }
+ else print length_accountg($row[0]);
+ print ' | ';
+ print '';
+ if ($row[0] == 'tobind')
+ {
+ print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
+ }
+ else print $row[1];
+ print ' | ';
+ for($i = 2; $i <= 12; $i ++) {
print '' . price($row[$i]) . ' | ';
}
print '' . price($row[13]) . ' | ';
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index e200f0ca7c0..757dbde1c0b 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -273,5 +273,6 @@ BookeppingLineAlreayExists=Lines already existing into bookeeping
NoJournalDefined=No journal defined
Binded=Lines bound
ToBind=Lines to bind
+UseMenuToSetBindindManualy=Autodection not possible, use menu %s to make the binding manually
WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manualy in the Ledger. It will be replaced by a more complete report in a next version.