Skip to content

Cutting

This document serves as a reference for the implementation details and the flow of the Cutting Module.

PieceStatus is a bitwise flag stored as a bigint in the database.

The bit mapping, from least to most significant, is as following:

BitStatusBit #Value (decimal)
1Synced01
2CardWritten12
3IssuedToSewing24
2Reserved38
2Reserved416
4Induction532
5SewingLastOperation664
6Reserved7128
6QualityPass8256
6Reserved9512
7FinishingFirstOperation101024
7FinishingLastOperation112048

Piece Status Operations

For example: A PieceStatus of 2343 corresponds to a boolean of 100100100111, which means the following operations have been performed on the piece: Synced, CardWritten, IssuedToSewing, Induction, QualityPass, FinishingLastOperation.

Checking if an operation has been performed can be done by simply checking if the corresponding bit is set to 1. This can be done by performing a bitwise AND operation between the PieceStatus and the operation’s value.

const sewingBit = 2;
const sewingValue = BigInt(2 ** sewingBit); // 2^2 = 4
const isIssuedToSewing = (PieceStatus & sewingValue) === sewingValue;

Similarly, updating an operation can be done by performing a bitwise OR operation between the PieceStatus and the operation’s value.

const sewingBit = 2;
const sewingValue = BigInt(2 ** sewingBit); // 2^2 = 4
// PieceStatus updated to flip `IssuedToSewing` to `true`
const updatedPieceStatus = PieceStatus | sewingValue;

The Overhauled Cut Plan module aims to provide a streamlined and efficient workflow for managing cutting plans, markers, cut jobs.

The module will provide a complete overview of the cutting process from a single page. This means that the UI needs to present a lot of information on a single screen.

As such, the module’s design is expected to go through several iterations. Please consider this document a work in progress.

The following data sheet serves as the basis for the reworked UI:

Cut Plan Sheet

Cut Plan ERD

  • The user can create a main cut plan grouped by the following:
    • Work Order
    • Style No
    • Buy Month
    • Color Code
  • Multiple child cut plans can be created for each main cut plan
  • Child cut plans will be correctly linked to the main cut plan
  • Each child cut plan can be created for a single work order
  • Child plans will maintain their own cut jobs and markers
  • Bundles and Pieces will only be generated for the main cut plan
  1. Select a Work Order
  2. Select a Style No
  3. (Optional) Select a Buy Month
  4. Select a Color Code
    • A cut plan will be loaded if it exists
    • If no cut plan exists, a new cut plan will be created
    • Cut Plans can be updated as long as no part of it has been executed
  5. Add/Update the sizes to include in the current cut plan, and the quantities for each size
    • Sizes and quantities will be loaded for the selections and populated as default but editable values
  6. A main cut plan will exist
    • Main cut plan can not be deleted
  7. Add/Update the panels for the cut plan
  8. Add/Update the markers for the cut plan
    • Each marker must have a no of plies
    • Each marker must have a ratio for each selected size
    • The cut quantity for the marker for each size will be calculated by multiplying the plies to the ratio
    • Markers can be added, deleted, and reordered as long as they are not executed
    • Each marker will show it’s execution status
  9. Define the cut jobs for each marker
    • Marker’s cut jobs must match the plies entered for the marker
    • Enter the no of plies for each marker
    • Cut job can be added, deleted, and reordered as long as they are not executed
    • Each cut job will be show it’s execution status
  10. Add the child cut plans as necessary.
  11. Repeat steps 7-9 for each child cut plan
  12. At any point in the the process, the cut plan can be saved to the database

Cut Plan Mockup

ERD

Available to: admin erp cutting

Required Roles: spts:cut_report:get spts:cut_report:assign_tag

This module provides the ability to assign cards/tags to a bundle’s panels and pieces. A simple offline mode is implemented to retry any failed API requests after card printing.

