Skip to content

Conversation

@ehuelsmann
Copy link
Member

@ehuelsmann ehuelsmann commented Jul 13, 2025

On request of @freelock, added manual taxes on orders.

After this change, tax recalculation on the order requires the user to switch the order back to Automatic, which recalculates (and switches back to Manual after saving).

Problems that need addressing:

  • When converting an order partially to an invoice (that is, some of the order, but not all), the manual tax table is copied verbatim, resulting in clear incorrect numbers; solutions:
    1. clear all the fields, but keep the manual tax checkmark (which shows an empty table, with no reference of what was in the order)
    2. set the invoice to automatic calculation (which recalculates taxes; which could be wrong, but isn't necessarily; the table equally misses reference to what was on the order)

@ehuelsmann ehuelsmann requested review from Copilot and freelock July 13, 2025 18:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for defining manual tax entries on orders/quotes and ensures these are persisted and reloaded instead of automatically recalculating taxes.

  • Wraps existing tax calculation in save() with a manual_tax check and inserts manual tax rows when enabled
  • Queries and populates manual tax values in retrieve() if saved entries exist
  • Updates Changelog to document the new manual-tax feature and its effect on recalculation

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
old/lib/LedgerSMB/OE.pm Added conditional branches in save()/retrieve() to handle manual taxes
Changelog Noted ability to manually enter taxes and changed tax recalculation behavior
Comments suppressed due to low confidence (1)

old/lib/LedgerSMB/OE.pm:301

  • Consider adding automated tests to cover the new manual-tax entry and retrieval logic to validate both save and load flows.
            if (!$form->{manual_tax}){

@ehuelsmann ehuelsmann linked an issue Jul 13, 2025 that may be closed by this pull request
@ehuelsmann ehuelsmann marked this pull request as draft July 13, 2025 20:40
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.

Provide ability to set tax manually on Sales Orders

1 participant