Fix option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN missing

This commit is contained in:
Laurent Destailleur 2021-03-09 16:12:30 +01:00
parent 2f0c4038fb
commit 9cb4dce485
2 changed files with 24 additions and 10 deletions

View File

@ -1534,13 +1534,18 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->cols['subprice'] = array(
'rank' => $rank,
'width' => 19, // in mm
'status' => true,
'status' => false,
'title' => array(
'textkey' => 'PriceUHT'
),
'border-left' => true, // add left line separator
);
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE))
{
$this->cols['subprice']['status'] = true;
}
$rank = $rank + 10;
$this->cols['qty'] = array(
'rank' => $rank,
@ -1591,6 +1596,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
'border-left' => true, // add left line separator
);
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN))
{
$this->cols['totalexcltax']['status'] = true;
}
// Add extrafields cols
if (!empty($object->lines)) {
$line = reset($object->lines);

View File

@ -329,10 +329,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetDrawColor(128, 128, 128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Order"));
$pdf->SetSubject($outputlangs->transnoentities("PurchaseOrder"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PurchaseOrder")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -510,7 +510,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
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);
@ -518,9 +518,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
// 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);
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE)) {
$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);
@ -544,9 +546,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
// Total HT line
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs);
$pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN)) {
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs);
$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 (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva;