mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 09:02:59 +01:00
Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_PDF_DOCUMENT_COLUMN_new_files
This commit is contained in:
@@ -53,8 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("companies");
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("main","companies"));
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "ODT templates";
|
||||
@@ -98,8 +98,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("errors");
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors","companies"));
|
||||
|
||||
$form = new Form($this->db);
|
||||
|
||||
@@ -177,6 +177,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
return $texte;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build a document on disk using the generic odt module.
|
||||
*
|
||||
@@ -190,6 +191,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
*/
|
||||
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||
|
||||
if (empty($srctemplatepath))
|
||||
@@ -494,6 +496,4 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -68,9 +68,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
/**
|
||||
* @var array() Minimum version of PHP required by module.
|
||||
* e.g.: PHP ≥ 5.3 = array(5, 3)
|
||||
* e.g.: PHP ≥ 5.4 = array(5, 4)
|
||||
*/
|
||||
public $phpmin = array(5, 2);
|
||||
public $phpmin = array(5, 4);
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
@@ -78,14 +78,45 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
/**
|
||||
* @var int page_largeur
|
||||
*/
|
||||
public $page_largeur;
|
||||
|
||||
/**
|
||||
* @var int page_hauteur
|
||||
*/
|
||||
public $page_hauteur;
|
||||
|
||||
/**
|
||||
* @var array format
|
||||
*/
|
||||
public $format;
|
||||
|
||||
/**
|
||||
* @var int marge_gauche
|
||||
*/
|
||||
public $marge_gauche;
|
||||
|
||||
/**
|
||||
* @var int marge_droite
|
||||
*/
|
||||
public $marge_droite;
|
||||
|
||||
/**
|
||||
* @var int marge_haute
|
||||
*/
|
||||
public $marge_haute;
|
||||
|
||||
/**
|
||||
* @var int marge_basse
|
||||
*/
|
||||
public $marge_basse;
|
||||
|
||||
/**
|
||||
* Issuer
|
||||
* @var Societe
|
||||
*/
|
||||
public $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
@@ -171,7 +202,8 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->atleastonediscount=0;
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param Object $object Object to generate
|
||||
@@ -184,6 +216,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
*/
|
||||
function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
@@ -612,6 +645,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show payments table
|
||||
*
|
||||
@@ -623,10 +657,11 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
*/
|
||||
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
@@ -638,6 +673,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@@ -813,6 +849,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
@@ -825,6 +862,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$mysoc;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@@ -849,7 +887,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||
|
||||
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
|
||||
$total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);
|
||||
|
||||
@@ -1410,6 +1448,4 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||
return pdf_pagefoot($pdf,$outputlangs,'ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,4 @@ class pdf_proforma extends pdf_einstein
|
||||
|
||||
parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
{
|
||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
var $prefix='CO';
|
||||
var $error='';
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
var $nom='Marbre';
|
||||
|
||||
|
||||
@@ -128,13 +131,14 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
$yymm = strftime("%y%m",$date);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
else $num = sprintf("%04s", $max+1);
|
||||
|
||||
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
@@ -144,7 +148,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
*/
|
||||
function commande_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -132,17 +132,17 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
* @param Societe $objsoc Object third party
|
||||
* @param string $objforref Object for number to search
|
||||
* @param string $objforref Object for number to search
|
||||
* @return string Next free value
|
||||
*/
|
||||
function commande_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,26 +39,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
*/
|
||||
abstract class ModelePDFCommandes extends CommonDocGenerator
|
||||
{
|
||||
var $error='';
|
||||
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
static function liste_modeles($db, $maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type='order';
|
||||
$liste=array();
|
||||
$type = 'order';
|
||||
$list = array();
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$liste=getListOfModels($db,$type,$maxfilenamelength);
|
||||
$list = getListOfModels($db, $type, $maxfilenamelength);
|
||||
|
||||
return $liste;
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +76,10 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
|
||||
|
||||
abstract class ModeleNumRefCommandes
|
||||
{
|
||||
var $error='';
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
/**
|
||||
* Return if a module can be used or not
|
||||
@@ -146,4 +154,4 @@ abstract class ModeleNumRefCommandes
|
||||
if ($this->version) return $this->version;
|
||||
return $langs->trans("NotAvailable");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user