From 553981426eaa279f7ffc66e11d1126b2ede25733 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Jul 2016 15:21:38 +0200 Subject: [PATCH] Several minor fixes in expense reports --- htdocs/core/class/html.form.class.php | 3 ++- htdocs/core/lib/functions.lib.php | 1 + .../doc/pdf_standard.modules.php | 24 ++++++++++--------- htdocs/expensereport/card.php | 4 +--- htdocs/theme/md/style.css.php | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3354aa01209..61953629166 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4262,7 +4262,8 @@ class Form } // Now we get list - $num = $this->load_cache_vatrates($code_country); + $num = $this->load_cache_vatrates($code_country); // If no vat defined, return -1 with message into this->error + if ($num > 0) { // Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '') diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 85a6ac347e8..2ae90c1f0b5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1129,6 +1129,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat=1; } // so format 'dayreduceformat' is processed like day // Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default. + // TODO Add format daysmallyear and dayhoursmallyear if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short); else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short); else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index b3dce6ee7c9..a0176ae7dda 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -105,13 +105,13 @@ class pdf_standard extends ModeleExpenseReport // Define position of columns $this->posxpiece=$this->marge_gauche+1; $this->posxcomment=$this->marge_gauche+10; - $this->posxdate=80; - $this->posxtype=97; - $this->posxprojet=116; - $this->posxtva=136; - $this->posxup=148; - $this->posxqty=166; - $this->postotalttc=178; + $this->posxdate=88; + $this->posxtype=107; + $this->posxprojet=126; + $this->posxtva=146; + $this->posxup=158; + $this->posxqty=176; + $this->postotalttc=188; if (empty($conf->projet->enabled)) { $this->posxtva-=20; $this->posxup-=20; @@ -324,7 +324,7 @@ class pdf_standard extends ModeleExpenseReport // Date $pdf->SetXY($this->posxdate, $curY); - $pdf->MultiCell($this->posxtype-$this->posxdate-0.8, 4,dol_print_date($object->lines[$i]->date,"day",false,$outputlangs), 0, 'C'); + $pdf->MultiCell($this->posxtype-$this->posxdate-0.8, 4, dol_print_date($object->lines[$i]->date,"day",false,$outputlangs), 0, 'C'); // Type $pdf->SetXY($this->posxtype, $curY); @@ -352,7 +352,7 @@ class pdf_standard extends ModeleExpenseReport // Quantity $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->postotalttc-$this->posxqty-0.8, 4,$object->lines[$i]->qty, 0, 'C'); + $pdf->MultiCell($this->postotalttc-$this->posxqty-0.8, 4,$object->lines[$i]->qty, 0, 'R'); // Total with all taxes $pdf->SetXY($this->postotalttc-1, $curY); @@ -423,6 +423,8 @@ class pdf_standard extends ModeleExpenseReport $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } + $pdf->SetFont('','', 10); + // Show total area box $posy=$bottomlasttab+5;//$nexY+95; $pdf->SetXY(100, $posy); @@ -574,7 +576,7 @@ class pdf_standard extends ModeleExpenseReport // Status Expense Report $posy+=6; $pdf->SetXY($posx,$posy); - $pdf->SetFont('','B',18); + $pdf->SetFont('','B', $default_font_size + 2); $pdf->SetTextColor(111,81,124); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $object->getLibStatut(0), '', 'R'); @@ -814,7 +816,7 @@ class pdf_standard extends ModeleExpenseReport if (empty($hidetop)) { $pdf->SetXY($this->posxqty-1, $tab_top+1); - $pdf->MultiCell($this->postotalttc-$this->posxqty,2, $outputlangs->transnoentities("Qty"),'','R'); + $pdf->MultiCell($this->postotalttc-$this->posxqty - 1,2, $outputlangs->transnoentities("Qty"),'','R'); } // Total with all taxes diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index e177312a7d6..e7089e9d4f9 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1825,9 +1825,7 @@ else print ''; $defaultvat=-1; if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; - print ''; + print $form->load_tva('vatrate', ($vatrate!=''?$vatrate:$defaultvat), $mysoc, '', 0, 0, '', false); print ''; // Unit price diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e32b53b70d4..b26bdc4f97c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2153,7 +2153,7 @@ div.tabBar table.border tr { table.border td, div.border div div.tagtd { padding: 2px 2px 2px 2px; - border: 1px solid #f4f4f4; + border: 1px solid #f0f0f0; border-collapse: collapse; }