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

@ -112,8 +112,13 @@ class pdf_standard extends ModeleExpenseReport
$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->posxup-=20;
$this->posxqty-=20;
$this->postotalttc-=20;
}
if ($this->page_largeur < 210) { // To work with US executive format
$this->posxdate-=20; $this->posxdate-=20;
$this->posxtype-=20; $this->posxtype-=20;
$this->posxprojet-=20; $this->posxprojet-=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');
if (! empty($conf->projet->enabled)) {
// Project // Project
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($this->posxprojet, $curY); $pdf->SetXY($this->posxprojet, $curY);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C'); $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))
@ -768,14 +775,15 @@ class pdf_standard extends ModeleExpenseReport
$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');
if (!empty($conf->projet->enabled)) {
// Project // Project
$pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height); $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxprojet - 1, $tab_top + 1); $pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
$pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C'); $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');