Skip to content

[BUG]: Negative invoice line amount shown and invalid invoice submission allowed #148

@Atharva0506

Description

@Atharva0506

Bug Description

When creating an invoice, entering values where Discount is greater than Qty × Unit Price can produce a negative line amount in the UI. In this state, invoice creation behavior is inconsistent and users do not get clear validation feedback.

This should be prevented with proper validation and standardized toast feedback.

Steps to Reproduce

  1. Go to Dashboard → Create Invoice
  2. Add an item:
    • Description: Test
    • Qty: 10
    • Unit Price: 10
    • Discount: 1000
    • Tax: 0
  3. Observe the line amount display
  4. Try clicking Create Invoice

Expected Behavior

  • Negative amounts should never be accepted.
  • Users should see a clear toast/form validation message explaining what is wrong.
  • Invoice creation should be blocked until values are valid.
  • Total amount due should remain consistent with line-item validation.

Actual Behavior

  • UI can show a negative line amount in this scenario.
  • Validation feedback is unclear/inconsistent for invalid negative amount states.
  • Invalid data may proceed further than expected in the create flow.

Logs and Screenshots

Image

Environment Details

  • OS: Windows 11
  • Browser: Chrome
  • Network: Any supported chain
  • Wallet: Metamask

Impact

High - Major feature is broken

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions