EARecalcPurchasePrices
This document was generated using Claude.ai
Overview
Recalculates purchase prices for all lines in purchase documents by temporarily enabling price updates and triggering the standard purchase price recalculation logic. Updates unit prices, discounts, and related calculations based on current supplier pricing, purchase agreements, and system pricing rules.
When This Action Runs
Manual execution on purchase documents when prices need to be refreshed with current supplier pricing information, typically after price list updates, supplier negotiations, or when purchase prices appear outdated.
How It Works
- Initializes update scope - Creates DiscountUpdateScope if not already present
- Saves current price update setting - Preserves original updatePrice flag value
- Enables price updates - Temporarily sets updatePrice to true to allow recalculation
- Triggers price recalculation - Calls PurchasePriceUtils.updatePurchaseDocument() to recalculate all pricing
- Restores original setting - Returns updatePrice flag to its previous state
- Maintains document consistency - Ensures pricing updates don't affect other update behaviors
Parameters
This action does not require any parameters - it automatically recalculates all purchase prices in the document.
Database Tables Affected
- Purchase Document Lines - Updates unit prices, line totals, and discount calculations
- Supplier Price Lists - Reads current pricing information (read-only)
- Purchase Agreements - Uses contract pricing when applicable (read-only)
- Item Master Data - Reads standard purchase prices (read-only)
Module: supplychain
Full Class Name: com.namasoft.modules.supplychain.domain.utils.plugnplay.EARecalcPurchasePrices
Document Type: Purchase Documents Only
Related Utilities: PurchasePriceUtils for price calculations