Bug 40694

Summary: "Actual cost" on receive displays in false format with CurrencyFormat != US
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: michaela.sieber
Version: 24.11   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Katrin Fischer 2025-08-22 14:29:15 UTC
When CurrencyFormat is set to "FR", the actual cost on receiving an item is displayed with a decimal comma in the input field. All input fields need to use a decimal dot or there will be an error on attempting to save the form.

To test:
* Set CurrencyFormat to FR
* Add an order, set a price with some "cents"
* Close basket
* Receive shipment
* Click on receive link - verify the input field has the , instead of the dot
* Try to save without changing - verify error message

At the moment, we need to make sure all input fields are using the . not , until we can make a global change.
Comment 1 Katrin Fischer 2025-08-22 14:36:25 UTC
It looks like this might be the fix:

                 if(invoiceincgst == "1") {
                     rrp_txt = Number(row.rrp_tax_included).format_price()+'<span class="hint"> '+ADJ_TAX_INC.format(active_currency)+"</span>";
                     ecost_txt = Number(row.ecost_tax_included).format_price()+'<span class="hint"> '+TAX_INC+"</span>";
-                    $("#unitprice").val(row.unit_price_tax_included > 0 ? Number(row.unit_price_tax_included).format_price() : Number(row.ecost_tax_included).format_price());
+                    $("#unitprice").val(row.unit_price_tax_included > 0 ? Number(row.unit_price_tax_included) : Number(row.ecost_tax_included));
                     $("#unitprice_hint").html(TAX_INC);
                 } else {
                     rrp_txt = Number(row.rrp_tax_excluded).format_price()+'<span class="hint"> '+ADJ_TAX_EXC.format(active_currency)+"</span>";
                     ecost_txt = Number(row.ecost_tax_excluded).format_price()+'<span class="hint"> '+TAX_EXC+"</span>";
-                    $("#unitprice").val(row.unit_price_tax_excluded > 0 ? Number(row.unit_price_tax_excluded).format_price() : Number(row.ecost_tax_excluded).format_price());
+                    $("#unitprice").val(row.unit_price_tax_excluded > 0 ? Number(row.unit_price_tax_excluded) : Number(row.ecost_tax_excluded));
                     $("#unitprice_hint").html(TAX_EXC);
                 }