beam icon indicating copy to clipboard operation
beam copied to clipboard

[mobile] scan for stock reconciliation

Open lauty95 opened this issue 1 year ago • 10 comments

Stock Reconciliation [Mobile version]

Reconciliation option added to menu

This option menu was added to setup.py so it should be included when executing bench execute 'beam.tests.setup.before_test'

Screenshot 2025-03-12 at 8 27 03 AM

Handling WH Scan

You can scan or select a Warehouse

Screenshot 2025-03-12 at 8 28 21 AM

The data is handled in mappers of the store, similar to how it is managed in the Move or Repack pages.

lauty95 avatar Mar 12 '25 11:03 lauty95

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py10100% 
beam
   barcodes.py793456%20, 22, 24, 27, 38–39, 41–42, 47–48, 50–51, 53–55, 61, 71, 79, 86, 89–90, 96–97, 103, 109, 115, 121, 128, 131–134, 136–137
   handling_unit.py813754%26, 32, 64–66, 84, 95–96, 102–103, 105–106, 108–109, 111–112, 114, 116–119, 121–123, 125, 127, 129–130, 135, 137, 141, 143–144, 147, 149–150, 158
   printing.py826421%18–19, 32–43, 45–48, 57–61, 65–66, 68–69, 78–82, 85–86, 92–94, 101–102, 104–106, 108–109, 111, 116, 118–119, 134–139, 141–150
beam/demand
   demand.py3389472%51, 66, 123, 209, 243, 290, 293, 425–426, 428–429, 432–433, 435, 439–444, 446, 448–449, 452, 457, 459–464, 466, 468, 471, 474, 479, 483–485, 490–491, 493, 495–497, 499, 505, 507–510, 512–515, 517, 519, 522–523, 525–526, 529, 543, 560–561, 563–565, 621, 625, 662, 667, 674, 695–696, 707, 713–729, 853
   receiving.py1251786%79, 131, 173, 214, 244, 249–260
   sqlite.py59198%40
   utils.py59788%56, 67, 72–75, 83
beam/doctype/beam_mobile_route
   beam_mobile_route.py30100% 
beam/doctype/beam_settings
   beam_settings.py281739%35–37, 40–41, 43, 50, 55–58, 66–68, 72–74
beam/doctype/handling_unit
   __init__.py9366%12–14
   handling_unit.py150100% 
beam/doctype/warehouse_types
   warehouse_types.py30100% 
beam/overrides
   sales_order.py10640%11–16
   stock_entry.py671774%61–62, 67–74, 80–81, 97, 112, 129, 132–133
   work_order.py10280%14, 16
beam/report/demand_map
   demand_map.py35350%4–5, 7–8, 11–12, 15–16, 103–111, 127, 129–143, 146–147
beam/report/handling_unit_traceability
   handling_unit_traceability.py44440%4–6, 9–11, 30–32, 34–35, 37–38, 41–42, 45–46, 48–49, 51–52, 54–55, 57, 63–65, 67–69, 71, 74–77, 79–81, 83–86, 89–90
beam/scan
   __init__.py1432880%21, 25, 31, 39, 90, 93–94, 118–119, 129, 131–132, 136, 140–141, 144, 155–156, 160, 181, 185, 214, 216, 235–236, 242, 245, 248
   config.py28280%4, 6, 9–17, 19–21, 23–26, 28–30, 32–35, 38–39, 41
   user_login.py31310%1–3, 5, 8–10, 14–16, 18–19, 21–22, 24–26, 28–30, 32–35, 37–42, 44
www/beam
   __init__.py14140%4–7, 10–19
   index.py770%4, 6, 9–13
TOTAL127148661% 

github-actions[bot] avatar Mar 12 '25 11:03 github-actions[bot]

@lauty95 I am not seeing a scan of any warehouse have an effect, and when I try to select form the drop down, I'm not seeing either the selection or the items in the warehouse.

agritheory avatar Apr 30 '25 15:04 agritheory

@agritheory @lauty95 I was only able to use barcodes setup in Warehouses (3114794434123221501 vs Kitchen - APC). Let me know if that's the actual behaviour, or it should also allow plaintext scans.

and when I try to select form the drop down, I'm not seeing either the selection or the items in the warehouse.

I'm seeing the same behaviour, and it doesn't seem like the items are being mapped to the view correctly. @lauty95 should it be pulling from the mapped Stock Recon document directly?

Alchez avatar May 27 '25 06:05 Alchez

@lauty95 Just tested this again - not seeing any items populate when I scan a warehouse

agritheory avatar Jun 04 '25 13:06 agritheory

Debugg

I added a console.log to debugg the warehouse list Screenshot 2025-06-24 at 2 01 02 PM

Let me know if you can see the select dropdown populated with warehouses on any other page.

Screenshot 2025-06-24 at 2 01 17 PM

Components

I temporarily added ItemCount.vue, ListItem.vue and ListVuew.vue to test some features (changes were also included in the Stonecrop PR: https://github.com/agritheory/stonecrop/pull/261)

Demo

https://github.com/user-attachments/assets/355f7864-8175-476d-996c-6c9baa73f2d3

lauty95 avatar Jun 24 '25 17:06 lauty95

@lauty95 Please update dependencies after release w/ Stonecrop

agritheory avatar Jun 25 '25 14:06 agritheory

@lauty95 Just tested this again - not seeing any items populate when I scan a warehouse

Could you test it again? I installed a new site and it’s working for me.

If it’s still not working, I left some console.logs to help with debugging.

lauty95 avatar Jun 27 '25 14:06 lauty95

@lauty95 Clearing the warehouse with the [x] button does not remove the items from the list, but scanning a warehouse does populate the items in the first place.

image

Scanning an item does not increment its quantity which it should.

Scanning a new item does not correctly add it to the list (I scanned Butter, which was not kept in this warehouse)

image

Discussion point: image

I'm not sure we should any items where the actual qty is 0, which should be part of the db query/filter?

agritheory avatar Jun 27 '25 14:06 agritheory

@agritheory

Features

  • x button now removes the items
  • scanning an item now increments its quantity

Discussion

I added a function to get items similar to what the Stock Reconciliation Doctype does. Also, I added a filter by valuation_rate because when you try to save the list with items that don't have a valuation_rate, Frappe prevents you from saving the document.

Screenshot 2025-07-17 at 11 59 55 AM

Let me know if it's ok.

Demo

https://github.com/user-attachments/assets/d5f9de97-aaa9-4f2f-9bb1-21ea66f3c080

lauty95 avatar Jul 17 '25 15:07 lauty95

@lauty95 Please regenerate yarn.lock ro resolve conflict

agritheory avatar Sep 26 '25 15:09 agritheory