Page 1 of 1

Verizon Statement Date Problem

PostPosted: Thu May 12, 2016 3:17 pm
by jmvenable
I wish to create custom date tokens representing the begin and end of the statement period. I will use it to rename the bill's file later in the rule.

My challenge is that the statement displays the statement period as follows:

Quick Bill Summary Dec 08 - Jan 07

Problem is: what is the year? Elsewhere, there are "bill dates" and "due dates" that state the year. How, if at all, can I programmatically use a third date to extract the year I can use for Begin and End dates?

I am not yet ready to concede using some estimation method to guess what year it is. Any ideas appreciated. John

Re: Verizon Statement Date Problem

PostPosted: Fri May 13, 2016 9:34 am
by Mr_Noodle
If the date is missing a component (like the year), Hazel will use the current date (i.e. current year if year is missing, current day if day is missing). Of course, this fails if the date is actually from a previous year but if you use the year from the second date in your example, you should be fine.

Re: Verizon Statement Date Problem

PostPosted: Sat May 14, 2016 5:22 pm
by jmvenable
Thing is, I was practicing on a lot of old statements, which is a good thing I guess, because otherwise this "bug" would never have surfaced. The "2016" default was appearing on 48 old statements; not good.

The way I finally fixed it was to read in the two Accounting period dates (of the style "Dec 07 - Jan 08".) Then I found the DueDate (it had the year spelled out), extracted its year, and appended it to the two partial dates.

Unfortunately, my fix will mislabel the turn-of-the-year periods (e.g. the one above should be 2015, not 2016), but 44 out of 48 correct years was better than before. And i suppose this could be fixed too, but about this time my head exploded, making a tremendous mess, and I lost my momentum. JV