mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90854dc2bf | ||
|
|
b44ddaa696 | ||
|
|
4569cb82b2 | ||
|
|
04d33f4594 | ||
|
|
af6e95aa79 | ||
|
|
5d942c9d1a | ||
|
|
1541e20870 | ||
|
|
53709cf509 | ||
|
|
10e32c056e | ||
|
|
0a72aed3d7 | ||
|
|
5e1cd459b1 | ||
|
|
0f435f9901 | ||
|
|
a9117fe864 | ||
|
|
8ce929d509 | ||
|
|
c2ad40043f | ||
|
|
529dfb8dfb | ||
|
|
74eac1d06a | ||
|
|
03557b69c2 | ||
|
|
7a183ea026 | ||
|
|
b44d6744f9 | ||
|
|
7eb003c684 | ||
|
|
6e1702c1a5 | ||
|
|
73ea5b0e2d | ||
|
|
9cb5735165 | ||
|
|
c8bff3a71e | ||
|
|
9dc904f0a5 | ||
|
|
491f72accc | ||
|
|
4a291f181f | ||
|
|
454a804b4e | ||
|
|
25994e61bc | ||
|
|
eb7dd74026 | ||
|
|
88f6c71e88 |
@@ -120,6 +120,7 @@ install:
|
||||
composer self-update
|
||||
composer -n init
|
||||
composer -n config vendor-dir htdocs/includes
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
echo
|
||||
|
||||
- |
|
||||
|
||||
@@ -365,8 +365,8 @@ else
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
{
|
||||
$page = 0;
|
||||
@@ -376,18 +376,18 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (! $result)
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $seearch_cti != ''))
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $search_cti != ''))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
@@ -715,7 +715,7 @@ $i = 0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@@ -914,7 +914,7 @@ while ($i < min($num,$limit))
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
$db->free($resql);
|
||||
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@@ -347,6 +347,7 @@ class Utils
|
||||
{
|
||||
$handlein = popen($fullcommandclear, 'r');
|
||||
$i=0;
|
||||
if ($handlein) {
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
@@ -359,6 +360,7 @@ class Utils
|
||||
}
|
||||
pclose($handlein);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($compression == 'none') fclose($handle);
|
||||
|
||||
@@ -1872,6 +1872,12 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
$classpath = 'fourn/class';
|
||||
$module='fournisseur';
|
||||
}
|
||||
elseif ($objecttype == 'supplier_proposal') {
|
||||
$classfile = 'supplier_proposal';
|
||||
$classname = 'SupplierProposal';
|
||||
$classpath = 'supplier_proposal/class';
|
||||
$module = 'supplier_proposal';
|
||||
}
|
||||
elseif ($objecttype == 'stock') {
|
||||
$classpath = 'product/stock/class';
|
||||
$classfile='entrepot';
|
||||
|
||||
@@ -13,38 +13,50 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* or see https://www.gnu.org/
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/core/lib/functionsnumbertoword.lib.php
|
||||
* \file htdocs/core/lib/functionsnumtoword.lib.php
|
||||
* \brief A set of functions for Dolibarr
|
||||
* This file contains all frequently used functions.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Function to return number in text.
|
||||
* Function to return a number into a text.
|
||||
* May use module NUMBERWORDS if found.
|
||||
*
|
||||
*
|
||||
* @param float $num Number to convert
|
||||
* @param Lang $langs Language
|
||||
* @param float $num Number to convert (must be a numeric value, like reported by price2num())
|
||||
* @param Translate $langs Language
|
||||
* @param boolean $currency 0=number to translate | 1=currency to translate
|
||||
* @param boolean $centimes 0=no centimes | 1=centimes to translate
|
||||
* @return string Text of the number
|
||||
* @param boolean $centimes 0=no cents/centimes | 1=there is cents/centimes to translate
|
||||
* @return string|false Text of the number
|
||||
*/
|
||||
function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
||||
function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$num = str_replace(array(',', ' '), '', trim($num));
|
||||
if(! $num) {
|
||||
//$num = str_replace(array(',', ' '), '', trim($num)); This should be useless since $num MUST be a php numeric value
|
||||
if (!$num) {
|
||||
return false;
|
||||
}
|
||||
if($centimes && strlen($num) == 1) {
|
||||
$num = $num*10;
|
||||
|
||||
if ($centimes && strlen($num) == 1) {
|
||||
$num = $num * 10;
|
||||
}
|
||||
$TNum = explode('.',$num);
|
||||
|
||||
if (!empty($conf->global->MAIN_MODULE_NUMBERWORDS)) {
|
||||
if ($currency) {
|
||||
$type = 1;
|
||||
} else {
|
||||
$type = 0;
|
||||
}
|
||||
|
||||
$concatWords = $langs->getLabelFromNumber($num, $type);
|
||||
return $concatWords;
|
||||
} else {
|
||||
$TNum = explode('.', $num);
|
||||
$num = (int) $TNum[0];
|
||||
$words = array();
|
||||
$list1 = array(
|
||||
@@ -94,24 +106,24 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
||||
$num_length = strlen($num);
|
||||
$levels = (int) (($num_length + 2) / 3);
|
||||
$max_length = $levels * 3;
|
||||
$num = substr('00' . $num, -$max_length);
|
||||
$num = substr('00'.$num, -$max_length);
|
||||
$num_levels = str_split($num, 3);
|
||||
$nboflevels = count($num_levels);
|
||||
for ($i = 0; $i < $nboflevels; $i++) {
|
||||
$levels--;
|
||||
$hundreds = (int) ($num_levels[$i] / 100);
|
||||
$hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' '.$langs->transnoentities('hundred') . ( $hundreds == 1 ? '' : 's' ) . ' ': '');
|
||||
$hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : '');
|
||||
$tens = (int) ($num_levels[$i] % 100);
|
||||
$singles = '';
|
||||
if ( $tens < 20 ) {
|
||||
$tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );
|
||||
if ($tens < 20) {
|
||||
$tens = ($tens ? ' '.$list1[$tens].' ' : '');
|
||||
} else {
|
||||
$tens = (int) ($tens / 10);
|
||||
$tens = ' ' . $list2[$tens] . ' ';
|
||||
$tens = ' '.$list2[$tens].' ';
|
||||
$singles = (int) ($num_levels[$i] % 10);
|
||||
$singles = ' ' . $list1[$singles] . ' ';
|
||||
$singles = ' '.$list1[$singles].' ';
|
||||
}
|
||||
$words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );
|
||||
$words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : '');
|
||||
} //end for loop
|
||||
$commas = count($words);
|
||||
if ($commas > 1) {
|
||||
@@ -121,17 +133,22 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
||||
// Delete multi whitespaces
|
||||
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
||||
|
||||
if(!empty($currency)) {
|
||||
if (!empty($currency)) {
|
||||
$concatWords .= ' '.$currency;
|
||||
}
|
||||
|
||||
// If we need to write cents call again this function for cents
|
||||
if(!empty($TNum[1])) {
|
||||
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
||||
$concatWords .= ' '.dol_convertToWord($TNum[1], $langs, $currency, true);
|
||||
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
|
||||
$decimalpart = $TNum[1];
|
||||
$decimalpart = preg_replace('/0+$/', '', $decimalpart);
|
||||
|
||||
if ($decimalpart) {
|
||||
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
||||
|
||||
$concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true);
|
||||
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
|
||||
}
|
||||
return $concatWords;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,65 +157,65 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
|
||||
*
|
||||
* @deprecated
|
||||
* @param float $numero Number to convert
|
||||
* @param Lang $langs Language
|
||||
* @param Translate $langs Language
|
||||
* @param string $numorcurrency 'number' or 'amount'
|
||||
* @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99)
|
||||
*/
|
||||
function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
||||
function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
{
|
||||
// If the number is negative convert to positive and return -1 if is too long
|
||||
if ($numero < 0) $numero *= -1;
|
||||
if ($numero >= 1000000000001)
|
||||
return -1;
|
||||
// Get 2 decimals to cents, another functions round or truncate
|
||||
$strnumber = number_format ($numero,10);
|
||||
$len=strlen($strnumber);
|
||||
for ($i=0; $i<$len; $i++)
|
||||
$strnumber = number_format($numero, 10);
|
||||
$len = strlen($strnumber);
|
||||
for ($i = 0; $i < $len; $i++)
|
||||
{
|
||||
if ($strnumber[$i]=='.') {
|
||||
$parte_decimal = $strnumber[$i+1].$strnumber[$i+2];
|
||||
if ($strnumber[$i] == '.') {
|
||||
$parte_decimal = $strnumber[$i + 1].$strnumber[$i + 2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
|
||||
in case exist why ask $lang like a parameter?*/
|
||||
if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
||||
if (((is_object($langs) && $langs->default == 'es_MX') || (!is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
||||
{
|
||||
if ($numero>=1 && $numero<2) {
|
||||
if ($numero >= 1 && $numero < 2) {
|
||||
return ("UN PESO ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=0 && $numero<1){
|
||||
elseif ($numero >= 0 && $numero < 1) {
|
||||
return ("CERO PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=1000000 && $numero<1000001){
|
||||
elseif ($numero >= 1000000 && $numero < 1000001) {
|
||||
return ("UN MILLÓN DE PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=1000000000000 && $numero<1000000000001){
|
||||
elseif ($numero >= 1000000000000 && $numero < 1000000000001) {
|
||||
return ("UN BILLÓN DE PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
else {
|
||||
$entexto ="";
|
||||
$entexto = "";
|
||||
$number = $numero;
|
||||
if ($number >= 1000000000){
|
||||
if ($number >= 1000000000) {
|
||||
$CdMMillon = (int) ($numero / 100000000000);
|
||||
$numero = $numero - $CdMMillon * 100000000000;
|
||||
$DdMMillon = (int) ($numero / 10000000000);
|
||||
$numero = $numero - $DdMMillon * 10000000000;
|
||||
$UdMMillon = (int) ($numero / 1000000000);
|
||||
$numero = $numero - $UdMMillon * 1000000000;
|
||||
$entexto .= hundreds2text ($CdMMillon, $DdMMillon, $UdMMillon);
|
||||
$entexto .= hundreds2text($CdMMillon, $DdMMillon, $UdMMillon);
|
||||
$entexto .= " MIL ";
|
||||
}
|
||||
if ($number >= 1000000){
|
||||
if ($number >= 1000000) {
|
||||
$CdMILLON = (int) ($numero / 100000000);
|
||||
$numero = $numero - $CdMILLON * 100000000;
|
||||
$DdMILLON = (int) ($numero / 10000000);
|
||||
$numero = $numero - $DdMILLON * 10000000;
|
||||
$udMILLON = (int) ($numero / 1000000);
|
||||
$numero = $numero - $udMILLON * 1000000;
|
||||
$entexto .= hundreds2text ($CdMILLON, $DdMILLON, $udMILLON);
|
||||
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1)
|
||||
$entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON);
|
||||
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON == 1)
|
||||
$entexto .= " MILLÓN ";
|
||||
else
|
||||
$entexto .= " MILLONES ";
|
||||
@@ -210,7 +227,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
||||
$numero = $numero - $ddm * 10000;
|
||||
$udm = (int) ($numero / 1000);
|
||||
$numero = $numero - $udm * 1000;
|
||||
$entexto .= hundreds2text ($cdm, $ddm, $udm);
|
||||
$entexto .= hundreds2text($cdm, $ddm, $udm);
|
||||
if ($cdm || $ddm || $udm)
|
||||
$entexto .= " MIL ";
|
||||
}
|
||||
@@ -218,8 +235,8 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
||||
$numero = $numero - $c * 100;
|
||||
$d = (int) ($numero / 10);
|
||||
$u = (int) $numero - $d * 10;
|
||||
$entexto .= hundreds2text ($c, $d, $u);
|
||||
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000)
|
||||
$entexto .= hundreds2text($c, $d, $u);
|
||||
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number > 1000000)
|
||||
$entexto .= " DE";
|
||||
$entexto .= " PESOS ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
@@ -237,40 +254,40 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
|
||||
*/
|
||||
function hundreds2text($hundreds, $tens, $units)
|
||||
{
|
||||
if ($hundreds==1 && $tens==0 && $units==0){
|
||||
if ($hundreds == 1 && $tens == 0 && $units == 0) {
|
||||
return "CIEN";
|
||||
}
|
||||
$centenas = array("CIENTO","DOSCIENTOS","TRESCIENTOS","CUATROCIENTOS","QUINIENTOS","SEISCIENTOS","SETECIENTOS","OCHOCIENTOS","NOVECIENTOS");
|
||||
$decenas = array("","","TREINTA ","CUARENTA ","CINCUENTA ","SESENTA ","SETENTA ","OCHENTA ","NOVENTA ");
|
||||
$veintis = array("VEINTE","VEINTIUN","VEINTIDÓS","VEINTITRÉS","VEINTICUATRO","VEINTICINCO","VEINTISÉIS","VEINTISIETE","VEINTIOCHO","VEINTINUEVE");
|
||||
$diecis = array("DIEZ","ONCE","DOCE","TRECE","CATORCE","QUINCE","DIECISÉIS","DIECISIETE","DIECIOCHO","DIECINUEVE");
|
||||
$unidades = array("UN","DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE");
|
||||
$centenas = array("CIENTO", "DOSCIENTOS", "TRESCIENTOS", "CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS", "SETECIENTOS", "OCHOCIENTOS", "NOVECIENTOS");
|
||||
$decenas = array("", "", "TREINTA ", "CUARENTA ", "CINCUENTA ", "SESENTA ", "SETENTA ", "OCHENTA ", "NOVENTA ");
|
||||
$veintis = array("VEINTE", "VEINTIUN", "VEINTIDÓS", "VEINTITRÉS", "VEINTICUATRO", "VEINTICINCO", "VEINTISÉIS", "VEINTISIETE", "VEINTIOCHO", "VEINTINUEVE");
|
||||
$diecis = array("DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISÉIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE");
|
||||
$unidades = array("UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE");
|
||||
$entexto = "";
|
||||
if ($hundreds!=0){
|
||||
$entexto .= $centenas[$hundreds-1];
|
||||
if ($hundreds != 0) {
|
||||
$entexto .= $centenas[$hundreds - 1];
|
||||
}
|
||||
if ($tens>2){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
$entexto .= $decenas[$tens-1];
|
||||
if ($units!=0){
|
||||
if ($tens > 2) {
|
||||
if ($hundreds != 0) $entexto .= " ";
|
||||
$entexto .= $decenas[$tens - 1];
|
||||
if ($units != 0) {
|
||||
$entexto .= " Y ";
|
||||
$entexto .= $unidades[$units-1];
|
||||
$entexto .= $unidades[$units - 1];
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
elseif ($tens==2){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
elseif ($tens == 2) {
|
||||
if ($hundreds != 0) $entexto .= " ";
|
||||
$entexto .= " ".$veintis[$units];
|
||||
return $entexto;
|
||||
}
|
||||
elseif ($tens==1){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
elseif ($tens == 1) {
|
||||
if ($hundreds != 0) $entexto .= " ";
|
||||
$entexto .= $diecis[$units];
|
||||
return $entexto;
|
||||
}
|
||||
if ($units!=0) {
|
||||
if ($hundreds!=0 || $tens!=0) $entexto .= " ";
|
||||
$entexto .= $unidades[$units-1];
|
||||
if ($units != 0) {
|
||||
if ($hundreds != 0 || $tens != 0) $entexto .= " ";
|
||||
$entexto .= $unidades[$units - 1];
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
|
||||
@@ -1826,7 +1826,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
|
||||
}
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($object->lines[$i]->special_code == 3) return '';
|
||||
if (empty($hidedetails) || $hidedetails > 1) $result.=$langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
|
||||
}
|
||||
return $result;
|
||||
@@ -2072,7 +2071,7 @@ function pdf_getTotalQty($object,$type,$outputlangs)
|
||||
*/
|
||||
function pdf_getLinkedObjects($object,$outputlangs)
|
||||
{
|
||||
global $hookmanager;
|
||||
global $db, $hookmanager;
|
||||
|
||||
$linkedobjects=array();
|
||||
|
||||
@@ -2128,8 +2127,13 @@ function pdf_getLinkedObjects($object,$outputlangs)
|
||||
// We concat this record info into fields xxx_value. title is overwrote.
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order
|
||||
{
|
||||
$elementobject->fetchObjectLinked();
|
||||
if (! empty($elementobject->linkedObjects['commande'])) $order = reset($elementobject->linkedObjects['commande']);
|
||||
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
|
||||
if (! empty($elementobject->linkedObjectsIds['commande'])){
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$order = new Commande($db);
|
||||
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
|
||||
if ($ret < 1) { $order=null; }
|
||||
}
|
||||
}
|
||||
if (! is_object($order))
|
||||
{
|
||||
|
||||
@@ -1251,9 +1251,17 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
// Logo
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
|
||||
{
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$height=pdf_getHeightForLogo($logo);
|
||||
|
||||
@@ -1563,9 +1563,17 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Logo
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
|
||||
{
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$height=pdf_getHeightForLogo($logo);
|
||||
|
||||
@@ -1453,9 +1453,17 @@ class pdf_azur extends ModelePDFPropales
|
||||
// Logo
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
|
||||
{
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$height=pdf_getHeightForLogo($logo);
|
||||
|
||||
@@ -1449,9 +1449,17 @@ class pdf_cyan extends ModelePDFPropales
|
||||
// Logo
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
|
||||
{
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$height=pdf_getHeightForLogo($logo);
|
||||
|
||||
@@ -766,7 +766,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,((!empty($object->contact))?$object->contact:null),$usecontact,'target',$object);
|
||||
$usecontact = 0;
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact))?$object->contact:null), $usecontact, 'target', $object);
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=90;
|
||||
|
||||
@@ -299,6 +299,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
//Build array of quantity ordered by product
|
||||
if (is_array($order->lines) && count($order->lines)>0) {
|
||||
foreach($order->lines as $orderline) {
|
||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $orderline->product_type > 0) continue;
|
||||
$qtyordred[$orderline->fk_product]+=$orderline->qty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2146,7 +2146,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql = "SELECT DISTINCT ur.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
|
||||
$sql.= " WHERE ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';
|
||||
$sql.= "UNION";
|
||||
$sql.= " UNION";
|
||||
$sql.= " SELECT DISTINCT ugu.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ugu, ".MAIN_DB_PREFIX."usergroup_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
|
||||
$sql.= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
||||
$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers'));
|
||||
|
||||
@@ -210,7 +210,7 @@ if ($result > 0)
|
||||
*/
|
||||
|
||||
// Amount
|
||||
print '<tr><td colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->montant,'',$langs,0,0,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount,'',$langs,0,0,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user