Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Jun 29, 2019
2 parents 36e240a + c0ba22f commit d71330c
Show file tree
Hide file tree
Showing 16 changed files with 265 additions and 185 deletions.
309 changes: 172 additions & 137 deletions htdocs/accountancy/bookkeeping/list.php

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions htdocs/comm/propal/class/propal.class.php
Expand Up @@ -1615,11 +1615,14 @@ public function update(User $user, $notrigger = 0)
/**
* Load array lines
*
* @param int $only_product Return only physical products
* @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
*
* @return int <0 if KO, >0 if OK
*/
public function fetch_lines($only_product = 0)
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{
global $langs, $conf;
// phpcs:enable
$this->lines=array();

Expand Down Expand Up @@ -1712,6 +1715,13 @@ public function fetch_lines($only_product = 0)
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;

$line->fetch_optionals();

// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}

$this->lines[$i] = $line;
//dol_syslog("1 ".$line->fk_product);
Expand Down
11 changes: 10 additions & 1 deletion htdocs/commande/class/commande.class.php
Expand Up @@ -1888,10 +1888,12 @@ public function insert_discount($idremise)
* Load array lines
*
* @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
* @return int <0 if KO, >0 if OK
*/
public function fetch_lines($only_product = 0)
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{
global $langs, $conf;
// phpcs:enable
$this->lines=array();

Expand Down Expand Up @@ -1983,6 +1985,13 @@ public function fetch_lines($only_product = 0)
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;

$line->fetch_optionals();

// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}

$this->lines[$i] = $line;

Expand Down
13 changes: 12 additions & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -1467,10 +1467,14 @@ public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '', $fetch_si
/**
* Load all detailed lines into this->lines
*
* @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
*
* @return int 1 if OK, < 0 if KO
*/
public function fetch_lines()
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{
global $langs, $conf;
// phpcs:enable
$this->lines=array();

Expand Down Expand Up @@ -1559,6 +1563,13 @@ public function fetch_lines()
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;

$line->fetch_optionals();

// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}

$this->lines[$i] = $line;

Expand Down
13 changes: 12 additions & 1 deletion htdocs/contrat/class/contrat.class.php
Expand Up @@ -716,10 +716,14 @@ public function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '')
* Load lines array into this->lines.
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
*
* @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
*
* @return ContratLigne[] Return array of contract lines
*/
public function fetch_lines()
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{
global $langs, $conf;
// phpcs:enable
$this->nbofserviceswait=0;
$this->nbofservicesopened=0;
Expand Down Expand Up @@ -828,6 +832,13 @@ public function fetch_lines()
// Retreive all extrafields for contract
// fetch optionals attributes and labels
$line->fetch_optionals();

// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}

$this->lines[$pos] = $line;
$this->lines_id_index_mapper[$line->id] = $pos;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/actions_extrafields.inc.php
Expand Up @@ -27,7 +27,7 @@
$maxsizeint=10;
$mesg=array();

$extrasize=GETPOST('size', 'int');
$extrasize=GETPOST('size', 'intcomma');
$type=GETPOST('type', 'alpha');
$param=GETPOST('param', 'alpha');

Expand Down
5 changes: 4 additions & 1 deletion htdocs/core/class/extrafields.class.php
Expand Up @@ -1645,7 +1645,10 @@ public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjec
elseif ($type == 'double')
{
if (!empty($value)) {
$value=price($value);
//$value=price($value);
$sizeparts = explode(",", $size);
$number_decimals = $sizeparts[1];
$value=price($value, 0, $langs, 0, 0, $number_decimals, '');
}
}
elseif ($type == 'boolean')
Expand Down
18 changes: 9 additions & 9 deletions htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
Expand Up @@ -7,7 +7,7 @@
* 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) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
Expand All @@ -27,7 +27,7 @@
/**
* \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
* \ingroup commande
* \brief File of the class allowing to generate the orders to the Eratosthene model
* \brief File of Class to generate PDF orders with template Eratosthène
*/

require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
Expand Down Expand Up @@ -149,13 +149,13 @@ public function __construct($db)
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;

$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/commande/doc/pdf_proforma.modules.php
Expand Up @@ -25,7 +25,7 @@
/**
* \file htdocs/core/modules/commande/doc/pdf_proforma.modules.php
* \ingroup commande
* \brief Fichier de la classe permettant de generer les commandes au modele Proforma
* \brief File of Class to generate PDF orders with template Proforma
*/

require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php';
Expand All @@ -36,7 +36,7 @@


/**
* Classe permettant de generer les commandes au modele Proforma
* Class to generate PDF orders with template Proforma
*/
class pdf_proforma extends pdf_einstein
{
Expand Down
16 changes: 8 additions & 8 deletions htdocs/core/modules/contract/doc/pdf_strato.modules.php
Expand Up @@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011 Fabrice CHERRIER
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
Expand Down Expand Up @@ -144,13 +144,13 @@ public function __construct($db)
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;

$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 0; // Dispo en plusieurs langues
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 0; // Available in several languages
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

// Get source company
$this->emetteur=$mysoc;
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/modules/expedition/doc/pdf_merou.modules.php
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
Expand All @@ -23,7 +23,7 @@
/**
* \file htdocs/core/modules/expedition/doc/pdf_merou.modules.php
* \ingroup expedition
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Merou
* \brief Class file used to generate the dispatch slips for the Merou model
*/

require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
Expand Down Expand Up @@ -134,7 +134,7 @@ public function __construct($db = 0)
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;

$this->option_logo = 1;
$this->option_logo = 1; // Display logo

// Get source company
$this->emetteur=$mysoc;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
Expand Up @@ -23,7 +23,7 @@
/**
* \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
* \ingroup expedition
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Rouget
* \brief Class file used to generate the dispatch slips for the Rouget model
*/

require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
Expand Down Expand Up @@ -133,7 +133,7 @@ public function __construct($db = 0)
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;

$this->option_logo = 1;
$this->option_logo = 1; // Display logo

// Get source company
$this->emetteur=$mysoc;
Expand Down
14 changes: 7 additions & 7 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -160,13 +160,13 @@ public function __construct($db)
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;

$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 1; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 1; // Displays if there has been a discount
$this->option_credit_note = 1; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
Expand Down
16 changes: 8 additions & 8 deletions htdocs/core/modules/facture/doc/pdf_sponge.modules.php
Expand Up @@ -160,13 +160,13 @@ public function __construct($db)
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;

$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 1; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 1; // Displays if there has been a discount
$this->option_credit_note = 1; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
Expand Down Expand Up @@ -449,7 +449,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);

$pdf->startTransaction();

$pdf->SetFont('', '', $default_font_size - 1);
Expand Down
3 changes: 2 additions & 1 deletion htdocs/product/stats/facture.php
Expand Up @@ -234,7 +234,8 @@
while ($i < min($num, $limit))
{
$objp = $db->fetch_object($result);


if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty);
$total_ht+=$objp->total_ht;
$total_qty+=$objp->qty;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/societe/consumption.php
Expand Up @@ -595,7 +595,7 @@
print '</td>';

//print '<td class="left">'.$prodreftxt.'</td>';

if ($type_element == 'invoice' && $objp->doc_type == Facture::TYPE_CREDIT_NOTE) $objp->prod_qty=-($objp->prod_qty);
print '<td class="right">'.$objp->prod_qty.'</td>';
$total_qty+=$objp->prod_qty;

Expand Down

0 comments on commit d71330c

Please sign in to comment.