Feature request: provide site-wide configuration to set 1 or more tracking categories.

Xero allows you to define multiple tracking categories. Each line item can select 1 option from each tracking category. You can then filter reports by tracking category options.

Comments

mradcliffe’s picture

A couple of options:

  • Tracking category per payment method?
  • Tracking category tagged as a part of a rule?
cafuego’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new6.67 KB

In the attached patch I've mashed it into the bank account setting for each account (ie: per payment method). That shouldn't stop anyone from optionally overriding it in a rule or via an alter hook for a transaction or invoice or what have you.

Note that because I'm not set up yet to actually process transactions, I don't know if the created transaction in Xero is tagged appropriately. Probably not (yet). The Drupal UI side works fine, though.

smokris’s picture

Status: Needs review » Needs work

Thanks for the patch, @cafuego.

I don't know if the created transaction in Xero is tagged appropriately. Probably not (yet).

It doesn't seem to be posting the tracking category to Xero. Here's an excerpt of the actual Xero POST request after applying the patch on #2:

<LineItem>
  <Description>…</Description>
  <AccountCode>sales</AccountCode>
  <LineAmount>42.00</LineAmount>
</LineItem>

…but (based on the the Xero API Previewer output for a Bank Transaction with a tracking category set) it needs to look like this:

<LineItem>
  <Description>…</Description>
  <AccountCode>sales</AccountCode>
  <LineAmount>42.00</LineAmount>
  <Tracking>
    <TrackingCategory>
      <Name>…tracking category display name…</Name>
      <Option>…tracking option display name…</Option>
      <TrackingCategoryID>…tracking category UUID…</TrackingCategoryID>
    </TrackingCategory>
  </Tracking>
</LineItem>
mradcliffe’s picture

Status: Needs work » Fixed
StatusFileSize
new8.99 KB
new12.84 KB

Thanks for the feedback.

I went ahead and added a couple of things to the original patch. The admin page allows to select the tracking option from an optgroup of categories. And that supports multiple tracking categories. Finally the tracking category, if set, will be added to bank transactions. I don't think I can do that for invoices automatically because there could be multiple line items.

Setting tracking category and option via the alter hooks for invoices and bank transactions is still an alternative.

  • mradcliffe committed 9873bd6 on 7.x-1.x authored by cafuego
    Issue #1920802 by cafuego: Add initial support for tracking categories.
    
  • mradcliffe committed ceec419 on 7.x-1.x
    Issue #1920802 by mradcliffe: Change tracking support behavior to...
cafuego’s picture

Thanks! Yup, I'm doing that via an alter hook on invoice items and it's worked fine sofar :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.