Fix template for situation

Conflicts:
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
This commit is contained in:
Laurent Destailleur 2019-05-09 10:15:38 +02:00
parent 50563ab126
commit d3bbb93ada
11 changed files with 119 additions and 340 deletions

View File

@ -180,6 +180,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
$this->posxdiscount=162;
$this->postotalht=174;
@ -314,14 +315,16 @@ class pdf_einstein extends ModelePDFCommandes
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@ -475,15 +478,7 @@ class pdf_einstein extends ModelePDFCommandes
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@ -1185,14 +1180,7 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@ -256,15 +256,6 @@ class pdf_eratosthene extends ModelePDFCommandes
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page
$pdf->AddPage();

View File

@ -915,7 +915,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->postotalttc-$this->posxqty - 1,2, $outputlangs->transnoentities("Qty"),'','R');
$pdf->MultiCell($this->postotalttc-$this->posxqty - 1,2, $outputlangs->transnoentities("Qty"),'','C');
}
// Total with all taxes

View File

@ -117,7 +117,7 @@ class pdf_crabe extends ModelePDFFactures
/**
* Issuer
* @var Company object that emits
* @var Societe object that emits
*/
public $emetteur;
@ -179,7 +179,7 @@ class pdf_crabe extends ModelePDFFactures
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
if($conf->global->PRODUCT_USE_UNITS)
if (!empty($conf->global->PRODUCT_USE_UNITS))
{
$this->posxtva=101;
$this->posxup=118;
@ -191,9 +191,10 @@ class pdf_crabe extends ModelePDFFactures
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
$this->posxdiscount=162;
$this->posxprogress=126; // Only displayed for situation invoices
$this->posxprogress=174;
$this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
@ -363,14 +364,16 @@ class pdf_crabe extends ModelePDFFactures
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS)) // retreive space not used by discount
if (empty($this->atleastonediscount)) // retreive space not used by discount
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->posxprogress - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
$progress_width = 0;
@ -378,15 +381,14 @@ class pdf_crabe extends ModelePDFFactures
if ($object->situation_cycle_ref)
{
$this->situationinvoice = true;
$progress_width = 18;
$progress_width = 10;
$this->posxpicture -= $progress_width;
$this->posxtva -= $progress_width;
$this->posxup -= $progress_width;
$this->posxqty -= $progress_width;
if(empty($conf->global->PRODUCT_USE_UNITS)) {
$this->posxprogress += $progress_width;
}
/*$this->posxdiscount -= $progress_width;
$this->posxprogress -= $progress_width;*/
$this->posxunit -= $progress_width;
$this->posxdiscount -= $progress_width;
$this->posxprogress -= $progress_width;
}
// New page
@ -444,7 +446,7 @@ class pdf_crabe extends ModelePDFFactures
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
@ -566,42 +568,10 @@ class pdf_crabe extends ModelePDFFactures
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if ($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
// Situation progress
if ($this->situationinvoice)
{
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxprogress, $curY);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxprogress-1, 3, $progress, 0, 'R');
}
else if ($this->atleastonediscount)
{
$pdf->MultiCell($this->posxdiscount-$this->posxprogress-1, 3, $progress, 0, 'R');
}
else
{
$pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R');
}
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
if (! empty($conf->global->PRODUCT_USE_UNITS))
{
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
$pdf->SetXY($this->posxunit, $curY);
@ -613,7 +583,15 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->SetXY($this->posxdiscount-2, $curY);
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
}
// Situation progress
if ($this->situationinvoice)
{
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R');
}
// Total HT line
@ -1524,76 +1502,38 @@ class pdf_crabe extends ModelePDFFactures
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if ($this->situationinvoice) {
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxprogress, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
else if ($this->atleastonediscount)
{
$pdf->MultiCell($this->posxdiscount-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
else
{
$pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
}
}
if($conf->global->PRODUCT_USE_UNITS) {
if (! empty($conf->global->PRODUCT_USE_UNITS))
{
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
'C');
}
}
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if (empty($hidetop))
{
if ($this->atleastonediscount)
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
}
}
if ($this->situationinvoice)
{
$pdf->line($this->postotalht+4, $tab_top, $this->postotalht+4, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->postotalht-19, $tab_top+1);
$pdf->MultiCell(30,2, $outputlangs->transnoentities("Situation"),'','C');
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
}
}
if ($this->atleastonediscount)
{
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
}
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
}
}
if ($this->situationinvoice) {
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxprogress, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxprogress, 2, $outputlangs->transnoentities("ProgressShort"), '', 'C');
}
}
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->postotalht-1, $tab_top+1);

View File

@ -422,15 +422,7 @@ class pdf_standard extends ModelePDFProduct
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@ -663,14 +655,7 @@ class pdf_standard extends ModelePDFProduct
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@ -179,6 +179,7 @@ class pdf_azur extends ModelePDFPropales
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
$this->posxdiscount=162;
$this->postotalht=174;
@ -368,14 +369,16 @@ class pdf_azur extends ModelePDFPropales
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@ -573,15 +576,7 @@ class pdf_azur extends ModelePDFPropales
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@ -1389,14 +1384,7 @@ class pdf_azur extends ModelePDFPropales
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@ -636,89 +636,11 @@ class pdf_standard extends ModelePDFStock
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
}
// 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, $up_excl_tax, 0, 'R', 0);
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
// Unit
if($conf->global->PRODUCT_USE_UNITS)
{
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
$pdf->SetXY($this->posxunit, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxunit-0.8, 4, $unit, 0, 'L');
}
// Discount on line
$pdf->SetXY($this->posxdiscount, $curY);
if ($object->lines[$i]->remise_percent)
{
$pdf->SetXY($this->posxdiscount-2, $curY);
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
}
// Total HT line
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
$localtax2_rate=$object->lines[$i]->localtax2_tx;
$localtax1_type=$object->lines[$i]->localtax1_type;
$localtax2_type=$object->lines[$i]->localtax2_type;
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
// Retrieve type from database for backward compatibility with old records
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
{
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2_type && $localtax2ligne != 0)
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))

View File

@ -153,6 +153,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->posxtva=112;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
$this->posxdiscount=162;
$this->postotalht=174;
@ -302,14 +303,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@ -447,15 +450,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@ -470,7 +465,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if ($object->lines[$i]->remise_percent)
{
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent."%", 0, 'R');
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R');
}
// Total HT line
@ -887,14 +882,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@ -159,7 +159,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->emetteur=$mysoc;
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
// Defini position des colonnes
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
$this->posxdiscount=162;
$this->postotalht=174;
@ -174,6 +174,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference
@ -350,14 +351,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@ -526,15 +529,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@ -1072,14 +1067,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@ -171,6 +171,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxtva=102;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva;
@ -339,14 +340,16 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@ -518,15 +521,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 3, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@ -1230,14 +1225,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@ -827,6 +827,7 @@ RelatedObjects=Related Objects
ClassifyBilled=Classify billed
ClassifyUnbilled=Classify unbilled
Progress=Progress
ProgressShort=Progr.
FrontOffice=Front office
BackOffice=Back office
View=View