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

Impossible to set the date of a payment using API #32111

Open
ggppdk opened this issue Nov 26, 2024 · 0 comments
Open

Impossible to set the date of a payment using API #32111

ggppdk opened this issue Nov 26, 2024 · 0 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@ggppdk
Copy link
Contributor

ggppdk commented Nov 26, 2024

Bug

At
htdocs/compta/facture/class/api_invoices.class.php
you have:
$paymentobj->datepaye = dol_stringtotime($datepaye);

So the code expects a date string: 2024/11/26 (instead timestamp)

but if I try to give a date string I get a response (from DOLIBARR API):

Message: Bad Request: Invalid value specified for datepaye. Expecting unix timestamp, such as 1732638616

It is not possible to workaround this in my code, so I patched the code to be:
$paymentobj->datepaye = (int) $datepaye;

I don't know/have not checked if other part code of the code is sending date string instead of a timestamp

Whatever is the write way to fix this (date string or timestamp), I will use it when this is addressed in a future release,
thanks

Dolibarr Version

20.0.1

Environment PHP

8.2

Environment Database

No response

Steps to reproduce the behavior and expected behavior

Use API to created/update a payment

Attached files

No response

@ggppdk ggppdk added the Bug This is a bug (something does not work as expected) label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

1 participant