Merge pull request #12171 from grandoc/new_branch_18_10_2019
Standardization
This commit is contained in:
commit
9e7476cd1f
@ -149,7 +149,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$this->description = $langs->trans('PDFSpongeDescription');
|
$this->description = $langs->trans('PDFSpongeDescription');
|
||||||
$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
|
$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
|
||||||
|
|
||||||
// Dimensiont page
|
// Dimension page
|
||||||
$this->type = 'pdf';
|
$this->type = 'pdf';
|
||||||
$formatarray=pdf_getFormat();
|
$formatarray=pdf_getFormat();
|
||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
@ -423,7 +423,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche notes
|
// Display notes
|
||||||
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
||||||
{
|
{
|
||||||
@ -462,7 +462,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$pdf->rollbackTransaction(true);
|
$pdf->rollbackTransaction(true);
|
||||||
|
|
||||||
// prepar pages to receive notes
|
// prepare pages to receive notes
|
||||||
while ($pagenb < $pageposafternote) {
|
while ($pagenb < $pageposafternote) {
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
@ -496,7 +496,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// apply note frame to previus pages
|
// apply note frame to previous pages
|
||||||
$i = $pageposbeforenote;
|
$i = $pageposbeforenote;
|
||||||
while ($i < $pageposafternote) {
|
while ($i < $pageposafternote) {
|
||||||
$pdf->setPage($i);
|
$pdf->setPage($i);
|
||||||
@ -557,17 +557,17 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$height_note=0;
|
$height_note=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use new auto collum system
|
// Use new auto column system
|
||||||
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
|
||||||
// Simulation de tableau pour connaitre la hauteur de la ligne de titre
|
// Table simulation to know the height of the title line
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
||||||
$pdf->rollbackTransaction(true);
|
$pdf->rollbackTransaction(true);
|
||||||
|
|
||||||
$iniY = $tab_top + $this->tabTitleHeight + 2;
|
$iniY = $tab_top + $this->tabTitleHeight + 2;
|
||||||
$curY = $tab_top + $this->tabTitleHeight + 2;
|
$curY = $tab_top + $this->tabTitleHeight + 2;
|
||||||
$nexY = $tab_top + $this->tabTitleHeight + 2;
|
$nexY = $tab_top + $this->tabTitleHeight + 2;
|
||||||
|
|
||||||
// Loop on each lines
|
// Loop on each lines
|
||||||
$pageposbeforeprintlines=$pdf->getPage();
|
$pageposbeforeprintlines=$pdf->getPage();
|
||||||
@ -842,19 +842,19 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Display infos area
|
||||||
$posy=$this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs);
|
$posy=$this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Affiche zone totaux
|
// Display total zone
|
||||||
$posy=$this->drawTotalTable($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
$posy=$this->drawTotalTable($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Affiche zone versements
|
// Display payment area
|
||||||
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
||||||
{
|
{
|
||||||
$posy=$this->drawPaymentsTable($pdf, $object, $posy, $outputlangs);
|
$posy=$this->drawPaymentsTable($pdf, $object, $posy, $outputlangs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pied de page
|
// Pagefoot
|
||||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
@ -1125,7 +1125,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
// Show payment mode CHQ
|
// Show payment mode CHQ
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// Si mode reglement non force ou si force a CHQ
|
// If payment mode not forced or forced to CHQ
|
||||||
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||||
{
|
{
|
||||||
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
||||||
@ -1213,7 +1213,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tab2_hl = 4;
|
$tab2_hl = 4;
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// Tableau total
|
// Total table
|
||||||
$col1x = 120; $col2x = 170;
|
$col1x = 120; $col2x = 170;
|
||||||
if ($this->page_largeur < 210) // To work with US executive format
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
{
|
{
|
||||||
@ -1226,7 +1226,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// pourcentage global d'avancement
|
// overall percentage of advancement
|
||||||
$percent = 0;
|
$percent = 0;
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
@ -1305,7 +1305,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->setY($posy);
|
$pdf->setY($posy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display curent total
|
// Display current total
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $posy);
|
$pdf->SetXY($col1x, $posy);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||||
@ -1313,7 +1313,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetXY($col2x, $posy);
|
$pdf->SetXY($col2x, $posy);
|
||||||
$facSign = '';
|
$facSign = '';
|
||||||
if($i>1){
|
if($i>1){
|
||||||
$facSign = $object->total_ht>=0?'+':''; // gestion d'un cas particulier client
|
$facSign = $object->total_ht>=0?'+':''; // management of a particular customer case
|
||||||
}
|
}
|
||||||
|
|
||||||
if($fac->type === facture::TYPE_CREDIT_NOTE){
|
if($fac->type === facture::TYPE_CREDIT_NOTE){
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe du modele de numerotation de reference de facture Mars
|
* Class to manage invoice numbering rules Mars
|
||||||
*/
|
*/
|
||||||
class mod_facture_mars extends ModeleNumRefFactures
|
class mod_facture_mars extends ModeleNumRefFactures
|
||||||
{
|
{
|
||||||
@ -159,7 +159,7 @@ class mod_facture_mars extends ModeleNumRefFactures
|
|||||||
elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
|
elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
|
||||||
else $prefix=$this->prefixinvoice;
|
else $prefix=$this->prefixinvoice;
|
||||||
|
|
||||||
// D'abord on recupere la valeur max
|
// First we get the max value
|
||||||
$posindice=8;
|
$posindice=8;
|
||||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
|||||||
$tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Invoice"), $langs->transnoentities("Invoice"));
|
$tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Invoice"), $langs->transnoentities("Invoice"));
|
||||||
$tooltip.=$langs->trans("GenericMaskCodes5");
|
$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||||
|
|
||||||
// Parametrage du prefix
|
// Setting the prefix
|
||||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):</td>';
|
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):</td>';
|
||||||
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskinvoice" value="'.$conf->global->FACTURE_MERCURE_MASK_INVOICE.'">', $tooltip, 1, 1).'</td>';
|
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskinvoice" value="'.$conf->global->FACTURE_MERCURE_MASK_INVOICE.'">', $tooltip, 1, 1).'</td>';
|
||||||
|
|
||||||
@ -82,17 +82,17 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
|||||||
|
|
||||||
$texte.= '</tr>';
|
$texte.= '</tr>';
|
||||||
|
|
||||||
// Parametrage du prefix des replacement
|
// Prefix setting of replacement invoices
|
||||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
|
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
|
||||||
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreplacement" value="'.$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT.'">', $tooltip, 1, 1).'</td>';
|
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreplacement" value="'.$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT.'">', $tooltip, 1, 1).'</td>';
|
||||||
$texte.= '</tr>';
|
$texte.= '</tr>';
|
||||||
|
|
||||||
// Parametrage du prefix des avoirs
|
// Prefix setting of credit note
|
||||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</td>';
|
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</td>';
|
||||||
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskcredit" value="'.$conf->global->FACTURE_MERCURE_MASK_CREDIT.'">', $tooltip, 1, 1).'</td>';
|
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskcredit" value="'.$conf->global->FACTURE_MERCURE_MASK_CREDIT.'">', $tooltip, 1, 1).'</td>';
|
||||||
$texte.= '</tr>';
|
$texte.= '</tr>';
|
||||||
|
|
||||||
// Parametrage du prefix des acomptes
|
// Prefix setting of deposit
|
||||||
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):</td>';
|
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):</td>';
|
||||||
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdeposit" value="'.$conf->global->FACTURE_MERCURE_MASK_DEPOSIT.'">', $tooltip, 1, 1).'</td>';
|
$texte.= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdeposit" value="'.$conf->global->FACTURE_MERCURE_MASK_DEPOSIT.'">', $tooltip, 1, 1).'</td>';
|
||||||
$texte.= '</tr>';
|
$texte.= '</tr>';
|
||||||
|
|||||||
@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \class mod_facture_terre
|
* \class mod_facture_terre
|
||||||
* \brief Classe du modele de numerotation de reference de facture Terre
|
* \brief Class of numbering module Terre for invoices
|
||||||
*/
|
*/
|
||||||
class mod_facture_terre extends ModeleNumRefFactures
|
class mod_facture_terre extends ModeleNumRefFactures
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
|||||||
if ($invoice->type == 2) $prefix=$this->prefixcreditnote;
|
if ($invoice->type == 2) $prefix=$this->prefixcreditnote;
|
||||||
elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
|
elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
|
||||||
else $prefix=$this->prefixinvoice;
|
else $prefix=$this->prefixinvoice;
|
||||||
// D'abord on recupere la valeur max
|
// First we get the max value
|
||||||
$posindice=8;
|
$posindice=8;
|
||||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||||
|
|||||||
@ -23,13 +23,13 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/facture/modules_facture.php
|
* \file htdocs/core/modules/facture/modules_facture.php
|
||||||
* \ingroup facture
|
* \ingroup facture
|
||||||
* \brief Fichier contenant la classe mere de generation des factures en PDF
|
* \brief File that contains parent class for invoices models
|
||||||
* et la classe mere de numerotation des factures
|
* and parent class for invoices numbering models
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required because used in classes that inherit
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +66,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe mere des modeles de numerotation des references de facture
|
* Parent class of invoice reference numbering templates
|
||||||
*/
|
*/
|
||||||
abstract class ModeleNumRefFactures
|
abstract class ModeleNumRefFactures
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user