The trash button in takepos index.php was rendered without server-side check, and
the deleteline action in invoice.php only required 'takepos > run' which every POS
user has. Wrap the button with hasRight('takepos','editlines') and tighten the
action guard, so users without the edit-lines permission can no longer remove
ticket lines from the keypad before validation.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
The auto-open popup in TakePOS used SELECT ... WHERE date_creation >
first_hour_today AND status = 0. The 'status = 0' filter excluded the
just-closed fence, so a browser refresh on the same calendar day after
closing a cash control sequence found no row and the popup was triggered
again.
Drop the status filter so any fence created today on the terminal
(open or closed) counts as 'already had a cash control today' and
suppresses the popup. The first open of a new calendar day still
triggers it because no row from today exists yet.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
TakePOS supplement handling needs the rowid of the previously selected
line so the new line can be attached as a child via fk_parent_line.
htdocs/takepos/invoice.php:837 reads $selectedline = GETPOSTINT('selectedline')
and SELECTs FROM facturedet WHERE rowid = $selectedline to find the
parent.
When the JS in htdocs/takepos/index.php:590 dropped the selectedline
query parameter (regression since 19.x), GETPOSTINT returns 0, the
parent lookup matches no row, fk_parent_line stays null and the
supplement is added as a regular standalone line.
Restore the &selectedline= parameter to the AJAX URL.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
# FIX#36258: Do not format qty from barcode
When a barcode contains a quantity (e.g., 0.275 from qu=0 and qd=275),
the quantity is already in international format (using '.' as decimal separator).
However, when this qty is passed to invoice.php, it uses GETPOSTFLOAT('qty')
which defaults to option=2, meaning it treats the value as local user format.
In Spanish/Argentinian locale (thousand separator=., decimal separator=,),
price2num with option=2 incorrectly treats 0.275 as a number with thousand separator
and converts it to 275.
## Solution:
1. Add a 'qty_std' parameter to the URL when calling invoice.php from barcode
2. In invoice.php, use GETPOSTFLOAT('qty', '', 1) when qty_std is set
3. Option=1 tells price2num that the value is NOT in local user format
This way, qty from barcode (already in international format) is not converted,
while qty from user input (in local format) continues to be converted correctly.
Changes:
- htdocs/takepos/index.php: Add qty_std parameter to ClickProduct and pass it through to invoice.php
- htdocs/takepos/invoice.php: Use GETPOSTFLOAT with option=1 when qty_std is set
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
- simplify function which simulates navigating to the next/previous panel
- call the hook only after all original buttons have been added
- Remove button hiding at positions %3 == 2 depending on Dolibarr configuration
# FIX: Define keyCodeForEnter before first use (takepos)
Move the code to get the keyCodeForEnter from the bottom of the file closer to the top.
This ensure that the variable is defined before first use.
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* NEW add api for members statistics
* fix
* fix
* fix
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>