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

NEW More option for elephant numbering rule #30273

Merged
merged 4 commits into from
Jul 21, 2024

Conversation

rycks
Copy link
Contributor

@rycks rycks commented Jul 4, 2024

All details are on #30211

when we do migration from other ERP to dolibarr we have always to do with old customer numbers and most of the time that customer numbering is bad but we have to do handle it because all of other systems (and most of the time paperworks) of the companie use that numbers.

For example customer code C01LK (created 20 years ago when it was from a DOS system) is used in paper archiving system and when they change for a new ERP in 1998 new customer have new numbers like CL199803442 but old customers keep C01LK/* numbers ... and in 2024 when they switch to dolibarr we have to do with history.

Then in that situation the only solution is to use "Leopard" numbering system but people have to manually choose customer numbers for new customers ... that's impossible and the reason why i purpose that "gazel" code number.

So there is a new option to Elephant number : "choose from started date" : all customer before that date is in mode "no verification, code is totaly open" and elephant code number is mandatory from that date so new customers would get automatically good numbers.

$texte .= '<td class="" style="flex-direction: row;display: flex;">';
$texte .= '<input type="checkbox" onclick="let d=document.getElementById(\'elephantchoosedate\'); if(this.checked){d.style.cssText = \'display: block;\'}else{{d.style.cssText = \'display: none;\'}}" name="value4" value="1" style="float: left;"/>';
$texte .= '<div style="display: none;" id="elephantchoosedate" class="right">';
$texte .= $form->selectDate($dateinput, 'value3', 0, 0, 1, '', 1, 1, $disabled);
Copy link
Contributor

@frederic34 frederic34 Jul 6, 2024

Choose a reason for hiding this comment

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

is it better like this :
$selectdisabled = ((!empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? 1 : 0);
$texte .= $form->selectDate($dateinput, 'value3', 0, 0, 1, '', 1, 1, $selectdisabled);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frederic34 ... i really can't see that your code could do the same thing as mine ?

my objective is:

  • add a checkbox and if user check it, then display the input field, uncheck that checkbox, hide the text input field
  • on submit we could get value if checkbox is checked or no and then delete / update value

that is an elegant way to handle situation where people want to "remove" data: with classic input field if the field is empty on POST dolibarr do not "delete" / "set to empty" value (i think, that was the situation last time i check)...

Copy link
Contributor

Choose a reason for hiding this comment

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

$disabled returns a string but selectDate wait for an int

Copy link
Member

Choose a reason for hiding this comment

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

You probably want to do
$disabled ? 1 : 0

@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 Jul 11, 2024
@eldy eldy merged commit 799f9f5 into Dolibarr:develop Jul 21, 2024
6 of 7 checks passed
@eldy eldy changed the title new option for elephant NEW More option for elephant numbering rule Jul 21, 2024
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.

None yet

3 participants