Prepare for option MAIN_GENERATE_PROPOSALS_WITH_PICTURE

Conflicts:
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
	htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php

Conflicts:
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
This commit is contained in:
Laurent Destailleur 2013-07-24 20:20:31 +02:00
parent 7c67853355
commit 339118d6f4
6 changed files with 55 additions and 40 deletions

View File

@ -103,13 +103,16 @@ class pdf_einstein extends ModelePDFCommandes
// Define position of columns // Define position of columns
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxtva=111; $this->posxtva=112;
$this->posxup=126; $this->posxup=126;
$this->posxqty=145; $this->posxqty=145;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20;
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
@ -332,18 +335,18 @@ class pdf_einstein extends ModelePDFCommandes
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
} }
// 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);
$pdf->SetXY($this->posxup, $curY); $pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY); $pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars
// Discount on line // Discount on line
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)

View File

@ -103,13 +103,16 @@ class pdf_crabe extends ModelePDFFactures
// Define position of columns // Define position of columns
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxtva=111; $this->posxtva=112;
$this->posxup=126; $this->posxup=126;
$this->posxqty=145; $this->posxqty=145;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20;
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
@ -335,18 +338,18 @@ class pdf_crabe extends ModelePDFFactures
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
} }
// 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);
$pdf->SetXY($this->posxup, $curY); $pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY); $pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars
// Discount on line // Discount on line
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)

View File

@ -97,8 +97,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Define position of columns // Define position of columns
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxcomm=111; $this->posxcomm=112;
//$this->posxtva=111; //$this->posxtva=112;
//$this->posxup=126; //$this->posxup=126;
$this->posxqty=174; $this->posxqty=174;
//$this->posxdiscount=162; //$this->posxdiscount=162;
@ -432,6 +432,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Pied de page // Pied de page
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
// Check product remaining to be delivered // Check product remaining to be delivered

View File

@ -102,14 +102,16 @@ class pdf_azur extends ModelePDFPropales
// Define position of columns // Define position of columns
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxpicture=95; $this->posxtva=112;
$this->posxtva=111;
$this->posxup=126; $this->posxup=126;
$this->posxqty=145; $this->posxqty=145;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20;
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
@ -274,7 +276,7 @@ class pdf_azur extends ModelePDFPropales
// Define size of image if we need it // Define size of image if we need it
$imglinesize=array(); $realpath=''; $imglinesize=array(); $realpath='';
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITH_PICTURE)) if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
{ {
if ($object->lines[$i]->fk_product) if ($object->lines[$i]->fk_product)
{ {
@ -329,7 +331,7 @@ class pdf_azur extends ModelePDFPropales
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
$pdf->startTransaction(); $pdf->startTransaction();
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITH_PICTURE)) if (empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
{ {
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc);
} }
@ -345,7 +347,7 @@ class pdf_azur extends ModelePDFPropales
$pageposafter=$pageposbefore; $pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit; //print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITH_PICTURE)) if (empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
{ {
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc);
} }
@ -396,18 +398,18 @@ class pdf_azur extends ModelePDFPropales
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
} }
// 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);
$pdf->SetXY($this->posxup, $curY); $pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY); $pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars
// Discount on line // Discount on line
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)
@ -1076,7 +1078,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
} }
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITH_PICTURE)) if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
{ {
$pdf->line($this->posxpicture-1, $tab_top, $this->posxpicture-1, $tab_top + $tab_height); $pdf->line($this->posxpicture-1, $tab_top, $this->posxpicture-1, $tab_top + $tab_height);
if (empty($hidetop)) if (empty($hidetop))

View File

@ -99,13 +99,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Defini position des colonnes // Defini position des colonnes
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxtva=111; $this->posxtva=112;
$this->posxup=126; $this->posxup=126;
$this->posxqty=145; $this->posxqty=145;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
//if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20;
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
@ -296,16 +299,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
} }
// Unit price before discount // Unit price before discount
$pdf->SetXY($this->posxup, $curY); $pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, price($object->lines[$i]->pu_ht), 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, price($object->lines[$i]->pu_ht), 0, 'R', 0);
// Quantity // Quantity
$pdf->SetXY($this->posxqty, $curY); $pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $object->lines[$i]->qty, 0, 'R'); $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $object->lines[$i]->qty, 0, 'R');
// Discount on line // Discount on line
$pdf->SetXY($this->posxdiscount, $curY); $pdf->SetXY($this->posxdiscount, $curY);

View File

@ -104,13 +104,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Defini position des colonnes // Defini position des colonnes
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxtva=111; $this->posxtva=112;
$this->posxup=126; $this->posxup=126;
$this->posxqty=145; $this->posxqty=145;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
//if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20;
$this->posxtva-=20; $this->posxtva-=20;
$this->posxup-=20; $this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
@ -341,11 +344,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Unit price before discount // Unit price before discount
$pdf->SetXY($this->posxup, $curY); $pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, price($object->lines[$i]->subprice), 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, price($object->lines[$i]->subprice), 0, 'R', 0);
// Quantity // Quantity
$pdf->SetXY($this->posxqty, $curY); $pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $object->lines[$i]->qty, 0, 'R'); $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $object->lines[$i]->qty, 0, 'R');
// Discount on line // Discount on line
$pdf->SetXY($this->posxdiscount, $curY); $pdf->SetXY($this->posxdiscount, $curY);