Creating a file to import in GNUCash

Thomas Goirand thomas at goirand.fr
Fri May 27 23:30:05 EDT 2011


On 05/28/2011 01:05 AM, John Ralls wrote:
> 
> On May 27, 2011, at 9:48 AM, Thomas Goirand wrote:
> 
>> Hi,
>>
>> I'm the main author of this software:
>>
>> http://www.gplhost.com/software-dtc.html
>>
>> Our software does full billing for our customers: email reminders so
>> that they can pay us, invoices, etc.
>>
>> Now, I'd like to have all transactions exported to GNUCash. But what
>> format should I create for this export? Should create a document using
>> the OFX format? If yes, how can I find a very easy example with 2
>> transactions, or some simple documentation on how to do it?
> 
> 
> Yes, that would be one way. LMGTFY:
> http://www.ofx.net/OFXExamplesPage/OFXExamples.aspx

Thanks for this example, I've been able to do a basic export script.

The issue I'm having is that these examples aren't covering what I need.
In each transaction, I would have:

- Total deposit in our $payment-gateway account (for example paypal)
- Total cost of the payment gateway
- Eventually, if in Europe, VAT (see below)

With a company in Europe, we have 4 cases:
- Sales in receiving company (includes VAT)
- Sales in EU but not same country as receiving company, customer has
VAT number (no VAT charge, customer pays in its country)
- Sales in EU but not same country as receiving company, customer does
*NOT* have a VAT number, VAT is charged
- Sales in the rest of the world

Depending on these 4 cases, things would be accounted on a different
account in GNUCash.

So, how do I do my export in that case? It's really not clear how...

> You could also use the Gnucash API (in C, Scheme, or Python) to add the
> transactions directly

Are there ways to do that in PHP?

> though hat would entail more effort to support multiple Gnucash
> versions and to keep up with future API changes.

I only need to support GNUCash >= 2.4 for the moment.

Thanks.

Thomas


More information about the gnucash-user mailing list