diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index e383d386ecc..7d4fd9be051 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -159,6 +159,19 @@ button.actionbutton { border-width: 0; } +button.item_value { + background: #bbbbbb; + border: #000000 1px solid; + border-radius: 4px; + padding: 8px; +} + +button.item_value.selected { + background: #ffffff; + color: #000000; + font-weight: bold; +} + div[aria-describedby="dialog-info"] button:before { content: "\f788"; font-family: "Font Awesome 5 Free"; diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index 5e58910928a..1d4e0dfc7be 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/takepos/floors.php + * \file htdocs/takepos/freezone.php * \ingroup takepos * \brief Popup to enter a free line */ @@ -32,6 +32,11 @@ if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); require '../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + +global $mysoc; $langs->loadLangs(array("bills", "cashdesk")); @@ -44,6 +49,20 @@ if (empty($user->rights->takepos->run)) { access_forbidden(); } +// get invoice +$invoice = new Facture($db); +if ($place > 0) { + $invoice->fetch($place); +} else { + $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$place.')'); +} + +// get default vat rate +$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION['takeposterminal']; +$soc = new Societe($db); +if ($invoice->socid > 0) $soc->fetch($invoice->socid); +else $soc->fetch($conf->global->$constforcompanyid); +$vatRateDefault = get_default_tva($mysoc, $soc); /* * View @@ -52,18 +71,34 @@ if (empty($user->rights->takepos->run)) { $arrayofcss = array('/takepos/css/pos.css.php'); $arrayofjs = array(); -top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - +top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss); ?> @@ -76,6 +111,21 @@ if ($action == "addnote") echo ' +load_cache_vatrates("'" . $mysoc->country_code . "'"); + if ($num > 0) { + print '

'; + print $langs->trans('VAT') . ' : '; + foreach ($form->cache_vatrates as $rate) { + print ''; + } + } +} +?> diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index a822e2f53e6..799d32546c3 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; +global $mysoc; + $langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks")); $id = GETPOST('id', 'int'); @@ -333,7 +335,12 @@ if ($action == "freezone") { $customer = new Societe($db); $customer->fetch($invoice->socid); - $tva_tx = get_default_tva($mysoc, $customer); + $tva_tx = GETPOST('tva_tx', 'alpha'); + if ($tva_tx != '') { + $tva_tx = price2num($tva_tx); + } else { + $tva_tx = get_default_tva($mysoc, $customer); + } // Local Taxes $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr);