Browse Source

FIX: #11975 When a product is split between multiple pages in a document, prices/quantity/etc appear on the last relevant page

AdrianDominik 5 years ago
parent
commit
ed269a387f
22 changed files with 230 additions and 33 deletions
  1. 6 1
      htdocs/core/modules/commande/doc/pdf_einstein.modules.php
  2. 14 2
      htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
  3. 7 1
      htdocs/core/modules/contract/doc/pdf_strato.modules.php
  4. 14 2
      htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
  5. 14 2
      htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
  6. 7 1
      htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
  7. 14 2
      htdocs/core/modules/facture/doc/pdf_crabe.modules.php
  8. 14 2
      htdocs/core/modules/facture/doc/pdf_sponge.modules.php
  9. 7 1
      htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
  10. 7 1
      htdocs/core/modules/project/doc/pdf_baleine.modules.php
  11. 7 1
      htdocs/core/modules/project/doc/pdf_beluga.modules.php
  12. 7 1
      htdocs/core/modules/project/doc/pdf_timespent.modules.php
  13. 14 2
      htdocs/core/modules/propale/doc/pdf_azur.modules.php
  14. 14 2
      htdocs/core/modules/propale/doc/pdf_cyan.modules.php
  15. 14 2
      htdocs/core/modules/reception/doc/pdf_squille.modules.php
  16. 7 1
      htdocs/core/modules/stock/doc/pdf_standard.modules.php
  17. 7 1
      htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
  18. 7 1
      htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
  19. 14 2
      htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
  20. 14 2
      htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
  21. 7 1
      htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
  22. 14 2
      htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php

+ 6 - 1
htdocs/core/modules/commande/doc/pdf_einstein.modules.php

@@ -440,7 +440,12 @@ class pdf_einstein extends ModelePDFCommandes
 						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

+ 14 - 2
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

@@ -572,7 +572,13 @@ class pdf_eratosthene extends ModelePDFCommandes
 					        $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']))
@@ -610,7 +616,13 @@ class pdf_eratosthene extends ModelePDFCommandes
     						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

+ 7 - 1
htdocs/core/modules/contract/doc/pdf_strato.modules.php

@@ -391,7 +391,13 @@ class pdf_strato extends ModelePDFContract
 							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

+ 14 - 2
htdocs/core/modules/expedition/doc/pdf_espadon.modules.php

@@ -433,7 +433,13 @@ class pdf_espadon extends ModelePdfExpedition
 					        $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;
+
 					    }
 
 
@@ -475,7 +481,13 @@ class pdf_espadon extends ModelePdfExpedition
 					        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

+ 14 - 2
htdocs/core/modules/expedition/doc/pdf_rouget.modules.php

@@ -452,7 +452,13 @@ class pdf_rouget extends ModelePdfExpedition
 						$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']))
@@ -494,7 +500,13 @@ class pdf_rouget extends ModelePdfExpedition
 						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

+ 7 - 1
htdocs/core/modules/expensereport/doc/pdf_standard.modules.php

@@ -385,7 +385,13 @@ class pdf_standard extends ModeleExpenseReport
 						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

+ 14 - 2
htdocs/core/modules/facture/doc/pdf_crabe.modules.php

@@ -494,7 +494,13 @@ class pdf_crabe extends ModelePDFFactures
 						$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']))
@@ -534,7 +540,13 @@ class pdf_crabe extends ModelePDFFactures
 						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

+ 14 - 2
htdocs/core/modules/facture/doc/pdf_sponge.modules.php

@@ -600,7 +600,13 @@ class pdf_sponge extends ModelePDFFactures
     	                    $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']))
@@ -639,7 +645,13 @@ class pdf_sponge extends ModelePDFFactures
     	                    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

+ 7 - 1
htdocs/core/modules/livraison/doc/pdf_typhon.modules.php

@@ -409,7 +409,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder
                     	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

+ 7 - 1
htdocs/core/modules/project/doc/pdf_baleine.modules.php

@@ -362,7 +362,13 @@ class pdf_baleine extends ModelePDFProjects
 						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)
 							{

+ 7 - 1
htdocs/core/modules/project/doc/pdf_beluga.modules.php

@@ -512,7 +512,13 @@ class pdf_beluga extends ModelePDFProjects
 						            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)
 							            {

+ 7 - 1
htdocs/core/modules/project/doc/pdf_timespent.modules.php

@@ -293,7 +293,13 @@ class pdf_timespent extends ModelePDFProjects
 						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)
 							{

+ 14 - 2
htdocs/core/modules/propale/doc/pdf_azur.modules.php

@@ -502,7 +502,13 @@ class pdf_azur extends ModelePDFPropales
 						$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']))
@@ -543,7 +549,13 @@ class pdf_azur extends ModelePDFPropales
 						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

+ 14 - 2
htdocs/core/modules/propale/doc/pdf_cyan.modules.php

@@ -582,7 +582,13 @@ class pdf_cyan extends ModelePDFPropales
     						$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;
+
     					}
 
 
@@ -624,7 +630,13 @@ class pdf_cyan extends ModelePDFPropales
     						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

+ 14 - 2
htdocs/core/modules/reception/doc/pdf_squille.modules.php

@@ -374,7 +374,13 @@ class pdf_squille extends ModelePdfReception
 						$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']))
@@ -417,7 +423,13 @@ class pdf_squille extends ModelePdfReception
 						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

+ 7 - 1
htdocs/core/modules/stock/doc/pdf_standard.modules.php

@@ -383,7 +383,13 @@ class pdf_standard extends ModelePDFStock
 							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

+ 7 - 1
htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php

@@ -543,7 +543,13 @@ class pdf_stdmovement extends ModelePDFMovement
 							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

+ 7 - 1
htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php

@@ -430,7 +430,13 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
 						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

+ 14 - 2
htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php

@@ -523,7 +523,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
 						$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($imglinesize['width']) && !empty($imglinesize['height']))
@@ -564,7 +570,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
 					        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

+ 14 - 2
htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php

@@ -445,7 +445,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
 						$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($imglinesize['width']) && !empty($imglinesize['height']))
@@ -492,7 +498,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
 						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

+ 7 - 1
htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php

@@ -365,7 +365,13 @@ class pdf_standard extends ModelePDFSuppliersPayments
 						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

+ 14 - 2
htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php

@@ -430,7 +430,13 @@ class pdf_aurore extends ModelePDFSupplierProposal
 						$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($imglinesize['width']) && !empty($imglinesize['height']))
@@ -480,7 +486,13 @@ class pdf_aurore extends ModelePDFSupplierProposal
 						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