diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php
index e80654f49ae..a7fedabd644 100755
--- a/htdocs/compta/journal/purchasesjournal.php
+++ b/htdocs/compta/journal/purchasesjournal.php
@@ -54,8 +54,8 @@ $html=new Form($db);
$year_current = strftime("%Y",dol_now());
$pastmonth = strftime("%m",dol_now()) - 1;
-$pastmonthyear = $year_current;
-if ($pastmonth == 0)
+$pastmonthyear = $year_current;
+if ($pastmonth == 0)
{
$pastmonth = 12;
$pastmonthyear--;
@@ -156,17 +156,6 @@ foreach ($tabfac as $key => $val)
$invoicestatic->ref=$val["ref"];
$invoicestatic->type=$val["type"];
- print "
";
- // third party
- //print "| ".$conf->global->COMPTA_JOURNAL_BUY." | ";
- print "".$val["date"]." | ";
- print "".$invoicestatic->getNomUrl(1)." | ";
-
- foreach ($tabttc[$key] as $k => $mt)
- {
- print "".$k." | ".$langs->trans("ThirdParty")." | ".($mt>=0?price($mt):'')." | ".($mt<0?-price(-$mt):'')." | ";
- }
- print "
";
// product
foreach ($tabht[$key] as $k => $mt)
{
@@ -176,7 +165,10 @@ foreach ($tabfac as $key => $val)
//print "".$conf->global->COMPTA_JOURNAL_BUY." | ";
print "".$val["date"]." | ";
print "".$invoicestatic->getNomUrl(1)." | ";
- print "".$k." | ".$langs->trans("Products")." | ".($mt<0?price(-$mt):'')." | ".($mt>=0?price($mt):'')." | ";
+ print "".$k." | ".$langs->trans("Products")." | ";
+ print ''.($mt>=0?price($mt):'')." | ";
+ print ''.($mt<0?price(-$mt):'')." | ";
+ print "";
}
}
// vat
@@ -189,9 +181,24 @@ foreach ($tabfac as $key => $val)
//print "".$conf->global->COMPTA_JOURNAL_BUY." | ";
print "".$val["date"]." | ";
print "".$invoicestatic->getNomUrl(1)." | ";
- print "".$k." | ".$langs->trans("VAT")." ".$key." | ".($mt<0?price(-$mt):'')." | ".($mt>=0?price($mt):'')." | ";
+ print "".$k." | ".$langs->trans("VAT")." ".$key." | ";
+ print ''.($mt>=0?price($mt):'')." | ";
+ print ''.($mt<0?price(-$mt):'')." | ";
+ print "";
}
}
+ print "";
+ // third party
+ //print "| ".$conf->global->COMPTA_JOURNAL_BUY." | ";
+ print "".$val["date"]." | ";
+ print "".$invoicestatic->getNomUrl(1)." | ";
+ foreach ($tabttc[$key] as $k => $mt)
+ {
+ print "".$k." | ".$langs->trans("ThirdParty")." | ";
+ print ''.($mt<0?-price(-$mt):'')." | ";
+ print ''.($mt>=0?price($mt):'')." | ";
+ }
+ print "
";
$var = !$var;
}