diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 9720399fb5e..3134dfa95ba 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -441,26 +441,40 @@ class AccountingJournal extends CommonObject $langs->loadLangs(array("assets")); // Clean parameters - if (empty($type)) $type = 'view'; - if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet'; + if (empty($type)) { + $type = 'view'; + } + if (empty($in_bookkeeping)) { + $in_bookkeeping = 'notyet'; + } $sql = ""; - if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') { + + // FIXME sql error with Mysql 5.7 + /*if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') { $sql .= "WITH in_accounting_bookkeeping(fk_docdet) AS ("; $sql .= " SELECT DISTINCT fk_docdet"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping"; $sql .= " WHERE doc_type = 'asset'"; $sql .= ")"; - } + }*/ + $sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht"; $sql .= ", a.disposal_date AS asset_disposal_date, a.disposal_amount_ht AS asset_disposal_amount_ht, a.disposal_subject_to_vat AS asset_disposal_subject_to_vat"; $sql .= ", ad.rowid AS depreciation_id, ad.depreciation_mode, ad.ref AS depreciation_ref, ad.depreciation_date, ad.depreciation_ht, ad.accountancy_code_debit, ad.accountancy_code_credit"; $sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset"; - if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') { + // FIXME sql error with Mysql 5.7 + /*if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') { $sql .= " LEFT JOIN in_accounting_bookkeeping as iab ON iab.fk_docdet = ad.rowid"; - } + }*/ $sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing + // Compatibility with Mysql 5.7 + if ($in_bookkeeping == 'already') { + $sql .= " AND EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')"; + } elseif ($in_bookkeeping == 'notyet') { + $sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')"; + } $sql .= " AND ad.ref != ''"; // not reversal lines if ($date_start && $date_end) { $sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'"; @@ -470,9 +484,10 @@ class AccountingJournal extends CommonObject $sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'"; } // Already in bookkeeping or not - if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') { + // FIXME sql error with Mysql 5.7 + /*if ($in_bookkeeping == 'already' || $in_bookkeeping == 'notyet') { $sql .= " AND iab.fk_docdet IS" . ($in_bookkeeping == 'already' ? " NOT" : "") . " NULL"; - } + }*/ $sql .= " ORDER BY ad.depreciation_date"; dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index b56271850e5..8f6297e480a 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -290,19 +290,21 @@ print '' . $langs->trans("Debit") . ''; print '' . $langs->trans("Credit") . ''; print "\n"; -foreach ($journal_data as $element_id => $element) { - foreach ($element['blocks'] as $lines) { - foreach ($lines as $line) { - print ''; - print '' . $line['date'] . ''; - print '' . $line['piece'] . ''; - print '' . $line['account_accounting'] . ''; - print '' . $line['subledger_account'] . ''; - print '' . $line['label_operation'] . ''; - if ($object->nature == 4) print '' . $line['payment_mode'] . ''; - print '' . $line['debit'] . ''; - print '' . $line['credit'] . ''; - print ''; +if (is_array($journal_data) && !empty($journal_data)) { + foreach ($journal_data as $element_id => $element) { + foreach ($element['blocks'] as $lines) { + foreach ($lines as $line) { + print ''; + print '' . $line['date'] . ''; + print '' . $line['piece'] . ''; + print '' . $line['account_accounting'] . ''; + print '' . $line['subledger_account'] . ''; + print '' . $line['label_operation'] . ''; + if ($object->nature == 4) print '' . $line['payment_mode'] . ''; + print '' . $line['debit'] . ''; + print '' . $line['credit'] . ''; + print ''; + } } } } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 3d92dd5023f..c1f31282dcd 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2022 Laurent Destailleur * Copyright (C) 2009-2018 Regis Houssin * Copyright (C) 2010 Juanjo Menent * @@ -30,11 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'products', 'admin')); -if (!$user->admin) { - accessforbidden(); -} - $action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); $currencycode = GETPOST('currencycode', 'alpha'); if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { @@ -49,25 +46,36 @@ $mainroundingruletot = 'MAIN_ROUNDING_RULE_TOT'.(!empty($currencycode) ? '_'.$cu $valmainmaxdecimalsunit = GETPOST($mainmaxdecimalsunit, 'int'); $valmainmaxdecimalstot = GETPOST($mainmaxdecimalstot, 'int'); -$valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'int'); +$valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'alpha'); // Can be 'x.y' but also 'x...' $valmainroundingruletot = price2num(GETPOST($mainroundingruletot, 'alphanohtml'), '', 2); -if ($action == 'update') { +if (!$user->admin) { + accessforbidden(); +} + + +/* + * Actions + */ + +if ($action == 'update' && !$cancel) { $error = 0; $MAXDEC = 8; - if ($_POST[$mainmaxdecimalsunit] > $MAXDEC - || $_POST[$mainmaxdecimalstot] > $MAXDEC - || $_POST[$mainmaxdecimalsshown] > $MAXDEC) { + if ($valmainmaxdecimalsunit > $MAXDEC + || $valmainmaxdecimalstot > $MAXDEC + || $valmainmaxdecimalsshown > $MAXDEC) { $error++; setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden", $MAXDEC), null, 'errors'); + $action = 'edit'; } - if ($_POST[$mainmaxdecimalsunit].(!empty($currencycode) ? '_'.$currencycode : '') < 0 - || $_POST[$mainmaxdecimalstot] < 0 - || $_POST[$mainmaxdecimalsshown] < 0) { + if ($valmainmaxdecimalsunit < 0 + || $valmainmaxdecimalstot < 0 + || $valmainmaxdecimalsshown < 0) { $langs->load("errors"); $error++; setEventMessages($langs->trans("ErrorNegativeValueNotAllowed"), null, 'errors'); + $action = 'edit'; } if ($valmainroundingruletot) { @@ -75,9 +83,23 @@ if ($action == 'update') { $langs->load("errors"); $error++; setEventMessages($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), null, 'errors'); + $action = 'edit'; } } + if ((float) $valmainmaxdecimalsshown == 0) { + $langs->load("errors"); + $error++; + setEventMessages($langs->trans("ErrorValueCantBeNull", dol_trunc(dol_string_nohtmltag($langs->transnoentitiesnoconv("MAIN_MAX_DECIMALS_SHOWN")), 40)), null, 'errors'); + $action = 'edit'; + } + if (! $error && ((float) $valmainmaxdecimalsshown < $valmainmaxdecimalsunit || (float) $valmainmaxdecimalsshown < $valmainmaxdecimalstot)) { + $langs->load("errors"); + $error++; + setEventMessages($langs->trans("ErrorValueForTooLow", dol_trunc(dol_string_nohtmltag($langs->transnoentitiesnoconv("MAIN_MAX_DECIMALS_SHOWN")), 40)), null, 'errors'); + $action = 'edit'; + } + if (!$error) { dolibarr_set_const($db, $mainmaxdecimalsunit, $valmainmaxdecimalsunit, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, $mainmaxdecimalstot, $valmainmaxdecimalstot, 'chaine', 0, '', $conf->entity); @@ -144,24 +166,25 @@ if ($action == 'edit') { print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''; + print ''; print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''; + print ''; print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''; - print ''; + print ''; print ''; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''; + print ''; print ''; - print '
'; print '
'; - print ''; + print ''; + print '   '; + print ''; print '
'; print '
'; @@ -170,7 +193,7 @@ if ($action == 'edit') { } else { print '
'; print ''; - print ''; + print ''; print ''; $result .= ''; $result .= ''; - $result .= ''; + + // Load amount of existing payment of invoice (needed for complete status) + $payment = $objectstatic->getSommePaiement(); + $result .= ''; $result .= ''; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index f0e85dc1709..2e5854b8534 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1562,7 +1562,7 @@ class pdf_sponge extends ModelePDFFactures // Total remise $total_line_remise = 0; foreach ($object->lines as $i => $line) { - $total_line_remise += pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this method to core/lib/pdf.lib + $total_line_remise += (float) pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); // TODO: add this method to core/lib/pdf.lib // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { $total_line_remise += -$line->total_ht; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 53ff4a1797d..afa8ee7d285 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -475,7 +475,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc); + pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 799539bb99e..834ef4031c0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1241,7 +1241,7 @@ if (empty($reshook)) { $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); - $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); + $object->multicurrency_tx = price2num(GETPOST('originmulticurrency_tx', 'alpha')); $object->fk_project = GETPOST('projectid', 'int'); // Fill array 'array_options' with data from add form diff --git a/htdocs/install/mysql/tables/llx_partnership-partnership.sql b/htdocs/install/mysql/tables/llx_partnership-partnership.sql index d023e67920e..8c616f8f62b 100644 --- a/htdocs/install/mysql/tables/llx_partnership-partnership.sql +++ b/htdocs/install/mysql/tables/llx_partnership-partnership.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_partnership( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) DEFAULT '(PROV)' NOT NULL, - status smallint NOT NULL DEFAULT '0', + status smallint DEFAULT 0 NOT NULL, fk_type integer DEFAULT 0 NOT NULL, fk_soc integer, fk_member integer, diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 6e64f1c6e48..f894974d314 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -59,6 +59,7 @@ MainAccountForSuppliersNotDefined=Main accounting account for vendors not define MainAccountForUsersNotDefined=Main accounting account for users not defined in setup MainAccountForVatPaymentNotDefined=Main accounting account for VAT payment not defined in setup MainAccountForSubscriptionPaymentNotDefined=Main accounting account for subscription payment not defined in setup +UserAccountNotDefined=Accounting account for user not defined in setup AccountancyArea=Accounting area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 2560f248a9b..830b6bd0974 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -295,6 +295,8 @@ ErrorThisPaymentModeIsNotSepa=This payment mode is not a bank account ErrorStripeCustomerNotFoundCreateFirst=Stripe customer is not set for this thirdparty (or set to a value deleted on Stripe side). Create (or re-attach) it first. ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into sender or recipient for a string containing the character + ErrorTableNotFound=Table %s not found +ErrorValueForTooLow=Value for %s is too low +ErrorValueCantBeNull=Value for %s can't be null # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 9e7cfdd5d03..4838c80f92d 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -118,7 +118,7 @@ class Partnership extends CommonObject 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'date_partnership_start' => array('type'=>'date', 'label'=>'DatePartnershipStart', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>1,), 'date_partnership_end' => array('type'=>'date', 'label'=>'DatePartnershipEnd', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>1,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>2, 'index'=>1, 'arrayofkeyval'=>array('-1'=>'', '0'=>'Draft', '1'=>'Accepted', '2'=>'Refused', '8'=>'Suspended', '9'=>'Terminated'),), + 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>2, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('-1'=>'', '0'=>'Draft', '1'=>'Accepted', '2'=>'Refused', '8'=>'Suspended', '9'=>'Terminated'),), 'url_to_check' => array('type'=>'varchar(255)', 'label'=>'UrlToCheck', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>-1,), 'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',), 'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,), diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1a8396fd331..fc8b852edf6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4846,7 +4846,7 @@ class Product extends CommonObject $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens $sql.= " ORDER BY pa.rang"; - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.implode(',', $parents), LOG_DEBUG); + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents)?implode(',', $parents):$parents), LOG_DEBUG); if ($level == 1) { $alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); @@ -191,7 +214,7 @@ if ($action == 'edit') { print ''; print ''; } diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 0abf864084d..085dd338e69 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -122,7 +122,7 @@ if (empty($conf->global->MAIN_MODULE_API)) { // Test if explorer is not disabled if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) { $langs->load("admin"); - dol_syslog("Call Dolibarr API interfaces with module REST disabled"); + dol_syslog("Call Dolibarr API interfaces with module API REST disabled"); print $langs->trans("WarningAPIExplorerDisabled").'.

'; //session_destroy(); exit(0); @@ -155,6 +155,10 @@ preg_match('/index\.php\/([^\/]+)(.*)$/', $url, $reg); $refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false); if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { $refreshcache = true; + if (!is_writable($conf->api->dir_temp)) { + print 'Erreur temp dir api/temp not writable'; + exit(0); + } } $api = new DolibarrApi($db, '', $refreshcache); diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index ea6ec241b16..7b4e06c897f 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -119,13 +119,23 @@ class AdvanceTargetingMailing extends CommonObject '3' => $langs->trans('ThirdParty'), '4' => $langs->trans('ContactsWithThirdpartyFilter') ); - $this->type_statuscommprospect = array( - -1 => $langs->trans("StatusProspect-1"), - 0 => $langs->trans("StatusProspect0"), - 1 => $langs->trans("StatusProspect1"), - 2 => $langs->trans("StatusProspect2"), - 3 => $langs->trans("StatusProspect3") - ); + + require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; + $customerStatic = new Client($this->db); + $customerStatic->loadCacheOfProspStatus(); + if (!empty($customerStatic->cacheprospectstatus)) { + foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) { + $this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label']; + } + } else { + $this->type_statuscommprospect = array( + -1 => $langs->trans("StatusProspect-1"), + 0 => $langs->trans("StatusProspect0"), + 1 => $langs->trans("StatusProspect1"), + 2 => $langs->trans("StatusProspect2"), + 3 => $langs->trans("StatusProspect3") + ); + } } /** diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 9e10d51031e..50169438baa 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -355,7 +355,7 @@ class FormAdvTargetEmailing extends Form $out = ''; $sql = "SELECT c.rowid, c.name, c.fk_element"; - $sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as c"; + $sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as c"; $sql .= " WHERE type_element = '".$this->db->escape($type_element)."'"; $sql .= " ORDER BY c.name"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 638022b855a..d535da76199 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1228,6 +1228,15 @@ class Contact extends CommonObject $this->db->begin(); + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('CONTACT_DELETE', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + if (!$error) { // Get all rowid of element_contact linked to a type that is link to llx_socpeople $sql = "SELECT ec.rowid"; @@ -1318,15 +1327,6 @@ class Contact extends CommonObject } } - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('CONTACT_DELETE', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - if (!$error) { $this->db->commit(); return 1; diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 9966b9c6093..7866b972db1 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -28,9 +28,10 @@ if (!defined('NOREQUIREHTML')) { if (!defined('NOREQUIREAJAX')) { define('NOREQUIREAJAX', '1'); } -if (!defined('NOREQUIRESOC')) { +// Needed to create other objects with workflow +/*if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); -} +}*/ // Do not check anti CSRF attack test if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1d93ed833ae..f9a64330ce6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9137,7 +9137,7 @@ abstract class CommonObject // Clean and check mandatory foreach ($keys as $key) { - // If field is an implicit foreign key field + // If field is an implicit foreign key field (so type = 'integer:...') if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') { $values[$key] = ''; } @@ -9157,7 +9157,7 @@ abstract class CommonObject $values[$key] = $this->quote($this->fields[$key]['default'], $this->fields[$key]); } - // If field is an implicit foreign key field + // If field is an implicit foreign key field (so type = 'integer:...') if (preg_match('/^integer:/i', $this->fields[$key]['type']) && empty($values[$key])) { if (isset($this->fields[$key]['default'])) { $values[$key] = ((int) $this->fields[$key]['default']); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9ab6874836d..409bf47d715 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6371,7 +6371,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, // Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle. if (($seller_country_code == $buyer_country_code) - || (in_array($seller_country_code, array('FR,MC')) && in_array($buyer_country_code, array('FR', 'MC')))) { // Warning ->country_code not always defined + || (in_array($seller_country_code, array('FR', 'MC')) && in_array($buyer_country_code, array('FR', 'MC')))) { // Warning ->country_code not always defined //print 'VATRULE 2'; return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); } diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 54e639058c4..18ebc363768 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -753,7 +753,10 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $result .= '
'.$companystatic->getNomUrl(1, 'customer').''.dol_print_date($db->jdate($obj->datec), 'day').''.price($obj->total_ttc).''.$objectstatic->getLibStatut(5).''.$objectstatic->getLibStatut(5, $payment).'