Skip to content

Commit

Permalink
Merge pull request #115 from dingo-d/hotfix/fiscalization-save-fix
Browse files Browse the repository at this point in the history
Fix fiscalization options issue
  • Loading branch information
dingo-d authored Aug 9, 2023
2 parents 7f666f0 + b19cf9d commit af539b5
Show file tree
Hide file tree
Showing 8 changed files with 6,439 additions and 11,493 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a

_No documentation available about unreleased changes as of yet._

## [3.1.1] - 2023-08-09

### Fixed

* Fix issue with saving of the fiscalization options

## [3.1.0] - 2023-08-09

### Fixed
Expand Down Expand Up @@ -416,6 +422,7 @@ A lot of issues were fixed. The plugin should be more stable and work better now
* Initial release

[Unreleased]: https://github.com/dingo-d/woo-solo-api/compare/master...HEAD
[3.1.1]: https://github.com/dingo-d/woo-solo-api/compare/3.1.0...3.1.1
[3.1.0]: https://github.com/dingo-d/woo-solo-api/compare/3.0.1...3.1.0
[3.0.1]: https://github.com/dingo-d/woo-solo-api/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/dingo-d/woo-solo-api/compare/2.3.0...3.0.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
**Requires at least**: 5.9
**Requires PHP**: 7.4
**Tested up to**: 6.3
**Stable tag**: 3.1.0
**Stable tag**: 3.1.1
**WC requires at least**: 7.0.0
**WC tested up to**: 8.0.0
**License**: MIT
Expand Down
10 changes: 5 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== Woo Solo Api ===
Contributors: dingo_bastard
Tags: woocommerce, api, solo api, solo, api integration, shop, payment, woo
Requires at least: 5.9
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.1.1
Stable tag: 3.0.1
WC requires at least: 6.0.0
WC tested up to: 7.3.0
Tested up to: 6.3
Stable tag: 3.1.1
WC requires at least: 7.0.0
WC tested up to: 8.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand Down
21 changes: 18 additions & 3 deletions assets/dev/scripts/components/Settings/GeneralSettingsPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ export const GeneralSettingsPanel = () => {
const fiscal = `solo_api_fiscalization-${type}`;
const payment = `solo_api_payment_type-${type}`;

let fiscalSettings = settings[fiscal];

// Fallback for null, or other values.
if (fiscalSettings === null || fiscalSettings === false) {
fiscalSettings = false;
} else {
fiscalSettings = true;
}

return <div className='components-panel__item' key={type}>
<h4>{paymentGateways[type]}</h4>
<SelectControl
Expand Down Expand Up @@ -143,10 +152,16 @@ export const GeneralSettingsPanel = () => {
className={hasErrorClass(fiscal)}
name={fiscal}
label={__('Check if you want the invoice to be fiscalized *', 'woo-solo-api')}
help={settings[fiscal] ? __('Fiscalize', 'woo-solo-api') : __('Don\'t fiscalize', 'woo-solo-api')}
checked={settings[fiscal]}
help={fiscalSettings ? __('Fiscalize', 'woo-solo-api') : __('Don\'t fiscalize', 'woo-solo-api')}
checked={fiscalSettings}
disabled={isActive}
onChange={(value) => setSettings({...settings, [fiscal]: value, settingsRefs})}
onChange={(value) => {
setSettings({
...settings,
[fiscal]: (value === null || value === false) ? false : true,
settingsRefs
})
}}
/>
<ErrorNotice errors={errors} type={fiscal} />
</div>;
Expand Down
Loading

0 comments on commit af539b5

Please sign in to comment.