[GNC-dev] Two steps forward (Maybe three back)
Christopher Lam
christopher.lck at gmail.com
Mon Jan 21 03:16:20 EST 2019
As a last test, add the following, which will help determining which
part of qof_print_date_buff is playing up.
I think it should output ('locale 4)...
modified gnucash/report/standard-reports/transaction.scm
(add-if (column-uses? 'date)
(vector (_ "Date")
(lambda (split transaction-row?)
+ (gnc:pk 'locale (qof-date-format-get))
(if transaction-row?
(gnc:make-html-table-cell/markup
"date-cell"
On 21/1/19 12:58 pm, Stephen M. Butler wrote:
> On 1/20/19 8:07 PM, Christopher Lam wrote:
>> There's no reason why the dates can't be changed.
>>
>> The reason dates straggling 1.1.1970 was chosen was because 1.1.1970
>> corresponds to time 0 in time64, and I felt that having a few negative
>> time64 numbers would be interesting to test sorting.
>>
>> However this is a weird weirdness -- the test output shows that the
>> transactions were sorted correctly - 31/12/69, 31/12/69, 01/01/70,
>> 02/01/70, 02/10/70 (in d/m/y); it's just the display that is incorrect.
>>
>> Moreover the display has to go through qof_print_date which takes a
>> time64 and returns a string.
>>
>> I'd be keen to know Stephen's build and try debug this.
>
> Here are my steps (I have a Projects folder in which is a GnuCash folder):
>
> cd ~/Projects/GnuCash
>
> git clone https://github.com/Gnucash/gnucash
>
> cd gnucash
>
> git checkout 3.4
>
> cp -r ../debian .
>
> (contents of above folder are available here:
> https://drive.google.com/open?id=1VJmtb-Fx00PQna4yQoYm49C88Bi0hneI )
>
> fakeroot debian/rules clean
>
> sudo mk0buikd-deps -ir debian/control
>
> DEB-BUILD-OPTIONS=nocheck dpkg-build-package -rfakeroot -b -uc
>
> (This did build the files located here:
> https://drive.google.com/open?id=1fV_fURy6c77e7gf6S41lTacM7dFyy7VD )
>
>
>> Stephen can you modify transaction.scm as follows and let us know the
>> test output? (Beware the parentheses!)
>>
>> modified gnucash/report/standard-reports/transaction.scm
>> @@ -1119,7 +1119,8 @@ be excluded from periodic reporting.")
>> (if transaction-row?
>> (gnc:make-html-table-cell/markup
>> "date-cell"
>> - (qof-print-date
>> (xaccTransGetDate (xaccSplitGetParent split))))
>> + (let ((date (xaccTransGetDate
>> (xaccSplitGetParent split))))
>> + (gnc:pk 'date date
>> 'qof-print-date (qof-print-date date))))
>> ""))))
>>
>> (add-if (column-uses? 'reconciled-date)
>>
>>
> Hmm. I was back on v3.4 with this test. I'll try again with maint
> checked out.
>
>
> d0.0005 t1.824: ('date 1576407540 'qof-print-date 12/15/19)
> [pass] line:647, test: dual amount column, with original currency headers
> [pass] line:651, test: dual amount column, grand totals available
> [fail] line:654, test: dual amount column, first transaction correct
> transaction.scm/display options
> -> expected: ("01/03/18" "$103 income" "Root.Asset.Bank" "$103.00"
> "$103.00")
> -> obtained: ("01/03/19" "$103 income" "Root.Asset.Bank" "$103.00"
> "$103.00")
> d0.1090 t1.933: ('date -46860 'qof-print-date 12/31/69)
>
>
>> On 21/1/19 7:00 am, John Ralls wrote:
>>>> On Jan 20, 2019, at 1:24 PM, Stephen M. Butler <kg7je at arrl.net> wrote:
>>>>
>>>> Started clean this morning by recloning the git repository. Made much
>>>> further progress but ended up with some test failures. Here are my
>>>> steps:
>>>>
>>>> 1. sudo rm -rf gnucash
>>>>
>>>> 2. git clone https://github.com/Gnucash/gnucash
>>>>
>>>> 3. cd gnucash
>>>>
>>>> 4. git checkout -b debian
>>>>
>>>> 5. cp -r ../debian .
>>>>
>>>> Here is the contents of that directory -- copied to Google
>>>> Drive:
>>>>
>>>>
>>>> https://drive.google.com/open?id=1VJmtb-Fx00PQna4yQoYm49C88Bi0hneI
>>>>
>>>> 6. git add debian
>>>>
>>>> 7. git commit
>>>>
>>>> Done on my "debian" branch
>>>>
>>>> 8. fakeroot debian/rules clean
>>>>
>>>> 9. sudo mk-build-deps -ir debian/control
>>>>
>>>> 10. dpkg-buildpackage -rfakeroot -b -uc
>>>>
>>>> Note: This usually failed right up front. This time went for
>>>> nearly 10
>>>> minutes.
>>>>
>>>> End testing: Jan 20 12:49 PST
>>>> + exit 2
>>>> debian/rules:68: recipe for target 'override_dh_auto_test' failed
>>>> make[1]: *** [override_dh_auto_test] Error 2
>>>> make[1]: Leaving directory '/home/steve/Projects/GnuCash/gnucash'
>>>> debian/rules:23: recipe for target 'build' failed
>>>> make: *** [build] Error 2
>>>> dpkg-buildpackage: error: debian/rules build subprocess returned exit
>>>> status 2
>>>>
>>>>
>>>> Here are the contents of ./.build/Testing/Temporary/*
>>>> https://drive.google.com/open?id=1_0gRAd-ymP1cEYM3pyPnvzeHI7-SSWMS
>>> The file you want to look at for test failures is LastTest.log. You
>>> can search for "Test Failed".
>>>
>>> This time the test failure is in
>>> gnucash/report/standard-reports/test/test-transaction.scm:
>>> [pass] line:654, test: dual amount column, first transaction correct
>>> [fail] line:678, test: dates are sorted
>>> transaction.scm/sorting options
>>> -> expected: ("12/31/69" "12/31/69" "01/01/70" "02/01/70" "02/10/70")
>>> -> obtained: ("12/31/70" "12/31/70" "01/01/70" "02/01/70" "02/10/70")
>>> [pass] line:684, test: sort by number
>>>
>>> That suggests that for some reason Guile on your system can't handle
>>> dates before 1/1/1970. That's strange, but probably not important to
>>> many GnuCash users.
>>>
>>> Chris Lam, any reason not to change that test to use later dates?
>>>
>>> Regards,
>>> John Ralls
More information about the gnucash-devel
mailing list