Skip to content

Payment terms on contacts not being sent #181

@alexkb

Description

@alexkb

Firstly good job on the library it's far superior to the official XeroPHP implementation. Anyway onto the issue:

When adding the payment terms to a contact, this library assumes multiple payment terms with multiple bills (for lack of a better descriptor of supplier bills) are supported and sends the following (same for Sales used for customer invoices):

<Contacts>
  <Contact>
    <ContactNumber>706314</ContactNumber>
    <Name>yet another with terms</Name>
    <PaymentTerms>
      <PaymentTerm>
        <Bills>
          <Bill>
            <Day>7</Day>
            <Type>DAYSAFTERBILLDATE</Type>
          </Bill>
        </Bills>
      </PaymentTerm>
    </PaymentTerms>
  </Contact>
</Contacts>

The Xero API doesn't work this way. The correct way is to send payment terms like this:

<Contacts>
  <Contact>
    <ContactNumber>706314</ContactNumber>
    <Name>yet another with terms</Name>
    <PaymentTerms>
      <Bills>
        <Day>8</Day>
        <Type>DAYSAFTERBILLDATE</Type>
      </Bills>
    </PaymentTerms>
  </Contact>
</Contacts>

Happy to do a pull request to get this fixed if you like, but thought I'd report it first unless I've misunderstood something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions