Skip to content

Commit f6e2e1a

Browse files
committed
v1.3.7
Settings: - Fix blank icon in settings (Issue #21) - Settings page split into 4 tabs: General, Authentication, Outgoing, Incoming - Per-environment auth credentials — switch TEST/DEMO/PRODUCTION without re-entering tokens - Setting to disable the "Validate and Upload" button for making validate/enter payment/then upload to KSeF a bit more obvious - Add default invoice payment settings to set terms, method, and account during invoice creation automagically, can be overridden by thirdparty values - VAT rate code helper in General settings to enable/disable ZW/RC/NP/NP2/WDT/EX codes - Automatically adds KSeF VAT codes into dictionary if missing - Notes default to Simple-Stopka on new installs Extrafields/Notes: - Third Party and Product extrafields can be created/managed from the module setup page. Fields not made with KSeF module have an "ext" badge to differentiate pre-existing vs added within module - Project extrafields support - Third Party extrafields support in XML output - Extrafields assigned as per-line extrafields result in these fields appearing on the invoice line-items, allowing for per-item additional notes that link back to invoice line number - Extrafield notes now have target — each field routable to either DodatkowyOpis or StopkaFaktury - Fix XML build error after extrafield deletion Invoices: - After payment is recorded, payment status sent in FA(3) XML (Issue #24) - Multiple payments status and payment detail breakdown for incoming invoices - P_10 line discount: include discount amount in FaWiersz when remise_percent > 0, calculated as unitPrice × qty − lineTotal - NrZamowienia sourced from ref_client (default), linked sales order number, or custom extrafield. Multiple linked orders on a single invoice results in multiple Zamowienia numbers on the invoice (Issue #23) - NrUmowy sourced from third party extrafield so contract number auto-populates from customer record (Issue #23) - NrUmowy also supports invoice extrafield source - Note_public now routable to StopkaFaktury instead (Issue #23). The options are now Simple-Stopka, Simple-DodatkowyOpis, and Key:Value-DodatkowyOpis - Boilerplate invoice footer note on every invoice in module settings (such as for additional company information, legal disclaimers, etc) - Explicit WDT and EX VAT source codes for intra-EU and export lines - Fix line descriptions to use full line desc (with serial numbers, order refs, multiline text as configured on dolibarr page) instead of just product_label, truncated to 512 chars per schema VAT: - Tax exemption support - disabled by default. When enabled and legal basis configured, if invoice has ZW lines puts P_19+P_19A/B/C into XML. Has global default plus per-product extrafield override. Settings hidden when disabled - Fix VAT summary when invoice mixes 22%+23% or 7%+8% rate lines - VAT summary now takes into account KR/ZW/etc The Rest: - KSeF-style PDF preview for draft and validated invoices before submission (Issue #22) - Registries section on PDF only shows columns (KRS/REGON/BDO) that have data - Upload to KSeF button available on paid/closed invoices that haven't been uploaded - Updated How To Use section explaining setup for ZW/RC/NP/WDT codes, adding rates, and exemption setup guide - Migrations to support new auth + notes settings changes
1 parent 34214a8 commit f6e2e1a

22 files changed

Lines changed: 4820 additions & 1667 deletions

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,40 @@ This module was developed by InPoint Automation Sp. z o.o.
111111

112112

113113
## Changelog
114+
>### Version v1.3.7
115+
>- Fix blank icon in settings (Issue #21)
116+
>- Settings page split into 4 tabs: General, Authentication, Outgoing, Incoming
117+
>- Per-environment auth credentials — switch TEST/DEMO/PRODUCTION without re-entering tokens
118+
>- Setting to disable the "Validate and Upload" button for making validate/enter payment/then upload to KSeF a bit more obvious
119+
>- Add default invoice payment settings to set terms, method, and account during invoice creation automagically, can be overridden by thirdparty values
120+
>- VAT rate code helper in General settings to enable/disable ZW/RC/NP/NP2/WDT/EX codes
121+
>- Automatically adds KSeF VAT codes into dictionary if missing
122+
>- Notes default to Simple-Stopka on new installs
123+
>- Third Party and Product extrafields can be created/managed from the module setup page. Fields not made with KSeF module have an "ext" badge to differentiate pre-existing vs added within module
124+
>- Project extrafields support
125+
>- Third Party extrafields support in XML output
126+
>- Extrafields assigned as per-line extrafields result in these fields appearing on the invoice line-items, allowing for per-item additional notes that link back to invoice line number
127+
>- Extrafield notes now have target — each field routable to either DodatkowyOpis or StopkaFaktury
128+
>- Fix XML build error after extrafield deletion
129+
>- After payment is recorded, payment status sent in FA(3) XML (Issue #24)
130+
>- Multiple payments status and payment detail breakdown for incoming invoices
131+
>- P_10 line discount: include discount amount in FaWiersz when remise_percent > 0, calculated as unitPrice × qty − lineTotal
132+
>- NrZamowienia sourced from ref_client (default), linked sales order number, or custom extrafield. Multiple linked orders on a single invoice results in multiple Zamowienia numbers on the invoice (Issue #23)
133+
>- NrUmowy sourced from third party extrafield so contract number auto-populates from customer record (Issue #23)
134+
>- NrUmowy also supports invoice extrafield source
135+
>- Note_public now routable to StopkaFaktury instead (Issue #23). The options are now Simple-Stopka, Simple-DodatkowyOpis, and Key:Value-DodatkowyOpis
136+
>- Boilerplate invoice footer note on every invoice in module settings (such as for additional company information, legal disclaimers, etc)
137+
>- Explicit WDT and EX VAT source codes for intra-EU and export lines
138+
>- Fix line descriptions to use full line desc (with serial numbers, order refs, multiline text as configured on dolibarr page) instead of just product_label, truncated to 512 chars per schema
139+
>- Tax exemption support - disabled by default. When enabled and legal basis configured, if invoice has ZW lines puts P_19+P_19A/B/C into XML. Has global default plus per-product extrafield override. Settings hidden when disabled
140+
>- Fix VAT summary when invoice mixes 22%+23% or 7%+8% rate lines
141+
>- VAT summary now takes into account KR/ZW/etc
142+
>- KSeF-style PDF preview for draft and validated invoices before submission (Issue #22)
143+
>- Registries section on PDF only shows columns (KRS/REGON/BDO) that have data
144+
>- Upload to KSeF button available on paid/closed invoices that haven't been uploaded
145+
>- Updated How To Use section explaining setup for ZW/RC/NP/WDT codes, adding rates, and exemption setup guide
146+
>- Migrations to support new auth + notes settings changes
147+
114148
>### Version v1.3.6
115149
>- Add check for whether module was enabled/disabled after updating, and a notification in settings menu to do so if it has not
116150
>- Notes support for outgoing invoices, sourced from public notes (simple or key:value modes) and/or selected invoice extrafields (Issue #19)

README_PL.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,40 @@ możliwość nauki na podstawie ich modułu, ten projekt zajęłby znacznie wię
109109
Ten moduł został opracowany przez InPoint Automation Sp. z o.o.
110110

111111
## Changelog (In English)
112+
>### Version v1.3.7
113+
>- Fix blank icon in settings (Issue #21)
114+
>- Settings page split into 4 tabs: General, Authentication, Outgoing, Incoming
115+
>- Per-environment auth credentials — switch TEST/DEMO/PRODUCTION without re-entering tokens
116+
>- Setting to disable the "Validate and Upload" button for making validate/enter payment/then upload to KSeF a bit more obvious
117+
>- Add default invoice payment settings to set terms, method, and account during invoice creation automagically, can be overridden by thirdparty values
118+
>- VAT rate code helper in General settings to enable/disable ZW/RC/NP/NP2/WDT/EX codes
119+
>- Automatically adds KSeF VAT codes into dictionary if missing
120+
>- Notes default to Simple-Stopka on new installs
121+
>- Third Party and Product extrafields can be created/managed from the module setup page. Fields not made with KSeF module have an "ext" badge to differentiate pre-existing vs added within module
122+
>- Project extrafields support
123+
>- Third Party extrafields support in XML output
124+
>- Extrafields assigned as per-line extrafields result in these fields appearing on the invoice line-items, allowing for per-item additional notes that link back to invoice line number
125+
>- Extrafield notes now have target — each field routable to either DodatkowyOpis or StopkaFaktury
126+
>- Fix XML build error after extrafield deletion
127+
>- After payment is recorded, payment status sent in FA(3) XML (Issue #24)
128+
>- Multiple payments status and payment detail breakdown for incoming invoices
129+
>- P_10 line discount: include discount amount in FaWiersz when remise_percent > 0, calculated as unitPrice × qty − lineTotal
130+
>- NrZamowienia sourced from ref_client (default), linked sales order number, or custom extrafield. Multiple linked orders on a single invoice results in multiple Zamowienia numbers on the invoice (Issue #23)
131+
>- NrUmowy sourced from third party extrafield so contract number auto-populates from customer record (Issue #23)
132+
>- NrUmowy also supports invoice extrafield source
133+
>- Note_public now routable to StopkaFaktury instead (Issue #23). The options are now Simple-Stopka, Simple-DodatkowyOpis, and Key:Value-DodatkowyOpis
134+
>- Boilerplate invoice footer note on every invoice in module settings (such as for additional company information, legal disclaimers, etc)
135+
>- Explicit WDT and EX VAT source codes for intra-EU and export lines
136+
>- Fix line descriptions to use full line desc (with serial numbers, order refs, multiline text as configured on dolibarr page) instead of just product_label, truncated to 512 chars per schema
137+
>- Tax exemption support - disabled by default. When enabled and legal basis configured, if invoice has ZW lines puts P_19+P_19A/B/C into XML. Has global default plus per-product extrafield override. Settings hidden when disabled
138+
>- Fix VAT summary when invoice mixes 22%+23% or 7%+8% rate lines
139+
>- VAT summary now takes into account KR/ZW/etc
140+
>- KSeF-style PDF preview for draft and validated invoices before submission (Issue #22)
141+
>- Registries section on PDF only shows columns (KRS/REGON/BDO) that have data
142+
>- Upload to KSeF button available on paid/closed invoices that haven't been uploaded
143+
>- Updated How To Use section explaining setup for ZW/RC/NP/WDT codes, adding rates, and exemption setup guide
144+
>- Migrations to support new auth + notes settings changes
145+
112146
>### Version v1.3.6
113147
>- Add check for whether module was enabled/disabled after updating, and a notification in settings menu to do so if it has not
114148
>- Notes support for outgoing invoices, sourced from public notes (simple or key:value modes) and/or selected invoice extrafields (Issue #19)

admin/about.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,16 @@
272272
'value' => $nip_configured ? $conf->global->KSEF_COMPANY_NIP : null
273273
);
274274

275-
$has_token = !empty($conf->global->KSEF_AUTH_TOKEN);
276-
$has_auth_cert = !empty($conf->global->KSEF_AUTH_CERTIFICATE) &&
277-
!empty($conf->global->KSEF_AUTH_PRIVATE_KEY) &&
278-
!empty($conf->global->KSEF_AUTH_KEY_PASSWORD);
275+
$_authEnv = getDolGlobalString('KSEF_ENVIRONMENT', 'TEST');
276+
$has_token = !empty(getDolGlobalString('KSEF_AUTH_TOKEN_' . $_authEnv));
277+
$has_auth_cert = !empty(getDolGlobalString('KSEF_AUTH_CERTIFICATE_' . $_authEnv)) &&
278+
!empty(getDolGlobalString('KSEF_AUTH_PRIVATE_KEY_' . $_authEnv)) &&
279+
!empty(getDolGlobalString('KSEF_AUTH_KEY_PASSWORD_' . $_authEnv));
279280

280281
$auth_cert_valid_to = null;
281282
$auth_cert_expired = false;
282-
if ($has_auth_cert && !empty($conf->global->KSEF_AUTH_CERT_VALID_TO)) {
283-
$auth_cert_valid_to = $conf->global->KSEF_AUTH_CERT_VALID_TO;
283+
if ($has_auth_cert && !empty(getDolGlobalString('KSEF_AUTH_CERT_VALID_TO_' . $_authEnv))) {
284+
$auth_cert_valid_to = getDolGlobalString('KSEF_AUTH_CERT_VALID_TO_' . $_authEnv);
284285
$auth_cert_expired = ($auth_cert_valid_to < dol_now());
285286
}
286287

@@ -311,14 +312,14 @@
311312
'value' => $auth_value
312313
);
313314

314-
$has_offline_cert = !empty($conf->global->KSEF_OFFLINE_CERTIFICATE) &&
315-
!empty($conf->global->KSEF_OFFLINE_PRIVATE_KEY) &&
316-
!empty($conf->global->KSEF_OFFLINE_KEY_PASSWORD);
315+
$has_offline_cert = !empty(getDolGlobalString('KSEF_OFFLINE_CERTIFICATE_' . $_authEnv)) &&
316+
!empty(getDolGlobalString('KSEF_OFFLINE_PRIVATE_KEY_' . $_authEnv)) &&
317+
!empty(getDolGlobalString('KSEF_OFFLINE_KEY_PASSWORD_' . $_authEnv));
317318

318319
$offline_cert_valid_to = null;
319320
$offline_cert_expired = false;
320-
if ($has_offline_cert && !empty($conf->global->KSEF_OFFLINE_CERT_VALID_TO)) {
321-
$offline_cert_valid_to = $conf->global->KSEF_OFFLINE_CERT_VALID_TO;
321+
if ($has_offline_cert && !empty(getDolGlobalString('KSEF_OFFLINE_CERT_VALID_TO_' . $_authEnv))) {
322+
$offline_cert_valid_to = getDolGlobalString('KSEF_OFFLINE_CERT_VALID_TO_' . $_authEnv);
322323
$offline_cert_expired = ($offline_cert_valid_to < dol_now());
323324
}
324325

0 commit comments

Comments
 (0)