Skip to content

Add operation workflow to Beam mobile#342

Open
lauty95 wants to merge 30 commits into
mobile_v15from
issue-302
Open

Add operation workflow to Beam mobile#342
lauty95 wants to merge 30 commits into
mobile_v15from
issue-302

Conversation

@lauty95

@lauty95 lauty95 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Implement Job Card Operation Workflow

Adds a complete job card workflow for the Beam mobile interface with real-time timer, quantity tracking, and proper status validation.

Changes

  • Operation.vue: Real-time timer with timezone-safe calculations, workflow controls (Start/Pause/Finish), and quantity tracking
  • beam.ts: Simplified store using native ERPNext make_time_log
  • Timezone Issue: Uses frappe.datetime.now_datetime() to ensure the frontend gets the same timezone that the backend uses
  • Timer Accuracy: Calculates elapsed time from time logs (closed + active session) to survive page reloads
  • Validation: Frontend status checks combined with ERPNext backend conflict detection
  • setCurrentEmployee: Sets the current employee name to assign a job card to themselves

Fixtures

  • Jordan Mills added as a new user with "BEAM Mobile User", "Employee", and "Manufacturing User" roles
  • All employees have "admin" as their password

Tests

  • Mobile workflow tests in test_job_card_operation.py covering operation details display, timer start/pause, and timer stop with time log recording

Demo

Screen.Recording.2026-04-30.at.3.29.21.PM.mov

@lauty95 lauty95 marked this pull request as draft April 29, 2026 17:51
@github-actions

Copy link
Copy Markdown

📝 Draft Changelog Entry

Changelog Entry

This update adds comprehensive job card functionality to the manufacturing workflow. Job cards can now be created, saved, and tracked with associated time logs. The operation workflow has been expanded to support job card management, including the ability to set the current employee and track department information.

Testing coverage has been added for job card operations to ensure reliability. The manufacturing user role has been introduced to support proper access control for job card-related tasks. Documentation has been updated with instructions for running backend and frontend tests.

Fixed an issue where department changes were not being properly handled in the workflow. Code quality improvements have been made to align with project linting standards.

This changelog entry was automatically generated by the Changelog Generator Action.

@lauty95 lauty95 self-assigned this Apr 29, 2026
@lauty95 lauty95 linked an issue Apr 29, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py10100% 
beam
   barcodes.py1073963%21, 30, 36–37, 43, 46, 58, 80–81, 83–84, 90–92, 94–96, 103–105, 111, 121, 129, 136, 139–140, 146–147, 153, 159, 165, 171, 183, 186–189, 191–192
   handling_unit.py813655%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
   manufacturing.py74740%4, 7–10, 13–14, 20, 23–26, 28–29, 32, 34–38, 41, 47–53, 55, 58, 64–66, 68, 70–75, 78–79, 89–93, 96–98, 100–102, 107, 112, 114–115, 118–120, 122, 130, 133–135, 137, 146–151, 153, 155
   printing.py935540%18–19, 48, 50–53, 62–66, 70–71, 83–87, 91, 97, 106–112, 114–115, 117, 122, 124–125, 140–145, 147–153, 160–163, 165–168
   zpl_layout.py2442440%12–15, 17, 20, 36, 47–48, 51–52, 54–55, 58, 61, 64–67, 69–71, 77, 81–83, 86–87, 90–91, 93–94, 99, 101, 110–111, 113, 115, 118–120, 122–125, 128–129, 132, 140–141, 144–146, 154, 157, 161, 164, 167, 177–183, 185, 188, 193–196, 198, 201–206, 209–215, 217, 219, 222, 224–227, 231–233, 235–239, 241–245, 249–253, 258, 260, 263–269, 278–282, 285–292, 295–308, 311–313, 316–328, 331, 334–336, 339–353, 356–361, 364, 366, 369, 384, 386–387, 390–391, 393, 395, 397–399, 402, 411, 418–420, 423–424, 427, 429–433, 436, 439–442, 445–448, 451–453, 469, 471, 474–475, 496–501, 505, 507–508, 516–521
beam/demand
   demand.py3384586%51, 66, 123, 209, 243, 290, 293, 463–464, 483–485, 490–491, 493, 495–497, 499, 543, 621, 625, 662, 667, 674, 695–696, 707, 713–729
   receiving.py1251786%79, 131, 173, 214, 244, 249–260
   sqlite.py60198%41
   utils.py59689%56, 67, 73–75, 83
beam/doctype/beam_mobile_route
   beam_mobile_route.py30100% 
beam/doctype/beam_settings
   beam_settings.py341750%35–37, 40–41, 43, 50, 55–58, 66–68, 72–74
beam/doctype/handling_unit
   __init__.py9366%12–14
   handling_unit.py17194%27
beam/doctype/warehouse_types
   warehouse_types.py30100% 
beam/overrides
   network_printer_settings.py403220%14–18, 24–34, 42–46, 49, 52–55, 57–62
   sales_order.py10640%11–16
   stock_entry.py911682%115–116, 121–128, 134–135, 151, 183, 186–187
   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__.py1912785%24, 34, 161–162, 172, 174–175, 179, 183–184, 187, 193, 204–205, 209, 230, 234, 263, 265, 284–285, 291, 294, 297, 406, 414, 421
   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
TOTAL174978055% 

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

Draft Changelog Entry

Changelog

The Job Card Operation workflow has been implemented for the Beam mobile interface. Manufacturing users can now start, pause, and finish job card operations directly from their mobile devices with real-time tracking of elapsed time and completed quantities.

The operation screen displays a live timer that accurately tracks work duration across page reloads by calculating elapsed time from recorded time logs. The timer uses timezone-safe calculations to ensure consistency between the mobile app and backend system. Users can record the quantity of items completed during each operation session.

The workflow includes validation checks to prevent conflicting operations. When starting or finishing an operation, the system verifies the current status both on the mobile device and in the backend system to ensure data integrity.

A new employee user account has been added to the system for testing purposes. Manufacturing users can now assign job cards to themselves through the mobile interface.

This changelog entry was automatically generated by the Changelog Generator Action.

@lauty95

lauty95 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

@agritheory

I replaced window.prompt with an inline quantity input and made a few design updates.

Accordion

Screen Recording 2026-05-07 at 2 39 07 PM

Details

I added a new test user: Cassidy Reyes.

I also added custom Job Card endpoints in beam/beam/manufacturing.py. This lets multiple employees work on the same Job Card over time, while still submitting the Job Card only once the required quantity is complete.

The main reason for the custom endpoint is that ERPNext's standard Job Card flow was hitting Employee user-permission issues when a different employee tried to continue a Job Card that had already been started by someone else.

With this flow:

  • Employee A can start an operation.
  • Employee A pauses it and records the completed quantity for that session.
  • Employee B can later continue the same Job Card.
  • The Job Card is submitted only when the full quantity has been completed.

This matches the workflow we discussed: multiple employees can contribute to the same Job Card without creating/submitting separate Job Cards for each person.

Demo

Screen.Recording.2026-05-07.at.2.31.31.PM.mov

@lauty95 lauty95 marked this pull request as ready for review May 7, 2026 17:47
@lauty95 lauty95 requested a review from agritheory May 7, 2026 17:47
@lauty95 lauty95 changed the title Issue 302 Add operation workflow to Beam mobile May 7, 2026
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 Job Card UI Tests

1 participant