2011-03-05 GnuCash IRC logs
00:20:04 *** Gregor has quit IRC
00:53:00 *** Askarii has quit IRC
02:28:31 *** esperegu has joined #gnucash
04:01:03 *** kpreid has joined #gnucash
05:18:30 *** pjama has joined #gnucash
05:23:32 *** pjama has quit IRC
05:24:17 *** pjama has joined #gnucash
06:41:25 *** dkorzhevin has joined #gnucash
06:43:55 *** pjama has quit IRC
08:40:15 *** Jimraehl has left #gnucash
09:16:27 *** Jimraehl has joined #gnucash
09:45:26 *** gjest07 has joined #gnucash
09:49:41 <gjest07> In File > Properties > Counters.. is it possible to get Bill ID to become Bill-00001 .. Bill-00002? I see its a field "Bill number format" but i dont know how to fill in the printf-style format string.
09:58:41 *** esperegu_ has joined #gnucash
10:03:30 *** Jimraehl has quit IRC
10:04:35 *** esperegu has quit IRC
10:07:11 *** Jimraehl has joined #gnucash
10:27:07 <kpreid> gjest07: I don't know that gnucash feature but if it's printf style then that would be "Bill-%05i"
10:27:53 <kpreid> % starts a field, the 0 specifies 0-padding, 5 is the field width, i is 'an integer'
10:41:47 <gjest07> had no luck with "Bill-%05i" . What i am trying to do is : pattern + counter autonumber where the pattern is "Bill-"
10:42:03 <kpreid> yes, I figured that would work
10:42:31 <gjest07> it did not ;-)
10:44:30 <gjest07> On tip is stands " The format string to use for generating bill numbers. This is a printf-style format string"
11:04:19 *** markjenkinsparit has joined #gnucash
11:22:46 *** markjenkinsparit has quit IRC
11:35:13 *** Askarii has joined #gnucash
11:59:06 *** ceen has joined #gnucash
12:41:52 <Antisoche> try %n - that's used elsewhere
12:58:08 <gjest07> %n did not work either. I have tryed with %n, "%n" and "Bill-%05n" and %n, 333
12:58:11 *** Askarii has quit IRC
12:59:02 <Antisoche> And how does it not work?
13:00:23 <gjest07> it just fill in autonumber
13:00:33 <Antisoche> %n crashes the program?
13:00:39 <gjest07> no
13:01:47 <gjest07> no im trying on vendors but it should be the same as bill
13:02:18 <Antisoche> Would you mind describing the problem?
13:02:42 <gjest07> i can set counter for venedor, if i set counter on 200 and fill in a new venedor then ID for venedor is 201
13:03:11 <gjest07> but im trying to get a pattern before ID ex. Ven-201
13:04:06 <Antisoche> And what does Ven-%i give you?
13:05:24 <Antisoche> (Or whatever you've tried to do)
13:07:36 <gjest07> If i fill inn Ven-%i in the field "Venedor number format" it seems to have no affect - a new venedor just gets autonumber
13:08:09 <Antisoche> So it goes from "1" to "2", ignoring whatever you put in?
13:08:17 <gjest07> yes
13:12:03 <gjest07> its two field "Vendor number" and "Vendor number format". Vendor number i can set to ex. 200 and then the next new vendor gets id 201
13:14:45 <Antisoche> 1 minute...
13:15:31 <Antisoche> You're using 2.4.2 I assume?
13:16:26 <gjest07> 2.4.3
13:21:53 <Antisoche> hmm
13:26:49 <gjest07> my real problem is that in norway the vouchers must be in serie 1,2,3,4, etc.. In GnuCash i got one invoice with ID 1 and one bill with ID 1 and then i gets hard to use ID num on vouchers.
13:30:31 <gjest07> So im trying to make a pattern for Incoming Invoice(II) and Outgoing Invoice (OI) - and testing on vendor since its takes less time to make a new vendor
13:31:25 <gjest07> Is there another way to get Common numbering series for all vouchers (bilag in norwagian)?
13:32:40 <Antisoche> I'm not sure what you mean by "voucher". But I'm not a dev, so I'm just trying to find an answer to the format.
13:37:54 <gjest07> with voucher im mean the paper copy of a bill, invoice that i keep in a archive. That paper copy must have a unike number or string + number ex. OI-1
13:39:28 <Antisoche> That's typical. It sounds like you want invoices you issue and those you receive to be different because when you search for "12345" you get both the 12345 you sent someone and a 12345 you were sent.
13:41:02 <gjest07> yes, and i Norway its not legal to use the same number on the paper copy
13:41:45 <Antisoche> You lost me already
13:45:19 <gjest07> not so good in english ;-(
13:45:48 <Antisoche> Do any of the format strings work for you?
13:46:46 <gjest07> but i dont understand what that "Vendor number format", "Invoice number format" fields are supposed to be used
13:46:54 <gjest07> It must be something ;-)
13:48:59 <Antisoche> I don't understand the code well enough, but the magic function looks like qof_book_increment_and_format_counter() in src/libqof/qof/qofbook.c
13:50:05 <Antisoche> It pulls the format out of the key-value pairs associated with the counter_name, which is the same place it gets the counter from.
13:50:52 *** Gregor has joined #gnucash
13:52:14 <Antisoche> It then increments the counter and saves it back. It calls g_strdup_printf(format,counter); counter is a gint64. So "%Ld" seems like it would be the right format, but you say it ignores the format completely.
13:53:10 <gjest07> will try with %Ld
13:53:43 <Antisoche> It sounds like the format is never getting assigned, but you should be able to find it in the XML file. That might be a good place to look.
13:55:28 <gjest07> nothing happens with %Ld either
13:57:25 <Antisoche> It seems like it just doesn't work... Since I have the VM running, I'm testing...
13:57:50 <gjest07> now my counter on vendor is on 478 and the last vendor i filled in has ID 000478. Maybe the "Vendor number format" field is just to format numbers? Get rid of the 000 in front?
13:58:38 <Antisoche> That what I was thinking at first, but I think g_strdup_printf is a standard function ...
14:01:15 <Antisoche> Ok, I see the format is saved in the XML file...
14:04:59 <gjest07> i just have <vendor:id>000463</vendor:id> in my XML file
14:05:39 <gjest07> im on Windows 7
14:06:43 <Antisoche> http://svn.gnucash.org/trac/browser/gnucash/trunk/src/libqof/qof/qofbook.c#L568
14:07:26 <Antisoche> /* Validate a counter format. This is a very simple "parser" that
14:07:26 <Antisoche> * simply checks for a single gint64 conversion specification,
14:07:26 <Antisoche> * allowing all modifiers and flags that printf(3) specifies (except
14:07:26 <Antisoche> * for the * width and precision, which need an extra argument). */
14:09:40 <Antisoche> A bit premature ... it looks like you can have arbitrary strings. You just need to use G_GINT64_FORMAT after the '%', whatever that is on your platform.
14:10:23 <gjest07> i dont understand that function (not a programmer) but should it be possible to get "Ven-" + autonumber. Ex. Ven-000001 Ven-000002 ?
14:11:39 <Antisoche> Short answer is that I don't know. The function looks like it will allow it.
14:12:22 <Antisoche> GnuCash issues a PWARN describing the problem when it finds one, but I don't know where these messages go. Can you run GnuCash from the command line and see if it tells you anything?
14:13:20 <gjest07> who do i run GC for command line on Windows 7?
14:13:39 <Antisoche> Oops, my bad - not %Ld - try %lld
14:14:51 <gjest07> nothing happens with %lld either
14:14:55 <Antisoche> On Windows I'm not sure - you can Start -> Run and then type "cmd" and run gnucash. I assume it's gnucash.exe but if it's not in your PATH you would first have to 'cd' to the directory it's installed to.
14:20:25 <gjest07> had no luck with run gnucash from cmd, but if i cd to the directory and type gnucash.exe then GnuCash starts
14:23:52 <Antisoche> I don't know what's going on. I ran gnucash --debug to get more debug info, but that doesn't print anything more.
14:24:19 <Antisoche> And for some reason I can't find a definition for G_GINT64_FORMAT
14:26:50 <Antisoche> I do see stuff in the ChangeLog saying %lld was replaced by G_GINT64_FORMAT though
14:27:41 <gjest07> what is %lld supposed to do?
14:28:02 <Antisoche> Try %lli
14:29:51 <gjest07> did not work. I do find it in the XML file <slot:value type="string">%lli</slot:value>
14:31:01 <Antisoche> Meanwhile, someone needs to explain to me how I can compile gnucash when an rgrep of G_GINT64_FORMAT of /usr/include returns nothing...
14:31:29 <Antisoche> "%lli" is the format string glib uses (http://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Macros.html#G-GINT64-FORMAT:CAPS)
14:31:44 <Antisoche> It says "The variable is a long long integer".
14:32:35 <Antisoche> However, "%lli" is just going to give you a number - you need to do "test/%lli" or you won't be able to tell if it worked or not. "%lli" is (or may be...) the default.
14:35:39 <gjest07> nothing happens with "test/%lli" either
14:37:28 <Antisoche> Sorry, it's a mystery.
14:39:21 <Antisoche> well...
14:42:02 <Antisoche> On my machine, it is definitely [lli]
14:44:20 <Antisoche> What!? Why are there include files in /usr/lib !?
14:52:38 <Antisoche> gjest07: Using %lli as the format specifier works for me.
14:53:35 <gjest07> what happens with ID number then?
14:54:13 <Antisoche> One thing I did was hit "apply" and then exited without saving the file. When I did that the format didn't end up in the XML file. So I ran it again and hit "ok" instead of "Apply", exited, and ran it again, and everything worked.
14:55:25 <Antisoche> I created a customer: "Customer - 235" using the format "Customer - %lli" and starting number 235
14:56:51 <gjest07> ok
14:57:22 <Antisoche> And I just changed the format for the invoice (hitting 'ok' instead of 'apply') and created a new invoice and it took the new format. I didn't have to restart. So now I have "Invoice / 568" and "Invoice / 569 FTW!!"
14:57:27 <Antisoche> Both open at the same time.
14:57:42 <gjest07> i must try with a new book
15:06:45 <gjest07> U did type -> Customer - %lli in the field Custumer number format?
15:10:34 <Antisoche> yes
15:11:58 <gjest07> if u search for custumer then it says "Custumer - 235 " under ID # ?
15:11:59 <Antisoche> The thing that's complicated though is that G_GINT64_FORMAT is a GLIB constant, and may differ by platform, so Windows 7 may have something else - or it my not even be possible. I don't know what GLIB does, and don't have a way to test that.
15:12:07 <Antisoche> gjest07: Yes
15:14:07 <gjest07> i have <slot:value type="string">Customer - %lli</slot:value> in my XML so must be something with Windows 7 then
15:15:09 <Antisoche> http://imagebin.org/141336
15:15:38 <Antisoche> Not with windows specifically, but with the format specifier GLIB uses to display 64-bit ints under Windows.
15:16:26 <Antisoche> I think that if you keep testing you can find it. It's definitely a printf() flag. %d, %i, %ld, %li, %lld, %lli ... something like that.
15:17:03 <gjest07> i will try - if no luck then i go for Ubuntu ;-)
15:17:14 <Antisoche> All your problems solved! :)
15:17:31 <gjest07> thanks for all the help
15:19:12 <Antisoche> Looks like %I64x may be what you want, too. (That a %-cap-i, not a %-ell)
15:19:35 <Antisoche> Google will help you search for what you need.
15:20:47 <Antisoche> Sorry, not 'x' at the end - either another 'i' or 'd'.
15:28:42 *** ceen has quit IRC
15:33:09 *** Askarii has joined #gnucash
15:34:27 *** esperegu_ has quit IRC
16:04:44 *** Gregor has quit IRC
16:07:05 *** Gregor has joined #gnucash
16:14:31 *** Askarii has quit IRC
16:38:52 *** sjc has joined #gnucash
16:39:52 *** gjest07 has quit IRC
16:45:13 *** Gregor has joined #gnucash
16:49:28 *** Gregor has joined #gnucash
16:49:39 *** Gregor has quit IRC
16:51:57 *** Gregor has joined #gnucash
16:54:28 *** Gregor has joined #gnucash
17:23:45 *** GitHub132 has joined #gnucash
17:23:45 <GitHub132> gnucash: master Christian Stimming * c4a371f (4 files in 1 dirs): Minor code cleanup: Move gconf section name into header; clarify argument name.
17:23:46 <GitHub132> gnucash: master Christian Stimming * ce7d7be (3 files in 3 dirs): Add option in OFX import to have newly encountered commodities automatically created.
17:23:49 <GitHub132> gnucash: master Geert Janssens * afaedf8 (1 files in 1 dirs): Add more debug logging.
17:23:51 <GitHub132> gnucash: master commits 53a6166...afaedf8 - http://bit.ly/fy543K
17:23:53 *** GitHub132 has left #gnucash
17:26:04 *** Gregor has quit IRC
17:44:01 *** dkorzhevin has quit IRC
18:31:21 *** Askarii has joined #gnucash
18:32:35 *** Askarii has quit IRC
18:49:23 *** labuser has joined #gnucash
19:25:39 *** sparxz has joined #gnucash
19:32:19 *** ceen has joined #gnucash
19:36:12 *** Askarii has joined #gnucash
19:45:04 *** sparxz has quit IRC
19:47:00 *** sparxz has joined #gnucash
19:51:46 *** Askarii has quit IRC
20:20:01 *** sparxz has quit IRC
20:20:29 *** Gregor has joined #gnucash
20:28:11 *** sparxz has joined #gnucash
20:46:48 *** sparxz has quit IRC
20:53:30 *** sjc has quit IRC
20:59:20 *** Askarii has joined #gnucash
21:24:10 *** Askarii has joined #gnucash
22:10:49 *** Gregor has quit IRC
22:20:24 *** Askarii has quit IRC
22:38:16 *** ceen has quit IRC