Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix const INVOICE_USE_RETAINED_WARRANTY #30533

Open
wants to merge 6 commits into
base: 20.0
Choose a base branch
from

Conversation

thomas-Ngr
Copy link
Contributor

@thomas-Ngr thomas-Ngr commented Aug 2, 2024

FIX setup of const INVOICE_USE_RETAINED_WARRANTY

When modifying conf for situation invoice (admin/invoice_situation.php), the const INVOICE_USE_RETAINED_WARRANTY is set to -1 when it is left empty.

This creates issues in DLB on code using getDolGlobalInt('INVOICE_USE_RETAINED_WARRANTY').


edit:

Another issue is the display of chosen value right after the update, as demonstrated in this gif :
situation_invoice

This PR fixes both issues.

@thomas-Ngr thomas-Ngr force-pushed the 20.0_fix_INVOICE_USE_RETAINED_WARRANTY branch from 6d0e2dd to 724c586 Compare August 2, 2024 13:47
@@ -79,12 +79,13 @@
$item->nameText = $langs->trans('AllowedInvoiceForRetainedWarranty');

$arrayAvailableType = array(
0 => "", // don't use $showempty in selectArray since it sets a value of -1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must use showempty into select component when we want empty value. Empty value generates troubles depending on js code used to beautify the combi list (like select2).
So fix must be managed during or before the insert. For example if value is -1, no update should be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the PR to solve a related issue on display of chosen value (see initial message edit).

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Aug 10, 2024
@thomas-Ngr thomas-Ngr force-pushed the 20.0_fix_INVOICE_USE_RETAINED_WARRANTY branch from 20e5558 to 3159eb8 Compare October 11, 2024 12:30
@thomas-Ngr thomas-Ngr force-pushed the 20.0_fix_INVOICE_USE_RETAINED_WARRANTY branch from 19f7f28 to 70e5dcf Compare October 11, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants