From 7dd06a1ae6603a6ea932c75c49aa7b3104d8ac0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Dec 2016 02:01:27 +0100 Subject: [PATCH] Fix margin pagination --- htdocs/compta/resultat/index.php | 14 +++++++------- htdocs/compta/stats/casoc.php | 8 ++++---- htdocs/compta/stats/index.php | 10 +++++----- htdocs/core/lib/report.lib.php | 5 +---- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/customerMargins.php | 2 +- htdocs/margin/productMargins.php | 16 +++++----------- 7 files changed, 24 insertions(+), 33 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 62ef55fb711..74b80ec0e82 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -646,7 +646,7 @@ print ' '; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + print ''; print ''; print $annee; if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1); @@ -656,8 +656,8 @@ print ''; print ''.$langs->trans("Month").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''.$langs->trans("Outcome").''; - print ''.$langs->trans("Income").''; + print ''.$langs->trans("Outcome").''; + print ''.$langs->trans("Income").''; } print ''; @@ -678,7 +678,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) if($mois>12) {$annee_decalage=$annee+1;} $case = strftime("%Y-%m",dol_mktime(12,0,0,$mois_modulo,1,$annee_decalage)); - print ' '; + print ' '; if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0) { print ''.price(price2num($decaiss_ttc[$case],'MT')).''; @@ -687,7 +687,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) } print ""; - print ' '; + print ' '; //if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0) if (isset($encaiss_ttc[$case])) { @@ -704,7 +704,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) // Total $var=!$var; $nbcols=0; -print ''.$langs->trans("TotalTTC").''; +print ''.$langs->trans("TotalTTC").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { $nbcols+=2; @@ -714,7 +714,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) print "\n"; // Empty line -print ' '; +print ' '; print ' '; print "\n"; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 26063587c5d..636c4e29d17 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -456,10 +456,10 @@ print ''; print $form->select_country($search_country, 'search_country'); //print ''; print ''; -print ' '; -print ' '; -print ' '; -print ' '; +print ' '; +print ' '; +print ' '; +print ' '; print ''; $var=true; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 8d1aceeaa77..9d942caf57a 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -197,13 +197,13 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } print ''; -print ''.$langs->trans("Month").''; +print ''.$langs->trans("Month").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - if ($modecompta == 'CREANCES-DETTES') print ''.$langs->trans("AmountHT").''; - print ''.$langs->trans("AmountTTC").''; - print ''.$langs->trans("Delta").''; - if ($annee != $year_end) print ' '; + if ($modecompta == 'CREANCES-DETTES') print ''.$langs->trans("AmountHT").''; + print ''.$langs->trans("AmountTTC").''; + print ''.$langs->trans("Delta").''; + if ($annee != $year_end) print ' '; } print ''; diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index fa05e632983..f58aa180d88 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -110,12 +110,9 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat if ($exportlink) print ''.$langs->trans("Export").''.$exportlink; print ''; - print ''; - print ''; - print ''; - print ''; + print '
'; print ''; dol_fiche_end(); diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 2675e3c95b0..a0ca6fc2206 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -168,7 +168,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',0,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,$num,''); $i = 0; print ""; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 34463db14e2..ec30f23ee98 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -205,7 +205,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',0,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,$num,''); $i = 0; print "
"; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 88570d1c1d4..eb2a2e6d2ee 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -201,7 +201,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',0,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',$num,$num,''); $moreforfilter=''; @@ -301,16 +301,10 @@ if ($result) // affichage totaux marges $var=!$var; $totalMargin = $cumul_vente - $cumul_achat; - /*if ($totalMargin < 0) - { - $marginRate = ($cumul_achat != 0)?-1*(100 * $totalMargin / $cumul_achat):''; - $markRate = ($cumul_vente != 0)?-1*(100 * $totalMargin / $cumul_vente):''; - } - else - {*/ - $marginRate = ($cumul_achat != 0)?(100 * $totalMargin / $cumul_achat):''; - $markRate = ($cumul_vente != 0)?(100 * $totalMargin / $cumul_vente):''; - //} + + $marginRate = ($cumul_achat != 0)?(100 * $totalMargin / $cumul_achat):''; + $markRate = ($cumul_vente != 0)?(100 * $totalMargin / $cumul_vente):''; + print ''; if ($id > 0) print '
';