For a bundle to be available for card writing, the following conditions must be met:

  1. A card must not be assigned to all the bundle pieces
    • In PieceWiseCutReport, PieceStatus is less than 3
  2. At least one card printer must be connected
  3. The user must have the required permissions
  1. Select a Work Order to issue
    • All bundle with its panels will be shown in the data table
    • The bundles can be filtered by:
      • PO (multiple can be selected)
      • CutNo (multiple can be selected)
      • Panel (multiple can be selected)
      • Bundle (multiple can be selected)
      • PieceStatus (Synced, CardWritten, IssuedToSewing)
      • Scan status (all, scanned, pending)
  2. Open card writing drawer
    • Only bundles without cards will be shown
    • If one ore more printers are connected, they will automatically be assigned in round-robin fashion
  3. Select the order of card writing
    • Selecting Panel will print all the labels for one panel before moving to the next panel
    • Selecting Bundle will print all the labels for one bundle before moving to the next bundle
    • Updating the order will reassign printers automatically
  4. Make sure at least one printer is connected
  5. (Optional) Disable any printers that should not be used
  6. (Optional) Change the printer assignment if required
  7. Start printing
    • Printing will start on each printer
    • The screen will show the progress of the printing on each printer
    • All the available printers will be shown at the top along with their progress and currently printed panel and any error on it
    • When a panel finishes printing the Tag will be saved in local storage to be synced with the database and the next panel will start printing
    • Printing finished when all panels are printed
  8. After printing finishes, close the print drawer
  9. The printed tags can be synced with the database by clicking the Sync Card Writing button in Cutting module
    • The sync drawer will open
    • Check Skip Deleting Existing Group to avoid deleting existing entries in PieceWiseGroup for printed panels
    • Clicking on Sync button will send the request to the backend to sync the tags
      • If Skip Deleting Existing Group is unchecked:
        • Delete existing entries in PieceWiseGroup by BundleID, CutBundleGarDtlID, and PieceID
      • In ScanGroup, Create a new entry
      • In PieceWiseGroup, add an entry for each BundleID, CutBundleGarDtlID, and PieceID of the bundle with the new GroupID
      • In Tag:
        • If the Tag doesn’t exist, add it
        • If the Tag exists, update the GroupID, extInfo, and TagCount
      • In PieceWiseCutReport, PieceStatus is updated to include the CardWritten operation

Work in progress

Available to: admin erp cutting

Required Roles: spts:cut_report:get spts:cut_report:assign_line spts:factory:get

This module provides the ability to assign lines to a bundles and pieces.

For a bundle to be available for line assignment, the following conditions must be met:

  1. A card must be assigned to all the bundle pieces
  2. The user must have the required permissions
    • For bundles not yet issued to Sewing, assignment is available to all groups listed above
    • For bundles already issued to Sewing, assignment is not available to cutting group users
  1. Select a Work Order to issue
    • All bundle with its panels will be shown in the data table
    • The bundles can be filtered by:
      • PO (multiple can be selected)
      • CutNo (multiple can be selected)
      • Panel (multiple can be selected)
      • Bundle (multiple can be selected)
      • PieceStatus (Synced, CardWritten, IssuedToSewing)
      • Scan status (all, scanned, pending)
  2. Open assignment drawer
    • (For reassignment) An error will be shown if the user is missing permissions
    • A warning will be shown if not some bundle already have assignment
  3. For each bundle, select the Line to assign
  4. Assign bundles to the line
    • For each bundle piece, In PieceWiseCutReport:
      • LineID is set to the selected Line
      • If OriginalLineID is NULL, set it the selected Line

Work in progress

Available to: admin erp cutting

Required Roles: spts:cut_report:get spts:cut_report:issuance spts:factory:get

This module provides the ability to issue panels of a piece to different departments and track the progress.

The panels can be issued to the following departments from the Cutting department:

  • Embroidery
  • Printing
  • Fusing
  • Sewing

A bundle with all its pieces and panels can be issued to the Sewing department.

