From f057ae7e06cace890f4b3ae2f44ed263689aa2f5 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Wed, 4 Jan 2023 19:56:55 +0100 Subject: [PATCH] Add note to barcode created by the workflow InplaceAddBarcodeToExistingProduct on /purchase and /inventory (closes #2093) --- changelog/70_UNRELEASED_xxxx.xx.xx.md | 1 + public/viewjs/inventory.js | 1 + public/viewjs/purchase.js | 1 + 3 files changed, 3 insertions(+) diff --git a/changelog/70_UNRELEASED_xxxx.xx.xx.md b/changelog/70_UNRELEASED_xxxx.xx.xx.md index a9a39305..1e4133ed 100644 --- a/changelog/70_UNRELEASED_xxxx.xx.xx.md +++ b/changelog/70_UNRELEASED_xxxx.xx.xx.md @@ -20,6 +20,7 @@ - Defaults to the product's "Quantity unit stock" (so no changed behavior when not configured) - Changed that when the ingredient option "Only check if any amount is in stock" is enabled, costs and calories are now based on the original entered amount instead of an "virtual" fixed amount of `1` - When using the "Add as barcode to existing product" workflow on a purchase transaction, the selected quantity unit and the entered amount is now also added to the new barcode +- When using the "Add as barcode to existing product" workflow on a purchase or inventory transaction, the entered note is now also added to the new barcode - Fixed that hiding the "Purchased date" column (table options) on the stock entries page didn't work - Fixed that sorting by the "Value" column on the stock overview page didn't work - Fixed that the consumed amount was wrong, when consuming multiple substituted subproducts at once and when multiple/different conversion factors were involved diff --git a/public/viewjs/inventory.js b/public/viewjs/inventory.js index 55f9ba01..9892b9aa 100644 --- a/public/viewjs/inventory.js +++ b/public/viewjs/inventory.js @@ -59,6 +59,7 @@ $('#save-inventory-button').on('click', function(e) jsonDataBarcode.barcode = GetUriParam("barcode"); jsonDataBarcode.product_id = jsonForm.product_id; jsonDataBarcode.shopping_location_id = jsonForm.shopping_location_id; + jsonDataBarcode.note = jsonForm.note; Grocy.Api.Post('objects/product_barcodes', jsonDataBarcode, function(result) diff --git a/public/viewjs/purchase.js b/public/viewjs/purchase.js index 8c0ba118..9049d902 100644 --- a/public/viewjs/purchase.js +++ b/public/viewjs/purchase.js @@ -101,6 +101,7 @@ $('#save-purchase-button').on('click', function(e) jsonDataBarcode.shopping_location_id = jsonForm.shopping_location_id; jsonDataBarcode.qu_id = jsonForm.qu_id; jsonDataBarcode.amount = jsonForm.display_amount; + jsonDataBarcode.note = jsonForm.note; Grocy.Api.Post('objects/product_barcodes', jsonDataBarcode, function(result)