Skip to content

[mobile] scan for stock reconciliation #264

Open
lauty95 wants to merge 33 commits intomobile_v15from
mobile_v15-stock-reconciliation-mobile
Open

[mobile] scan for stock reconciliation #264
lauty95 wants to merge 33 commits intomobile_v15from
mobile_v15-stock-reconciliation-mobile

Conversation

@lauty95
Copy link
Copy Markdown
Collaborator

@lauty95 lauty95 commented Mar 12, 2025

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 12, 2025

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% 

@agritheory agritheory self-requested a review March 26, 2025 14:41
@agritheory
Copy link
Copy Markdown
Owner

@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.

@Alchez
Copy link
Copy Markdown
Collaborator

Alchez commented May 27, 2025

@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 Alchez changed the title Mobile v15 stock reconciliation mobile [mobile] scan for stock reconciliation May 27, 2025
@agritheory
Copy link
Copy Markdown
Owner

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

@lauty95 lauty95 self-assigned this Jun 12, 2025
@lauty95 lauty95 linked an issue Jun 12, 2025 that may be closed by this pull request
@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Jun 24, 2025

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: agritheory/stonecrop#261)

Demo

Screen.Recording.2025-06-24.at.2.11.46.PM.mov

@lauty95 lauty95 marked this pull request as ready for review June 24, 2025 17:16
@agritheory
Copy link
Copy Markdown
Owner

agritheory commented Jun 25, 2025

@lauty95 Please update dependencies after release w/ Stonecrop

@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Jun 27, 2025

@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.

@agritheory
Copy link
Copy Markdown
Owner

agritheory commented Jun 27, 2025

@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?

@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Jul 17, 2025

@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

Screen.Recording.2025-07-17.at.11.50.38.AM.mov

@agritheory agritheory self-assigned this Jul 30, 2025
@agritheory
Copy link
Copy Markdown
Owner

@lauty95 Please regenerate yarn.lock ro resolve conflict

@agritheory
Copy link
Copy Markdown
Owner

@lauty95 We've made a lot of updates to the base branch, can you rebase?

@lauty95 lauty95 force-pushed the mobile_v15-stock-reconciliation-mobile branch from 3eaf2e6 to aa88cdb Compare December 4, 2025 17:32
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

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.py3384486%51, 66, 123, 209, 243, 463–464, 483–485, 490–491, 493, 495–497, 499, 504, 543, 621, 625, 662, 667, 674, 695–696, 707, 713–729
   receiving.py1251786%79, 131, 173, 214, 244, 249–260
   sqlite.py59198%40
   utils.py59689%56, 67, 73–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.py801778%80–81, 86–93, 99–100, 116, 131, 148, 151–152
   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__.py1432681%21, 25, 31, 39, 71, 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%4–6, 8, 11–13, 17–19, 21–22, 24–25, 27–29, 31–33, 35–38, 40–45, 47
www/beam
   __init__.py14140%4–7, 10–19
   index.py770%4, 6, 9–13
TOTAL128443366% 

@lauty95 lauty95 force-pushed the mobile_v15-stock-reconciliation-mobile branch from e48cba3 to aa88cdb Compare December 5, 2025 13:02
@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Dec 9, 2025

@agritheory
Updated this branch with mobile_v15

I updated playwright.yaml and pytest.yaml to avoid the following error:

Screenshot 2025-12-09 at 9 14 02 AM

Test Mobile failed for some reason, while debugging the code in beam/www/beam/stores/http.ts, in the following lines:

        const headers = computed(() => {
		// setup as a computed property to allow Frappe to set the CSRF token
		return {
			'Content-Type': 'application/json',
			'X-Frappe-CSRF-Token': frappe.csrf_token,
		}
	})

I noticed that frappe.csrf_token was undefined, so now each fetch resolves the token.

Let me know if you see anything else I should adjust

@agritheory
Copy link
Copy Markdown
Owner

@lauty95 Scanning warehouse is not working for me. The actual value of the barcode shouldn't matter.
window.scanner.simulate(window, '57996024153509900520')

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mobile] Stock Reconciliation workflow

3 participants