For a bundle to be available for issuance, the following conditions must be met:

  1. A card must be assigned to all the bundle pieces
    • In PieceWiseCutReport, PieceStatus is 3
  2. All the bundle pieces must be in the cutting department
    • In PieceWiseCutReport all of the following must be true
      • Either CuttingOutToEmbroideryDate is NULL or CuttingInFromEmbroideryDate is not NULL
      • Either CuttingOutToPrintingDate is NULL or CuttingInFromPrintingDate is not NULL
      • Either CuttingOutToFusingDate is NULL or CuttingInFromFusingDate is not NULL
  1. Select a Work Order to issue
    • All bundle with its panels will be shown in the data table
    • The bundles can be filtered by:
      • PO (multiple can be selected)
      • CutNo (multiple can be selected)
      • Panel (multiple can be selected)
      • Bundle (multiple can be selected)
      • PieceStatus (Synced, CardWritten, IssuedToSewing)
      • Department (N/A, Cutting, Embroidery, Printing, Fusing, Sewing)
    • Scan status (all, scanned, pending)
  2. Select Cutting as the current department
  3. UHF Reader must be connected
  4. Start scanning panels with the 8-port UHF reader
  5. After all the panels are scanned, start sewing issuance
    • All scanned bundles should be available for scanning
    • A warning will be shown if not all panels of a bundle were scanned
  6. For each bundle, select the Line to issue to
  7. Issue bundles to the department
    • For each bundle piece, In PieceWiseCutReport:
      • CuttingOutToSewingDate is set to the current time stamp
      • LineID is set to the selected Line
    • IssuanceType is set to IssuedFromPortal
    • If OriginalLineID is NULL, set it the selected Line
    • PieceStatus is set to 7

Work in progress

Panel Issuance to Embroidery, Printing or Fusing Departments

Section titled “Panel Issuance to Embroidery, Printing or Fusing Departments”

Individual panels can be issued for processing. The panels are processed and returned to the Cutting department. Issuance to these departments can only happen while the piece is in the Cutting department.

For a panel to be available for issuance, the following conditions must be met:

  1. A card must be assigned to the panel
    • In PieceWiseCutReport, PieceStatus is 3
  2. UHF Reader must be connected
  3. All piece panels must be in the cutting department
    • In PieceWiseCutReport all of the following must be true
      • Either CuttingOutToEmbroideryDate is NULL or CuttingInFromEmbroideryDate is not NULL
      • Either CuttingOutToPrintingDate is NULL or CuttingInFromPrintingDate is not NULL
      • Either CuttingOutToFusingDate is NULL or CuttingInFromFusingDate is not NULL
  1. Select a Work Order to issue
    • All bundle with its panels will be shown in the data table
    • The bundles can be filtered by:
      • PO (multiple can be selected)
      • CutNo (multiple can be selected)
      • Panel (multiple can be selected)
      • Bundle (multiple can be selected)
      • PieceStatus (Synced, CardWritten, IssuedToSewing)
      • Department (N/A, Cutting, Embroidery, Printing, Fusing, Sewing)
      • Scan status (all, scanned, pending)
  2. Select Embroidery, Printing, or Fusing as the current department
  3. Issue Panels to the selected department
    1. Set Issuance Type to IssueToDepartment
      • The list of panels will be filtered to only show the panels available
    2. Start scanning panels with the 8-port UHF reader
    3. After all the panels are scanned, Click on the Issue button
    4. Confirm the issuance in the dialog
      • In PieceWiseCutReport:
        • CuttingOutTo{Department}Date is set to the current time stamp
        • ${Department}InDate, ${Department}OutDate, and CuttingInFrom{Department}Date are set to NULL
  4. Receive Panels to the selected department
    1. Set Issuance Type to ReceiveInDepartment
      • The list of panels will be filtered to only show the panels available
    2. Start scanning panels with the 8-port UHF reader
    3. After all the panels are scanned, Click on the Receive button
    4. Confirm the receiving in the dialog
      • In PieceWiseCutReport: {Department}InDate is set to the current time stamp
      • In PiecePanelIssuanceLog: create a new entry for each piece corresponding to the panel
  5. Dispatch Panels from the selected department back to Cutting
    1. Set Issuance Type to DispatchFromDepartment
      • The list of panels will be filtered to only show the panels available
    2. Start scanning panels with the 8-port UHF reader
    3. After all the panels are scanned, Click on the Dispatch button
    4. Confirm the dispatch in the dialog
      • In PieceWiseCutReport: {Department}OutDate is set to the current time stamp
      • In PiecePanelIssuanceLog: Update the ReceiveDate for each pending entry in the log
  6. Receive Panels in Cutting
    1. Set Issuance Type to ReceiveFromDepartment
      • The list of panels will be filtered to only show the panels available
    2. Start scanning panels with the 8-port UHF reader
    3. After all the panels are scanned, Click on the Receive button
    4. Confirm the dispatch in the dialog
      • In PieceWiseCutReport: CuttingInFrom{Department}Date is set to the current time stamp

Work in progress

The following columns are shared by all tables and are therefore excluded: CreatedAt, UpdatedAt, CreatedBy, UpdatedBy