From b3d58e95109b615b9e5471f24fdaa36277bb2902 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Jun 2016 14:36:52 +0200 Subject: [PATCH 1/5] FIX large expense note --- .../expensereport/doc/pdf_standard.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 0731b803ca3..9f405881565 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -313,11 +313,6 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-1, 3, $this->posxpiece-1, $curY, $piece_comptable, 0, 1); - // Comments - $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($this->posxcomment, $curY); - $pdf->writeHTMLCell($this->posxdate-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $object->lines[$i]->comments, 0, 1); - //nexY $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); @@ -325,6 +320,11 @@ class pdf_standard extends ModeleExpenseReport $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + // Comments + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetXY($this->posxcomment, $curY); + $pdf->writeHTMLCell($this->posxdate-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $object->lines[$i]->comments, 0, 1); + // Date $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->posxdate, $curY); @@ -562,7 +562,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetFont('','B', $default_font_size + 4); $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx,6,$langs->trans("ExpenseReport"), 0, 'L'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx,6,$langs->trans("ExpenseReport"), 0, 'R'); $pdf->SetFont('','', $default_font_size -1); @@ -570,19 +570,19 @@ class pdf_standard extends ModeleExpenseReport $posy+=8; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'L'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'R'); // Date start period $posy+=5; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?dol_print_date($object->date_debut,"day",false,$outpulangs):''), '', 'L'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?dol_print_date($object->date_debut,"day",false,$outpulangs):''), '', 'R'); // Date end period $posy+=5; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'L'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'R'); // Status Expense Report $posy+=6; From 0d62bd704e7a61d66842a7c91cf3e50a249461f9 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 22 Jun 2016 18:59:51 +0200 Subject: [PATCH 2/5] Fix: Bad column totalizing if MAIN_SHOW_HT_ON_SUMMARY activated --- htdocs/compta/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 37999567738..913942fc788 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -824,7 +824,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; $total_ttc += $obj->total_ttc; - $total += $obj->total; + $total += $obj->total_ht; $totalam += $obj->am; $var=!$var; $i++; From 3690d11ca28a1d1a368fddbf00976f44a22d3443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Jun 2016 10:48:52 +0200 Subject: [PATCH 3/5] Update pdf.lib.php --- htdocs/core/lib/pdf.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 09c8acb5b38..fb886e97eb6 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -318,15 +318,15 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) else { for ($page=$start_page; $page <= $end_page; ++$page) { - $this->setPage($page); + $pdf->setPage($page); if ($page == $start_page) { // first page - $height = $this->h - $start_y - $this->bMargin; + $height = $pdf->h - $start_y - $pdf->bMargin; } elseif ($page == $end_page) { // last page - $height = $end_y - $this->tMargin; + $height = $end_y - $pdf->tMargin; } else { - $height = $this->h - $this->tMargin - $this->bMargin; + $height = $pdf->h - $pdf->tMargin - $pdf->bMargin; } } } From c67fa4129854dc997d2b79ffe9ed7e9de5762e4e Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jun 2016 16:29:06 +0200 Subject: [PATCH 4/5] FIX : Translate group perms as it is done into user perms --- htdocs/user/group/perms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 9ffda5e96c8..fa8e31e71a1 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -315,7 +315,7 @@ if ($id) print ' '; } - $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle)); + $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); print ''.$perm_libelle. ''; print ''; From 9b50150fe8d2248fec8414c0ab2fba70802b6719 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Jun 2016 20:47:27 +0200 Subject: [PATCH 5/5] FIX #5380 --- htdocs/compta/facture/class/facture.class.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6633f196eed..591dd509701 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2208,27 +2208,32 @@ class Facture extends CommonInvoice $this->line->fk_facture=$this->id; $this->line->label=$label; // deprecated $this->line->desc=$desc; - $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + + $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->tva_tx=$txtva; $this->line->localtax1_tx=$txlocaltax1; $this->line->localtax2_tx=$txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; + + $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); // For credit note and if qty is negative, total is negative + $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); // For credit note and if qty is negative, total is negative + $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); // For credit note and if qty is negative, total is negative + $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); // For credit note and if qty is negative, total is negative + $this->line->fk_product=$fk_product; $this->line->product_type=$product_type; $this->line->remise_percent=$remise_percent; - $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise $this->line->date_start=$date_start; $this->line->date_end=$date_end; $this->line->ventil=$ventil; $this->line->rang=$rangtouse; $this->line->info_bits=$info_bits; $this->line->fk_remise_except=$fk_remise_except; - $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva= $total_tva; - $this->line->total_localtax1=$total_localtax1; - $this->line->total_localtax2=$total_localtax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; - $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); + $this->line->special_code=$special_code; $this->line->fk_parent_line=$fk_parent_line; $this->line->origin=$origin;