Merge pull request #4547 from bafbes/dev1

fix:remove project info in standard document model for expense reports when project module is disabled
This commit is contained in:
Laurent Destailleur 2016-02-02 16:41:12 +01:00
commit d88cd500ce

View File

@ -109,16 +109,21 @@ class pdf_standard extends ModeleExpenseReport
$this->posxtype=105; $this->posxtype=105;
$this->posxprojet=125; $this->posxprojet=125;
$this->posxtva=145; $this->posxtva=145;
$this->posxup=162; $this->posxup = 162;
$this->posxqty=176; $this->posxqty = 176;
$this->postotalttc=186; $this->postotalttc = 186;
if ($this->page_largeur < 210) // To work with US executive format if (empty($conf->projet->enabled)) {
{ $this->posxtva-=20;
$this->posxdate-=20; $this->posxup-=20;
$this->posxtype-=20; $this->posxqty-=20;
$this->posxprojet-=20; $this->postotalttc-=20;
$this->posxtva-=20; }
$this->posxup-=20; if ($this->page_largeur < 210) { // To work with US executive format
$this->posxdate-=20;
$this->posxtype-=20;
$this->posxprojet-=20;
$this->posxtva-=20;
$this->posxup-=20;
$this->posxqty-=20; $this->posxqty-=20;
$this->postotalttc-=20; $this->postotalttc-=20;
} }
@ -335,10 +340,12 @@ class pdf_standard extends ModeleExpenseReport
$pdf->SetXY($this->posxtype, $curY); $pdf->SetXY($this->posxtype, $curY);
$pdf->MultiCell($this->posxprojet-$this->posxtype-1, 3,$outputlangs->transnoentities($object->lines[$i]->type_fees_code), 0, 'C'); $pdf->MultiCell($this->posxprojet-$this->posxtype-1, 3,$outputlangs->transnoentities($object->lines[$i]->type_fees_code), 0, 'C');
// Project if (! empty($conf->projet->enabled)) {
$pdf->SetFont('','', $default_font_size - 1); // Project
$pdf->SetXY($this->posxprojet, $curY); $pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C'); $pdf->SetXY($this->posxprojet, $curY);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C');
}
// VAT Rate // VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
@ -765,23 +772,24 @@ class pdf_standard extends ModeleExpenseReport
// Type // Type
$pdf->line($this->posxtype-1, $tab_top, $this->posxtype-1, $tab_top + $tab_height); $pdf->line($this->posxtype-1, $tab_top, $this->posxtype-1, $tab_top + $tab_height);
$pdf->SetXY($this->posxtype-1, $tab_top+1); $pdf->SetXY($this->posxtype - 1, $tab_top + 1);
$pdf->MultiCell($this->posxprojet-$this->posxtype-1,2, $outputlangs->transnoentities("Type"),'','C'); $pdf->MultiCell($this->posxprojet - $this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
// Project if (!empty($conf->projet->enabled)) {
$pdf->line($this->posxprojet-1, $tab_top, $this->posxprojet-1, $tab_top + $tab_height); // Project
$pdf->SetXY($this->posxprojet-1, $tab_top+1); $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1,2, $outputlangs->transnoentities("Project"),'','C'); $pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
$pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C');
}
// VAT // VAT
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
{ $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); $pdf->SetXY($this->posxtva - 1, $tab_top + 1);
$pdf->SetXY($this->posxtva-1, $tab_top+1); $pdf->MultiCell($this->posxup - $this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C');
$pdf->MultiCell($this->posxup-$this->posxtva-1,2, $outputlangs->transnoentities("VAT"),'','C'); }
}
// Unit price // Unit price
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
$pdf->SetXY($this->posxup-1, $tab_top+1); $pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceU"),'','C'); $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceU"),'','C');