|
@@ -400,8 +400,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
}
|
|
|
|
|
|
// Unit price before discount
|
|
|
+ $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
|
|
$pdf->SetXY($this->posxup, $curY);
|
|
|
- $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, price($object->lines[$i]->subprice), 0, 'R', 0);
|
|
|
+ $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
|
|
|
|
|
|
// Quantity
|
|
|
$pdf->SetXY($this->posxqty, $curY);
|
|
@@ -489,11 +490,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
$pdf->setPage($pagenb);
|
|
|
if ($pagenb == 1)
|
|
|
{
|
|
|
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
|
|
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
|
|
+ $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
|
|
|
}
|
|
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
|
|
$pagenb++;
|
|
@@ -505,11 +506,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
{
|
|
|
if ($pagenb == 1)
|
|
|
{
|
|
|
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
|
|
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
|
|
+ $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
|
|
|
}
|
|
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
|
|
// New page
|
|
@@ -523,12 +524,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
// Show square
|
|
|
if ($pagenb == 1)
|
|
|
{
|
|
|
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
|
|
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code);
|
|
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
|
|
+ $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
|
|
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
|
|
}
|
|
|
|
|
@@ -691,8 +692,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
|
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
|
|
|
|
|
+ $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
|
|
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
|
|
- $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
|
|
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
|
|
|
|
|
// Show VAT by rates and total
|
|
|
$pdf->SetFillColor(248,248,248);
|
|
@@ -826,8 +828,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
$pdf->SetFillColor(224,224,224);
|
|
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
|
|
|
|
|
+ $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
|
|
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
|
|
- $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
|
|
|
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
|
|
|
$pdf->SetFont('','', $default_font_size - 1);
|
|
|
$pdf->SetTextColor(0,0,0);
|
|
|
|
|
@@ -876,9 +879,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
* @param Translate $outputlangs Langs object
|
|
|
* @param int $hidetop Hide top bar of array
|
|
|
* @param int $hidebottom Hide bottom bar of array
|
|
|
+ * @param string $currency Currency code
|
|
|
* @return void
|
|
|
*/
|
|
|
- function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
|
|
+ function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='')
|
|
|
{
|
|
|
global $conf;
|
|
|
|
|
@@ -886,6 +890,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
$hidebottom=0;
|
|
|
if ($hidetop) $hidetop=-1;
|
|
|
|
|
|
+ $currency = !empty($currency) ? $currency : $conf->currency;
|
|
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
|
|
|
|
// Amount in (at tab_top - 1)
|
|
@@ -894,7 +899,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
|
|
|
if (empty($hidetop))
|
|
|
{
|
|
|
- $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
|
|
+ $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency));
|
|
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
|
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
|
|
|
|
@@ -1073,14 +1078,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|
|
|
|
|
if (! empty($object->date_commande))
|
|
|
{
|
|
|
- $posy+=4;
|
|
|
+ $posy+=5;
|
|
|
$pdf->SetXY($posx,$posy);
|
|
|
$pdf->SetTextColor(0,0,60);
|
|
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $posy+=4;
|
|
|
+ $posy+=5;
|
|
|
$pdf->SetXY($posx,$posy);
|
|
|
$pdf->SetTextColor(255,0,0);
|
|
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|