Hey guys,
We’ve encountered a repeatable fatal error when saving a Quote/Delivery Order in EspoCRM Sales Pack.
Error details:
Type: DivisionByZeroError Message: Division by zero File: /custom/Espo/Modules/Sales/Tools/Quote/BeforeSaveProcessor.php Line: 267 Trace: Espo\Modules\Sales\Tools\Quote\BeforeSaveProcessor->calculateItem()
Full stack trace is attached below.
Context:
- Occurs during beforeSave for Quote (and Delivery Order linked to an Opportunity).
 - We cannot modify PHP source code on our hosting.
 - Looks like calculateItem() is dividing by a field that sometimes ends up as zero (quantity, packQty, duration, or currency rate).
 
Expected behavior:
- BeforeSaveProcessor should gracefully handle zero or null divisor fields — either skip calculation or default to 1 — instead of throwing an uncaught DivisionByZeroError.
 
Request:
- Please update calculateItem() (and related calls) to validate divisor fields and avoid division by zero.
 - Ideally, it should log a warning and continue processing or block save with a clear validation error in the UI.
 
Why this matters:
- This error completely prevents saving affected records and disrupts workflows.
 - Since it’s in core logic, we cannot patch it without modifying EspoCRM code.
 
This is happening across the board on different records

Comment