diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 0ef7a568f18..8e1ed6cebd1 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -146,7 +146,7 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR") } $ivseed = dolGetRandomBytes($ivlen); - $newchain = openssl_encrypt($chain, $ciphering, $key, null, $ivseed); + $newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed); return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain; } else { return $chain; @@ -180,9 +180,9 @@ function dolDecrypt($chain, $key = '') if (function_exists('openssl_decrypt')) { $tmpexplode = explode(':', $reg[2]); if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) { - $newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, null, $tmpexplode[0]); + $newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, 0, $tmpexplode[0]); } else { - $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, null, null); + $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null); } } else { $newchain = 'Error function openssl_decrypt() not available'; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 76fd9297e2b..d466f1fe9a7 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -181,6 +181,20 @@ if ($action == "setaccountancycodecustomerinvoicemandatory") { } } +//Activate Set vat id unique +if ($action == "setvatintraunique") { + $setvatintraunique = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, 'yesno', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + //Activate Set ref in list if ($action == "setaddrefinlist") { $setaddrefinlist = GETPOST('value', 'int'); @@ -731,6 +745,22 @@ if (isModEnabled('accounting')) { print "\n"; } +// VAT ID +print ''; +print ''.$langs->trans('VATIntra')."\n"; + +if (!empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; +} else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; +} +print ''; +print "\n"; + print "\n"; print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 37cf4746d82..550f2280c59 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1171,7 +1171,7 @@ class Societe extends CommonObject } // Check for duplicate or mandatory fields defined into setup - $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL'); + $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL', 'TVA_INTRA'); foreach ($array_to_check as $key) { $keymin = strtolower($key); $i = (int) preg_replace('/[^0-9]/', '', $key); @@ -1216,6 +1216,14 @@ class Societe extends CommonObject $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } + } elseif ($key == 'TVA_INTRA') { + // Check for unicity + if ($vallabel && !empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { + $langs->load("errors"); + $error++; $this->errors[] = $langs->trans('VATIntra')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } } } } diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index bcf0a853705..1cfe141478d 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -93,75 +93,6 @@ print '
'; print ''; -print load_fiche_titre($langs->trans("PrintMethod"), '', ''); - -print '
'; -print ''; -print ''; -print ''; -print "\n"; - -// Browser method -print '\n"; - -// Receipt printer module -print '\n"; - -// TakePOS Connector -print '\n"; -print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").'
'; -print $langs->trans('Browser'); -print ''; -print $langs->trans('BrowserMethodDescription'); -print ''; -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser") { - print img_picto($langs->trans("Activated"), 'switch_on'); -} else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; -} -print "
'; -print $langs->trans('DolibarrReceiptPrinter'); -print ''; -print $langs->trans('ReceiptPrinterMethodDescription'); -if (isModEnabled('receiptprinter')) { - if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { - print '
'; - print img_picto('', 'printer', 'class="paddingright"').''.$langs->trans("Setup").''; - } -} -print '
'; -if (isModEnabled('receiptprinter')) { - if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; - } -} else { - print ''; - print $langs->trans("ModuleReceiptPrinterMustBeEnabled"); - print ''; -} -print "
'; -print "TakePOS Connector"; -print ''; -print $langs->trans('TakeposConnectorMethodDescription'); - -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { - print '
'; - print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; - print ' '; -} - -print '
'; -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { - print img_picto($langs->trans("Activated"), 'switch_on'); -} else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; -} -print "
'; -print '
'; - - print load_fiche_titre($langs->trans("Receipt"), '', ''); print '
'; @@ -285,6 +216,13 @@ print $form->buttonsSaveCancel("Save", ''); print "\n"; +print load_fiche_titre($langs->trans("Preview"), '', ''); +print '
'; +print '
'; +print ''; +print '
'; +print '
'; + print '
'; llxFooter(); diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 3542aa44014..400d05415aa 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -330,7 +330,9 @@ if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeTe ?>