Skip to content

Commit

Permalink
FIX: #11975 When a product is split between multiple pages in a docum…
Browse files Browse the repository at this point in the history
…ent, prices/quantity/etc appear on the last relevant page
  • Loading branch information
AdrianDominik committed Jan 28, 2020
1 parent c5eced9 commit b1724f7
Show file tree
Hide file tree
Showing 22 changed files with 230 additions and 33 deletions.
7 changes: 6 additions & 1 deletion htdocs/core/modules/commande/doc/pdf_einstein.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,12 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;
}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore+1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}

if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height']))
Expand Down Expand Up @@ -610,7 +616,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/contract/doc/pdf_strato.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore+1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}


Expand Down Expand Up @@ -475,7 +481,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore + 1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}

if (isset($imglinesize['width']) && isset($imglinesize['height']))
Expand Down Expand Up @@ -494,7 +500,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore + 1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}

if (isset($imglinesize['width']) && isset($imglinesize['height']))
Expand Down Expand Up @@ -534,7 +540,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/facture/doc/pdf_sponge.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore+1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}

if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height']))
Expand Down Expand Up @@ -639,7 +645,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/project/doc/pdf_baleine.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,13 @@ public function write_file($object, $outputlangs)
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

$forcedesconsamepage=1;
if ($forcedesconsamepage)
{
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/project/doc/pdf_beluga.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,13 @@ public function write_file($object, $outputlangs)
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

$forcedesconsamepage=1;
if ($forcedesconsamepage)
{
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/project/doc/pdf_timespent.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ public function write_file($object, $outputlangs)
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

$forcedesconsamepage=1;
if ($forcedesconsamepage)
{
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/propale/doc/pdf_azur.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore + 1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}

if (isset($imglinesize['width']) && isset($imglinesize['height']))
Expand Down Expand Up @@ -543,7 +549,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/propale/doc/pdf_cyan.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore+1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}


Expand Down Expand Up @@ -624,7 +630,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
16 changes: 14 additions & 2 deletions htdocs/core/modules/reception/doc/pdf_squille.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
$pdf->setPage($pageposbefore + 1);

$curY = $tab_top_newpage;
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}

if (isset($imglinesize['width']) && isset($imglinesize['height']))
Expand Down Expand Up @@ -417,7 +423,13 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
else
{
// We found a page break
$showpricebeforepagebreak = 0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/stock/doc/pdf_standard.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,13 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,13 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,13 @@ public function write_file($object, $outputlangs = '', $srctemplatepath = '', $h
else
{
// We found a page break
$showpricebeforepagebreak=0;

// Allows data in the first page if description is long enough to break in multiples pages
if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
$showpricebeforepagebreak = 1;
else
$showpricebeforepagebreak = 0;

}
}
else // No pagebreak
Expand Down
Loading

0 comments on commit b1724f7

Please sign in to comment.