From f9712f978de55db87953ff4dab5eb0babe267b93 Mon Sep 17 00:00:00 2001 From: w3houde Date: Sat, 13 Jun 2026 01:48:23 +0200 Subject: [PATCH] Fix #37205 pass selectedline to invoice.php addline so supplements attach to parent (#38760) 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 Co-authored-by: Dolicraft --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index c054070073d..8e42acc4a68 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -587,7 +587,7 @@ function ClickProduct(position, qty = 1) { return; } // Call page invoice.php to generate the section with product lines - $("#poslines").load("invoice.php?action=addline&token=&place="+place+"&idproduct="+idproduct+"&qty="+qty+"&invoiceid="+invoiceid, function() { + $("#poslines").load("invoice.php?action=addline&token=&place="+place+"&idproduct="+idproduct+"&selectedline="+selectedline+"&qty="+qty+"&invoiceid="+invoiceid, function() {