1. View Quotations
Scenario: User views quotations list
- Given the User is on the Quotations Page
- Then the User can see a table of all quotations
- And the table displays columns for ID, Name, Total Price, Created Date, and Print button
- And the User can see the total count of quotations
Scenario: User views empty quotations list
- Given the User is on the Quotations Page
- When there are no quotations in the system
- Then the User should see an empty state message
- And the User should see an option to create a new quotation
2. Create Quotation
Scenario: User creates a new quotation
- Given the User is on the Quotations Page
- When the User clicks the 'Create Quotation' button
- Then a modal will pop up with input fields for Branch, Customer, Inventory items, Quantity, Price per unit, and Discount
- When the User selects a Branch
- And the User selects a Customer
- And the User adds at least one Inventory item with quantity and price
- And the User clicks the 'Create Quotation' button
- Then the modal will close
- And the new quotation will appear in the quotations table
Scenario: User adds multiple items to a quotation
- Given the User is on the Create Quotation modal
- When the User adds multiple inventory items with their respective quantities and prices
- Then the total price should update accordingly
- And all items should be included in the quotation
Scenario: User applies a discount to a quotation
- Given the User is on the Create Quotation modal
- When the User enters a discount amount
- Then the total price should be recalculated to reflect the discount
Scenario: User attempts to create a quotation with missing required fields
- Given the User is on the Create Quotation modal
- When the User leaves the Branch field empty
- Or the User does not add any inventory items
- And the User attempts to submit the form
- Then the form will not be submitted
- And the User will be notified which fields are required
Scenario: User attempts to create a quotation with invalid quantity
- Given the User is on the Create Quotation modal
- When the User enters a non-positive number for quantity
- And the User attempts to submit the form
- Then the form will not be submitted
- And the User will be notified that the quantity must be positive
Scenario: User attempts to create a quotation with invalid price
- Given the User is on the Create Quotation modal
- When the User enters a negative number for price per unit
- And the User attempts to submit the form
- Then the form will not be submitted
- And the User will be notified that the price cannot be negative
3. Print Quotation
Scenario: User prints a quotation
- Given the User is on the Quotations Page
- When the User clicks the 'Print' button for a specific quotation
- Then a PDF should be generated with the quotation details
- And the PDF should include the Branch, Customer information, all items with quantities and prices, and the total price
Scenario: User attempts to print a missing quotation
- Given the User is on the Quotations Page
- When the User attempts to print a quotation that no longer exists
- Then the User should see an error message
- And be prompted to refresh the quotations list