Skip to content

LineAmountType option gone #10

Open

Description

@jbroberg

In version 0.10 the LineAmountType used to be set-able: INCLUSIVE etc
http://developer.xero.com/documentation/api/types/#LineAmountTypes

In version 0.13 this option appears to be missing. Any reason for that? The commented code below compiled and worked on 0.10

        //LineAmountType lat = new LineAmountType();
        //lat.setEnumeration(Enumeration.INCLUSIVE);

        Invoice invoice = new Invoice();
        invoice.setCurrencyCode(CurrencyCode.USD);
        invoice.setLineItems(lineItemList);
        invoice.setStatus(InvoiceStatus.DRAFT);
        invoice.setType(InvoiceType.ACCREC);
        //invoice.setLineAmountTypes(lat);

cheers

James

Activity

  1. benmccann commented on Aug 4, 2015

    @benmccann
    Owner

    The client library is generated from https://github.com/XeroAPI/XeroAPI-Schemas. Maybe they removed it?

  2. benmccann commented on Aug 4, 2015

    @benmccann
    Owner

    Looks like it's still being generated, but slightly differently now. I see it in the latest version as getLineAmountTypes()

  3. benmccann commented on Aug 4, 2015

    @benmccann
    Owner

    It's probably because we switched from Jibx, which was unsupported and broken on Java 8, to JAXB which is much more widely used. Feel free to submit a pull request to this project or more likely the XeroAPI-Schemas project if you can figure out why that's happening and determine it shouldn't be. Unfortunately, I'm unlikely to have time to look at this myself.

  4. jbroberg commented on Nov 19, 2015

    @jbroberg
    Author

    I think I may have an idea why this does not work.

    I can do either of the below and it has absolutely no effect on the created invoice.
    invoice.getLineAmountTypes.add("Inclusive");
    invoice.getLineAmountTypes().set(0,"Inclusive");

    If your invoice default is "Exclusive" in Xero they will still be created that way (and this setting appears to be the API default also, regardless of what you set in Xero settings unfortunately).

    It's not clear to me why lineAmountType is designated as a list in the schema (and as a result your code, which is generating based on the schema). It only set once per invoice for all line items. It's not a list in any schema example I have seen. I think this is a bug in the published schema:
    https://github.com/XeroAPI/XeroAPI-Schemas/blob/20fd7ff2f81142269a18fc77ba908aeb975e9ebe/v2.00/BaseTypes.xsd#L150

    If you agree I will go ahead and chase it up with the other project.

    cheers

    James

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions