Merge pull request #12171 from grandoc/new_branch_18_10_2019

Standardization
This commit is contained in:
Laurent Destailleur 2019-10-20 13:30:40 +02:00 committed by GitHub
commit 9e7476cd1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 33 deletions

View File

@ -149,7 +149,7 @@ class pdf_sponge extends ModelePDFFactures
$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
// Dimensiont page
// Dimension page
$this->type = 'pdf';
$formatarray=pdf_getFormat();
$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;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
{
@ -462,7 +462,7 @@ class pdf_sponge extends ModelePDFFactures
{
$pdf->rollbackTransaction(true);
// prepar pages to receive notes
// prepare pages to receive notes
while ($pagenb < $pageposafternote) {
$pdf->AddPage();
$pagenb++;
@ -496,7 +496,7 @@ class pdf_sponge extends ModelePDFFactures
}
// apply note frame to previus pages
// apply note frame to previous pages
$i = $pageposbeforenote;
while ($i < $pageposafternote) {
$pdf->setPage($i);
@ -557,17 +557,17 @@ class pdf_sponge extends ModelePDFFactures
$height_note=0;
}
// Use new auto collum system
// Use new auto column system
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
// Simulation de tableau pour connaitre la hauteur de la ligne de titre
$pdf->startTransaction();
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
$pdf->rollbackTransaction(true);
// Table simulation to know the height of the title line
$pdf->startTransaction();
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
$pdf->rollbackTransaction(true);
$iniY = $tab_top + $this->tabTitleHeight + 2;
$curY = $tab_top + $this->tabTitleHeight + 2;
$nexY = $tab_top + $this->tabTitleHeight + 2;
$iniY = $tab_top + $this->tabTitleHeight + 2;
$curY = $tab_top + $this->tabTitleHeight + 2;
$nexY = $tab_top + $this->tabTitleHeight + 2;
// Loop on each lines
$pageposbeforeprintlines=$pdf->getPage();
@ -842,19 +842,19 @@ class pdf_sponge extends ModelePDFFactures
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
// Affiche zone infos
// Display infos area
$posy=$this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs);
// Affiche zone totaux
// Display total zone
$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))
{
$posy=$this->drawPaymentsTable($pdf, $object, $posy, $outputlangs);
}
// Pied de page
// Pagefoot
$this->_pagefoot($pdf, $object, $outputlangs);
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
@ -1125,7 +1125,7 @@ class pdf_sponge extends ModelePDFFactures
// Show payment mode 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))
{
$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;
$pdf->SetFont('', '', $default_font_size - 1);
// Tableau total
// Total table
$col1x = 120; $col2x = 170;
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;
$i=0;
foreach ($object->lines as $line)
@ -1305,7 +1305,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->setY($posy);
}
// Display curent total
// Display current total
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy);
$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);
$facSign = '';
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){

View File

@ -26,7 +26,7 @@
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
{
@ -159,7 +159,7 @@ class mod_facture_mars extends ModeleNumRefFactures
elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
else $prefix=$this->prefixinvoice;
// D'abord on recupere la valeur max
// First we get the max value
$posindice=8;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
$sql.= " FROM ".MAIN_DB_PREFIX."facture";

View File

@ -74,7 +74,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
$tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Invoice"), $langs->transnoentities("Invoice"));
$tooltip.=$langs->trans("GenericMaskCodes5");
// Parametrage du prefix
// Setting the prefix
$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>';
@ -82,17 +82,17 @@ class mod_facture_mercure extends ModeleNumRefFactures
$texte.= '</tr>';
// Parametrage du prefix des replacement
// Prefix setting of replacement invoices
$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.= '</tr>';
// Parametrage du prefix des avoirs
// Prefix setting of credit note
$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.= '</tr>';
// Parametrage du prefix des acomptes
// Prefix setting of deposit
$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.= '</tr>';

View File

@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
/**
* \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
{
@ -189,7 +189,7 @@ class mod_facture_terre extends ModeleNumRefFactures
if ($invoice->type == 2) $prefix=$this->prefixcreditnote;
elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
else $prefix=$this->prefixinvoice;
// D'abord on recupere la valeur max
// First we get the max value
$posindice=8;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
$sql.= " FROM ".MAIN_DB_PREFIX."facture";

View File

@ -23,13 +23,13 @@
/**
* \file htdocs/core/modules/facture/modules_facture.php
* \ingroup facture
* \brief Fichier contenant la classe mere de generation des factures en PDF
* et la classe mere de numerotation des factures
* \brief File that contains parent class for invoices models
* and parent class for invoices numbering models
*/
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.'/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
{