FIX multicurrency management on supplier order/invoice
This commit is contained in:
parent
75d73b188c
commit
e85206dee5
@ -69,9 +69,10 @@ class html_cerfafr extends ModeleDon
|
|||||||
*
|
*
|
||||||
* @param Don $don Donation object
|
* @param Don $don Donation object
|
||||||
* @param Translate $outputlangs Lang object for output language
|
* @param Translate $outputlangs Lang object for output language
|
||||||
|
* @param string $currency Currency code
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($don,$outputlangs)
|
function write_file($don,$outputlangs,$currency='')
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$mysoc;
|
global $user,$conf,$langs,$mysoc;
|
||||||
|
|
||||||
@ -87,7 +88,9 @@ class html_cerfafr extends ModeleDon
|
|||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
$outputlangs->load("donations");
|
$outputlangs->load("donations");
|
||||||
|
|
||||||
if (! empty($conf->don->dir_output))
|
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||||
|
|
||||||
|
if (! empty($conf->don->dir_output))
|
||||||
{
|
{
|
||||||
// Definition of the object don (for upward compatibility)
|
// Definition of the object don (for upward compatibility)
|
||||||
if (! is_object($don))
|
if (! is_object($don))
|
||||||
@ -165,7 +168,7 @@ class html_cerfafr extends ModeleDon
|
|||||||
//$form = str_replace('__IP__',$user->ip,$form); // TODO $user->ip not exist
|
//$form = str_replace('__IP__',$user->ip,$form); // TODO $user->ip not exist
|
||||||
$form = str_replace('__AMOUNT__',$don->amount,$form);
|
$form = str_replace('__AMOUNT__',$don->amount,$form);
|
||||||
$form = str_replace('__AMOUNTLETTERS__',chiffre_en_lettre($don->amount),$form);
|
$form = str_replace('__AMOUNTLETTERS__',chiffre_en_lettre($don->amount),$form);
|
||||||
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->currency),$form);
|
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$currency),$form);
|
||||||
$form = str_replace('__CURRENCYCODE__',$conf->currency,$form);
|
$form = str_replace('__CURRENCYCODE__',$conf->currency,$form);
|
||||||
$form = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$form);
|
$form = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$form);
|
||||||
$form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form);
|
$form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form);
|
||||||
|
|||||||
@ -725,6 +725,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
* @param Translate $outputlangs Output langs
|
* @param Translate $outputlangs Output langs
|
||||||
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @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)
|
||||||
@ -735,12 +736,13 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$hidebottom=0;
|
$hidebottom=0;
|
||||||
if ($hidetop) $hidetop=-1;
|
if ($hidetop) $hidetop=-1;
|
||||||
|
|
||||||
|
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
$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) + 4), $tab_top -4);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 4), $tab_top -4);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
|
|||||||
@ -1070,6 +1070,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// FIXME amount of vat not supported with multicurrency
|
||||||
|
|
||||||
//Local tax 1 before VAT
|
//Local tax 1 before VAT
|
||||||
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||||
//{
|
//{
|
||||||
|
|||||||
@ -388,8 +388,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unit price before discount
|
// Unit price before discount
|
||||||
|
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxup, $curY);
|
$pdf->SetXY($this->posxup, $curY);
|
||||||
$pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, price($object->lines[$i]->pu_ht), 0, 'R', 0);
|
$pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
|
||||||
|
|
||||||
// Unit price before discount
|
// Unit price before discount
|
||||||
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
||||||
@ -466,11 +467,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
if ($pagenb == 1)
|
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
|
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);
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
@ -482,11 +483,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
{
|
{
|
||||||
if ($pagenb == 1)
|
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
|
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);
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
// New page
|
// New page
|
||||||
@ -500,12 +501,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
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;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
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;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,8 +594,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255,255,255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$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->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1);
|
||||||
|
|
||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
@ -719,8 +722,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetFillColor(224,224,224);
|
$pdf->SetFillColor(224,224,224);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$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->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);
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
{
|
{
|
||||||
@ -757,9 +761,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @param int $hidetop Hide top bar of array
|
* @param int $hidetop Hide top bar of array
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @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;
|
global $conf;
|
||||||
|
|
||||||
@ -767,6 +772,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$hidebottom=0;
|
$hidebottom=0;
|
||||||
if ($hidetop) $hidetop=-1;
|
if ($hidetop) $hidetop=-1;
|
||||||
|
|
||||||
|
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
@ -775,7 +781,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
|
|
||||||
if (empty($hidetop))
|
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->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
|
|||||||
@ -400,8 +400,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unit price before discount
|
// Unit price before discount
|
||||||
|
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
||||||
$pdf->SetXY($this->posxup, $curY);
|
$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
|
// Quantity
|
||||||
$pdf->SetXY($this->posxqty, $curY);
|
$pdf->SetXY($this->posxqty, $curY);
|
||||||
@ -489,11 +490,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
if ($pagenb == 1)
|
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
|
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);
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
@ -505,11 +506,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
if ($pagenb == 1)
|
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
|
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);
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
// New page
|
// New page
|
||||||
@ -523,12 +524,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
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;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
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;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -691,8 +692,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$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->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
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
@ -826,8 +828,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetFillColor(224,224,224);
|
$pdf->SetFillColor(224,224,224);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$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->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->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
@ -876,9 +879,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @param int $hidetop Hide top bar of array
|
* @param int $hidetop Hide top bar of array
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @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;
|
global $conf;
|
||||||
|
|
||||||
@ -886,6 +890,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$hidebottom=0;
|
$hidebottom=0;
|
||||||
if ($hidetop) $hidetop=-1;
|
if ($hidetop) $hidetop=-1;
|
||||||
|
|
||||||
|
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
@ -894,7 +899,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if (empty($hidetop))
|
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->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
@ -1073,14 +1078,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if (! empty($object->date_commande))
|
if (! empty($object->date_commande))
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=5;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=5;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(255,0,0);
|
$pdf->SetTextColor(255,0,0);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|
||||||
|
|||||||
@ -530,9 +530,10 @@ class pdf_cow extends ModelePDFSuppliersPayments
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @param int $hidetop Hide top bar of array
|
* @param int $hidetop Hide top bar of array
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @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,$mysoc;
|
global $conf,$mysoc;
|
||||||
|
|
||||||
@ -540,6 +541,7 @@ class pdf_cow extends ModelePDFSuppliersPayments
|
|||||||
$hidebottom=0;
|
$hidebottom=0;
|
||||||
if ($hidetop) $hidetop=-1;
|
if ($hidetop) $hidetop=-1;
|
||||||
|
|
||||||
|
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
@ -550,7 +552,7 @@ class pdf_cow extends ModelePDFSuppliersPayments
|
|||||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3) - 60, $tab_top-6);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3) - 60, $tab_top-6);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
$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);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
|
|||||||
@ -1089,9 +1089,10 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @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;
|
global $conf;
|
||||||
|
|
||||||
@ -1099,6 +1100,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$hidebottom=0;
|
$hidebottom=0;
|
||||||
if ($hidetop) $hidetop=-1;
|
if ($hidetop) $hidetop=-1;
|
||||||
|
|
||||||
|
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
@ -1107,7 +1109,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
|
|
||||||
if (empty($hidetop))
|
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->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
|
|||||||
@ -895,38 +895,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post
|
// Actions to build doc
|
||||||
{
|
$upload_dir = $conf->commande->dir_output;
|
||||||
// Build document
|
$permissioncreate = $user->rights->fournisseur->commande->creer;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
// Save last template used to generate document
|
|
||||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
|
||||||
|
|
||||||
$outputlangs = $langs;
|
|
||||||
if (GETPOST('lang_id'))
|
|
||||||
{
|
|
||||||
$outputlangs = new Translate("",$conf);
|
|
||||||
$outputlangs->setDefaultLang(GETPOST('lang_id'));
|
|
||||||
}
|
|
||||||
$result= $object->generateDocument($object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
if ($result <= 0)
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
$action='';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete file in doc form
|
|
||||||
if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer)
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
$langs->load("other");
|
|
||||||
$upload_dir = $conf->fournisseur->commande->dir_output;
|
|
||||||
$file = $upload_dir . '/' . GETPOST('file');
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
|
||||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
@ -1647,7 +1619,7 @@ elseif (! empty($object->id))
|
|||||||
$head = ordersupplier_prepare_head($object);
|
$head = ordersupplier_prepare_head($object);
|
||||||
|
|
||||||
$title=$langs->trans("SupplierOrder");
|
$title=$langs->trans("SupplierOrder");
|
||||||
dol_fiche_head($head, 'card', $title, 0, 'order');
|
dol_fiche_head($head, 'card', $title, -1, 'order');
|
||||||
|
|
||||||
|
|
||||||
$formconfirm='';
|
$formconfirm='';
|
||||||
@ -2033,8 +2005,26 @@ elseif (! empty($object->id))
|
|||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
|
if (!empty($conf->multicurrency->enabled))
|
||||||
|
{
|
||||||
|
// Multicurrency Amount HT
|
||||||
|
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||||
|
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Multicurrency Amount VAT
|
||||||
|
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||||
|
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Multicurrency Amount TTC
|
||||||
|
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||||
|
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("AmountHT").'</td>';
|
print '<tr><td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>';
|
||||||
print '<td>'.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'</td>';
|
print '<td>'.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -2060,24 +2050,6 @@ elseif (! empty($object->id))
|
|||||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'</td>';
|
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled))
|
|
||||||
{
|
|
||||||
// Multicurrency Amount HT
|
|
||||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
|
||||||
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Multicurrency Amount VAT
|
|
||||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
|
||||||
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Multicurrency Amount TTC
|
|
||||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
|
||||||
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
// Margin Infos
|
// Margin Infos
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user