forked from Wavyzz/dolibarr
Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/install/step1.php htdocs/projet/tasks/time.php
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
@@ -2500,9 +2500,9 @@ function img_printer($titlealt = "default", $other='')
|
||||
/**
|
||||
* Show help logo with cursor "?"
|
||||
*
|
||||
* @param string $usehelpcursor Use help cursor
|
||||
* @param string $usealttitle Text to use as alt title
|
||||
* @return string Retourne tag img
|
||||
* @param int $usehelpcursor Use help cursor
|
||||
* @param int|string $usealttitle Text to use as alt title
|
||||
* @return string Return tag img
|
||||
*/
|
||||
function img_help($usehelpcursor = 1, $usealttitle = 1)
|
||||
{
|
||||
@@ -3600,7 +3600,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
$vatratecleaned = $vatrate;
|
||||
if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)"
|
||||
{
|
||||
$vatratecleaned = $reg[1];
|
||||
$vatratecleaned = trim($reg[1]);
|
||||
$vatratecode = $reg[2];
|
||||
}
|
||||
|
||||
@@ -3614,7 +3614,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
{
|
||||
if ($local == 1)
|
||||
{
|
||||
if (! $mysoc->localtax1_assuj) return 0;
|
||||
if (! $mysoc->localtax1_assuj || (string) $vatratecleaned == "0") return 0;
|
||||
if ($thirdparty_seller->id == $mysoc->id)
|
||||
{
|
||||
if (! $thirdparty_buyer->localtax1_assuj) return 0;
|
||||
@@ -3627,7 +3627,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
|
||||
if ($local == 2)
|
||||
{
|
||||
if (! $mysoc->localtax2_assuj) return 0;
|
||||
if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0;
|
||||
if ($thirdparty_seller->id == $mysoc->id)
|
||||
{
|
||||
if (! $thirdparty_buyer->localtax2_assuj) return 0;
|
||||
@@ -3899,7 +3899,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
||||
* @param int $idprod Id of product or 0 if not a predefined product
|
||||
* @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...)
|
||||
* @param int $idprodfournprice Id product_fournisseur_price (for "supplier" order/invoice)
|
||||
* @return int <0 if KO, Vat rate if OK
|
||||
* @return float Vat rate
|
||||
* @see get_product_localtax_for_country
|
||||
*/
|
||||
function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice=0)
|
||||
@@ -4049,7 +4049,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
|
||||
* @param Societe $thirdparty_buyer Objet societe acheteuse
|
||||
* @param int $idprod Id product
|
||||
* @param int $idprodfournprice Id product_fournisseur_price (for supplier order/invoice)
|
||||
* @return float Taux de tva a appliquer, -1 si ne peut etre determine
|
||||
* @return float Vat rate to use, -1 if we can't guess it
|
||||
* @see get_default_npr, get_default_localtax
|
||||
*/
|
||||
function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
|
||||
@@ -4598,7 +4598,7 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
|
||||
else $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
|
||||
$a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
$nblines = floor((count($a)+1)/2);
|
||||
$nblines = (int) floor((count($a)+1)/2);
|
||||
// count possible auto line breaks
|
||||
if($maxlinesize)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user