From f4c23654f84d9997782d421ecffe57f6c1d6ea4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Feb 2021 22:44:04 +0100 Subject: [PATCH] FIX #16275 #15604 --- htdocs/langs/en_US/cashdesk.lang | 3 ++- htdocs/takepos/index.php | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 88ff8fecdb6..7263b04730a 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -56,7 +56,8 @@ Paymentnumpad=Type of Pad to enter payment Numberspad=Numbers Pad BillsCoinsPad=Coins and banknotes Pad DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr -TakeposNeedsCategories=TakePOS needs product categories to work +TakeposNeedsCategories=TakePOS needs at least one product categorie to work +TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work OrderNotes=Order Notes CashDeskBankAccountFor=Default account to use for payments in NoPaimementModesDefined=No paiment mode defined in TakePOS configuration diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8062368d360..172f95c5c3d 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -140,6 +140,7 @@ if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) } } } + $levelofmaincategories = $levelofrootcategory + 1; $maincategories = array(); @@ -961,7 +962,13 @@ if (empty($paiementsModes)) { setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); } if (count($maincategories) == 0) { - setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors'); + if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { + $tmpcategory = new Categorie($db); + $tmpcategory->fetch($conf->global->TAKEPOS_ROOT_CATEGORY_ID); + setEventMessages($langs->trans("TakeposNeedsAtLeastOnSubCategoryIntoParentCategory", $tmpcategory->label), null, 'errors'); + } else { + setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors'); + } } // User menu and external TakePOS modules $menus = array();