2
0
forked from Wavyzz/dolibarr

Compare commits

...

35 Commits
12.0.0 ... 9.0

Author SHA1 Message Date
Laurent Destailleur
90854dc2bf FIX Use the wrong logo size on PDF 2023-07-30 19:53:56 +02:00
Laurent Destailleur
b44ddaa696 FIX Use the wrong logo size on PDF 2023-07-30 18:04:03 +02:00
Laurent Destailleur
4569cb82b2 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2022-03-10 15:52:04 +01:00
Laurent Destailleur
04d33f4594 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2022-03-10 15:51:42 +01:00
Laurent Destailleur
af6e95aa79 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-03-10 15:49:51 +01:00
Laurent Destailleur
5d942c9d1a Fix infinit logs 2022-03-10 15:46:00 +01:00
Laurent Destailleur
1541e20870 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-01-07 15:43:28 +01:00
Laurent Destailleur
53709cf509 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-01-07 15:40:05 +01:00
Laurent Destailleur
10e32c056e FIX avoid infinite loop on dump with popen 2022-01-07 15:35:33 +01:00
Laurent Destailleur
0a72aed3d7 Fix missing space before union 2021-12-23 13:35:38 +01:00
Laurent Destailleur
5e1cd459b1 Fix travis 2020-11-15 23:47:53 +01:00
Laurent Destailleur
0f435f9901 Merge pull request #15098 from atm-gauthier/9.0_fix_worklow_order_auto_validated_with_shipping_validate_must_no_consider_services
FIX : WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider serv…
2020-10-22 16:18:11 +02:00
Laurent Destailleur
a9117fe864 Update interface_20_modWorkflow_WorkflowManager.class.php 2020-10-22 16:18:00 +02:00
Laurent Destailleur
8ce929d509 Merge pull request #15069 from ATM-Consulting/fix/9.0_linked_object_on_supplier_proposal_events
FIX 9.0 - when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
2020-10-22 16:10:49 +02:00
Got2be
c2ad40043f FIX : WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty 2020-10-22 16:10:47 +02:00
Florian Mortgat
529dfb8dfb FIX 9.0 - supplier proposals as linked objects of events are not correctly fetched 2020-10-20 16:37:15 +02:00
Laurent Destailleur
74eac1d06a Fix include regression 2020-08-23 19:22:01 +02:00
Laurent Destailleur
03557b69c2 Merge pull request #14486 from atm-john/9.0_fix_infinite_fetch_loop
FIX : infinite fetch object linked loop
2020-08-23 19:14:08 +02:00
Laurent Destailleur
7a183ea026 Update pdf.lib.php 2020-08-23 19:13:30 +02:00
Laurent Destailleur
b44d6744f9 Update pdf.lib.php 2020-08-23 19:11:40 +02:00
Laurent Destailleur
7eb003c684 Update pdf.lib.php 2020-08-23 19:11:19 +02:00
John Botella
6e1702c1a5 Fix infinite fetch object linked loop 2020-08-17 15:00:31 +02:00
Laurent Destailleur
73ea5b0e2d Fix function to convert price to string 2020-08-06 02:50:24 +02:00
Laurent Destailleur
9cb5735165 FIX Bad address used for vendor on PDF standard of supplier payment 2020-08-06 02:05:55 +02:00
Laurent Destailleur
c8bff3a71e FIX Cannot redeclare class 2020-08-06 02:05:04 +02:00
Laurent Destailleur
9dc904f0a5 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-07-29 16:03:03 +02:00
Laurent Destailleur
491f72accc Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2020-07-29 16:02:07 +02:00
Laurent Destailleur
4a291f181f Fix regression 2020-07-29 13:47:04 +02:00
Laurent Destailleur
454a804b4e Merge pull request #14299 from atm-gauthier/9.0_hidden_unit
FIX : We need to see unit line on PDF even though it's an option
2020-07-29 13:18:17 +02:00
VERDOL Gauthier
25994e61bc FIX : We need to see unit line on PDF even though it's an option 2020-07-27 16:04:21 +02:00
Laurent Destailleur
4f5c5356c5 Merge pull request #14150 from atm-gauthier/9.0_deposit_amount_with_comma
FIX : create a deposit with amount using comma didn't work
2020-07-03 00:38:59 +02:00
Laurent Destailleur
18fa4c4105 Update card.php 2020-07-03 00:38:31 +02:00
gauthier
6553c40bea FIX : create a deposit with amount using comma didn't work 2020-06-30 11:23:55 +02:00
Laurent Destailleur
eb7dd74026 Revert error 2020-06-04 16:05:40 +02:00
Laurent Destailleur
88f6c71e88 Add tuto for live streaming 2020-06-04 16:05:04 +02:00
15 changed files with 295 additions and 230 deletions

View File

@@ -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
- |

View File

@@ -1255,7 +1255,7 @@ if (empty($reshook))
if ($_POST['type'] == Facture::TYPE_DEPOSIT)
{
$typeamount = GETPOST('typedeposit', 'alpha');
$valuedeposit = GETPOST('valuedeposit', 'int');
$valuedeposit = price2num(GETPOST('valuedeposit', 'alpha'), 'MU');
$amountdeposit = array();
if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA))

View File

@@ -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

View File

@@ -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);

View File

@@ -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';

View File

@@ -13,37 +13,49 @@
* 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)
{
global $conf;
$num = str_replace(array(',', ' '), '', trim($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 (!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();
@@ -126,13 +138,18 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
}
// If we need to write cents call again this function for cents
if(!empty($TNum[1])) {
$decimalpart = $TNum[1];
$decimalpart = preg_replace('/0+$/', '', $decimalpart);
if ($decimalpart) {
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
$concatWords .= ' '.dol_convertToWord($TNum[1], $langs, $currency, true);
$concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true);
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
}
return $concatWords;
}
}
/**
@@ -140,7 +157,7 @@ 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)
*/

View File

@@ -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))
{

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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))
{