diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 48b481770ac65..74774a41617ad 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -151,8 +151,8 @@ function fail($message) } // Assign a default project, if relevant -if (isModEnabled('project') && !empty(getDolGlobalString("CASHDESK_ID_PROJECT".$takeposterminal))) { - $invoice->fk_project = (int) getDolGlobalString("CASHDESK_ID_PROJECT".$takeposterminal); +if (isModEnabled('project') && getDolGlobalInt("CASHDESK_ID_PROJECT".$takeposterminal)) { + $invoice->fk_project = getDolGlobalInt("CASHDESK_ID_PROJECT".$takeposterminal); } // Change the currency of invoice if it was modified