diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 666b6dfb0ed..37db8a6498e 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -139,7 +139,7 @@ class ExtraFields * * @param string $attrname Code of attribute * @param string $label label of attribute - * @param string $type Type of attribute ('boolean','int','varchar','text','html','date','datehour','price','phone','mail','password','url','select','checkbox','separate',...) + * @param string $type Type of attribute ('boolean','int','varchar','text','html','date','datetime','price','phone','mail','password','url','select','checkbox','separate',...) * @param int $pos Position of attribute * @param string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma. * @param string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...) @@ -207,7 +207,7 @@ class ExtraFields * This is a private method. For public method, use addExtraField. * * @param string $attrname code of attribute - * @param int $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...) + * @param int $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datetime','price','phone','mail','password','url','select','checkbox', ...) * @param string $length Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @param int $unique Is field unique or not @@ -299,7 +299,7 @@ class ExtraFields * * @param string $attrname code of attribute * @param string $label label of attribute - * @param int $type Type of attribute ('int', 'varchar', 'text', 'html', 'date', 'datehour', 'float') + * @param int $type Type of attribute ('int', 'varchar', 'text', 'html', 'date', 'datetime', 'float') * @param int $pos Position of attribute * @param string $size Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) @@ -526,7 +526,7 @@ class ExtraFields * * @param string $attrname Name of attribute * @param string $label Label of attribute - * @param string $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...) + * @param string $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datetime','price','phone','mail','password','url','select','checkbox', ...) * @param int $length Length of attribute * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @param int $unique Is field unique or not diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9430de71663..364fbf8d132 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -81,7 +81,7 @@ function getDolGlobalString($key, $default = '') { global $conf; // return $conf->global->$key ?? $default; - return (string) (empty($conf->global->$key) ? $default : $conf->global->$key); + return (string) (isset($conf->global->$key) ? $conf->global->$key : $default); } /** @@ -94,7 +94,7 @@ function getDolGlobalInt($key, $default = 0) { global $conf; // return $conf->global->$key ?? $default; - return (int) (empty($conf->global->$key) ? $default : $conf->global->$key); + return (int) (isset($conf->global->$key) ? $conf->global->$key : $default); } /** diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ed97e84c263..311757c436c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -314,6 +314,10 @@ if (empty($reshook)) { if ($pay != "delayed") { $payment->create($user); $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + if ($res < 0) { + $error++; + dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined'), $payment->errors, 1); + } $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded } }