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

Blank PaymentTerms being sent #839

Open
olimortimer opened this issue Jan 5, 2022 · 2 comments
Open

Blank PaymentTerms being sent #839

olimortimer opened this issue Jan 5, 2022 · 2 comments

Comments

@olimortimer
Copy link
Contributor

olimortimer commented Jan 5, 2022

I've recently hit an issue with Xero responding with the following error;

A validation exception occurred (Due Date for Sales Invoices must be between 1 and 31 when set to the following (or current) month)
Validation errors:
Due Date for Bills must be between 1 and 31 when set to the following (or current) month.

We have had this in the past, and haven't had chance to explore further, however would like to get to the bottom of it. I believe it always happens around New Year, yet the Date being sent isn't around 01/01/22 00:00 etc.

date: 2022-01-02 23:16:44.0 Europe/London (+00:00)

I don't send a DueDate to Xero, so it uses the default +7 days for all raised invoices. However I have set a DueDate on the above to see if it solves the issue, but still the same.

When I raised this with Xero, they believe it's down to PaymentTerms being sent as 0. However, we don't set any PaymentTerms in our requests, and the contact doesn't have any PaymentTerms set on Xero.

  <PaymentTerms>
   <Bills>
    <Day>0</Day>
    <Type>OFCURRENTMONTH</Type>
   </Bills>
   <Sales>
    <Day>0</Day>
    <Type>OFCURRENTMONTH</Type>
   </Sales>
  </PaymentTerms>

Xero have asked me to remove this and test again, however 1) we are not setting them in our code, so can only assume it's being added to the request by the Xero library, and 2) as it's only affecting one invoice, I don't believe this is the issue.

Has anyone seen this before please? No other invoice creation since the above has thrown this error.

The error in the response from Xero is;

   <ValidationErrors>
    <ValidationError>
     <Message>Due Date for Bills must be between 1 and 31 when set to the following (or current) month.</Message>
    </ValidationError>
    <ValidationError>
     <Message>Due Date for Sales Invoices must be between 1 and 31 when set to the following (or current) month.</Message>
    </ValidationError>
   </ValidationErrors>
   <Contact>
    <ValidationErrors>
     <ValidationError>
      <Message>Due Date for Bills must be between 1 and 31 when set to the following (or current) month.</Message>
     </ValidationError>
     <ValidationError>
      <Message>Due Date for Sales Invoices must be between 1 and 31 when set to the following (or current) month.</Message>
     </ValidationError>
    </ValidationErrors>
@calcinai
Copy link
Owner

Could this be a timezone thing? I feel like I've seen weird behaviour in the normal Xero UI before around the new year

@olimortimer
Copy link
Contributor Author

That was my first thought, but can't understand why it would happen on the 2nd Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants