From 4fa8045d70ae735e6f2f36e68f48d7e1ba27793d Mon Sep 17 00:00:00 2001 From: Sajo <75281007+sajotrei@users.noreply.github.com> Date: Mon, 10 Aug 2026 16:36:39 +0200 Subject: [PATCH 1/2] feat: aggiungi arrotondamento totale nei documenti di vendita --- include/document-rounding.php | 244 ++++++++++++++++++++++++++ modules/contratti/buttons.php | 9 + modules/fatture/buttons.php | 9 +- modules/preventivi/buttons.php | 8 + src/Common/DocumentRounding.php | 236 +++++++++++++++++++++++++ tests/Common/DocumentRoundingTest.php | 29 +++ update/2_11_3.sql | 7 + 7 files changed, 541 insertions(+), 1 deletion(-) create mode 100644 include/document-rounding.php create mode 100644 src/Common/DocumentRounding.php create mode 100644 tests/Common/DocumentRoundingTest.php create mode 100644 update/2_11_3.sql diff --git a/include/document-rounding.php b/include/document-rounding.php new file mode 100644 index 0000000000..51a0525cf7 --- /dev/null +++ b/include/document-rounding.php @@ -0,0 +1,244 @@ + '.tr('Arrotondamento non disponibile.').''; + return; +} + +$document = null; +$isInvoice = false; +$blockedReasons = []; +$vatLocked = false; +$accountId = null; + +switch ((string) $module->directory) { + case 'preventivi': + $document = Preventivo::find($id_record); + if (!$document || !empty($document->stato->is_bloccato)) { + echo '