Rob,
The basic idea is OK but you are not creating 2 additional transaction, but 
adding the additional splits to the
transaction recording the sale, or at least that is what you will need to be 
doing. A single transaction can have 2 or
more entries to different accounts referred to as splits  in GnuCash 
documentation and that is what Stephen and I had
suggested. GnuCash has a multisplit multiline CSV format for importing Data 
like this. I am currently updating the
documentation on using this so you won't find it completely described in the 
Help manual or Guide yet although the Help
manual is the most recently updated. 
The wiki https://wiki.gnucash.org/wiki/CSV_Import/Export has a very brief 
description of the multiline multisplit CSV
import process but it does describe the fields. I have attached a copy of a 
test file for a multiline-multisplit export
form GnuCash  (Gnucash Export Format) which I am using to document the import 
process. It will give you the basic csv
format for the second and subsequent lines ofthe multisplit format. The wiki 
seems to suggest that the transactionID is
essential to import multisplit data but I have yet to test whether that is the 
case and just which fields I can leave
out and still manage to import the data in mutlisplit format. The wiki does 
have a list of the mandatory fields which
have to be present in the record. The transaction ID as AFAIK is a Globally 
Unique ID or UUID as described in this
wikipedia article (version 4, I think). Python has a UUID 
generator(https://docs.python.org/2/library/uuid.html) which
should be OK for creating them in the hex format used in the import.  Hope this 
is enopugh to get you headed in the
right direction.
I had originally intended to get the documentation done earlier this year but a 
couple of overseas trips and a couple of
bouts of illness delayed my plans.
David Cousens



On Sat, 2019-11-30 at 12:01 -0500, Robert Slippey wrote:
> David and Stephen,
> 
> I wanted to circle back to this again and reach out directly to get your 
> thoughts on this. I was going through this
> issue again in my mind and admittedly I'm a bit lazy. I'm also learning 
> Python slowly, so of course I put two and two
> together. Was curious your thoughts.
> 
> I might have missed something here but here is how I envisioned the script 
> working. 
> The script takes each transaction and splits it up into the following: 
> 
> Income from your sales account
> Transfer to your bank account
> Expense to your expense account
> 
> Basically, I've turned 1 line in the CSV into 3 per transaction.
> 
> https://github.com/rwslippey/square_transaction_parserĀ  
> 
> 
> As previously discussed, this probably wouldn't help for multiple sales on a 
> single day and refunds are probably a no
> go. 
> I know this is for square and we were talking stripe.... I'm moving things 
> off of square so everything is in square
> right now... I'll need to make this for stripe if you guys think it's right.
> Your thoughts?
> 
> Thanks
> On Wed, Nov 27, 2019 at 6:20 PM David Cousens <[email protected]> 
> wrote:
> > Rob,
> > 
> > 
> > 
> > Not sure of the details of how Stripe operates but presume it is somewhat
> > 
> > similar to paypal.How you record it will depend upon the detail of the
> > 
> > procedure they use. I treat my Paypal account as a Liability account as I
> > 
> > can also make payments from it. In my case it is directly connected to a
> > 
> > bank account and my Paypal account has direct debit/credit access to that
> > 
> > bank account and unless i have a positive balance in my Paypal account it
> > 
> > will debit funds from my bank account as required. It is so long since I
> > 
> > sold anything using it I cannot remember if it automatically credits funds
> > 
> > received. If I remember correctly I had to manually transfer funds as
> > 
> > required. As the balance in a Paypal account always has to be >=0, I should
> > 
> > really treat it as an asset but I set it up as a Liability and as the
> > 
> > balance is at or near 0 most of the time, so I am happy keeping it that 
> > way. 
> > 
> > My transactions are all imported as OFX from my bank and CSV from Paypal. 
> > 
> > 
> > 
> > My bank records only have the amount of any debits and/or credits to the
> > 
> > paypal account and hence have no information pertaining to fees and charges.
> > 
> > I only receive this when I download a CSV statement from Paypal which
> > 
> > details the amounts received and fees and charges. I keep separate Income
> > 
> > sub accounts and Expense subaccounts for the Paypal transactions. A sale
> > 
> > would be recorded in the Paypal account as follows:
> > 
> > 
> > 
> > Liability :Paypal                                         Dr zzzz
> > 
> > Income:Paypal Sales                                               Cr  xxxx
> > 
> > Expenses: Paypal Fees and Charges            Dr yyy
> > 
> > 
> > 
> > where xxxx=yyy+zzzz  or you could consider this as two transactions
> > 
> > 
> > 
> > Liability:Paypal                                         Dr xxxx
> > 
> > Income:Paypal Sales                                               Cr xxxx
> > 
> > 
> > 
> > and 
> > 
> > 
> > 
> > Expenses: Paypal Fees and Charges            Dr yyy
> > 
> > Liability:Paypal                                                       Cr
> > 
> > yyy
> > 
> > 
> > 
> > As the CSV record from Paypal usually contains the fees and sales as
> > 
> > separate line item,s the second format is a better description of what is
> > 
> > imported and recorded for me. The import matcher assigns credit entries to
> > 
> > the Paypal  account as Fees and Charges and Dr entries as Income  (after
> > 
> > initially manually setting these accounts during import and importing the
> > 
> > data to train the matcher process). The matcher uses other tokens in the
> > 
> > description to make this assignment and not the credit/debit status of the
> > 
> > transaction AFAIK, and generally handles payments I might make from the
> > 
> > account as well now although I often have to manually select the correct
> > 
> > expense account.  I preprocess the CSV file before import (Paypal supplies a
> > 
> > lot of extraneous information I don't need but I now have a set of stored
> > 
> > import settings which simply ignore the unwanted fields supplied by Paypal
> > 
> > and just selects the relevant columns) and arrange it to import easily
> > 
> > (usually only copying the foreign currency conversion info to the
> > 
> > description field and deleting the currency conversion records supplied by
> > 
> > Paypal. My Paypal account is in AUD and I sometimes have international sales
> > 
> > in other currencies. I don't treat the foreign sales in a separate account
> > 
> > for the other currencies but simply copy the currency conversion info into
> > 
> > the Description field before import so I can locate the foreign currency
> > 
> > amounts if I need to. I keep the raw downloaded files as well as any files
> > 
> > modified for import just so i have a complete trail and can track any
> > 
> > errors.
> > 
> > 
> > 
> > The import matcher usually recognizes duplicate information in the bank
> > 
> > record imports which match transfer transactions from the Paypal  import (or
> > 
> > vice versa depending on the import order) and flags them as matched 
> > 
> > duplicates not to be imported. I usually check that Gnucash has done this
> > 
> > correctly  before completing the import but once setup it usually gets
> > 
> > things right.
> > 
> > 
> > 
> > Can't tell you how to handle Stripe as I don't know how it works and what
> > 
> > data it supplies but perhaps the above description may help you set it up.
> > 
> > 
> > 
> > David Cousens
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -----
> > 
> > David Cousens
> > 
> > --
> > 
> > Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
> > 
> > _______________________________________________
> > 
> > gnucash-user mailing list
> > 
> > [email protected]
> > 
> > To update your subscription preferences or to unsubscribe:
> > 
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > 
> > If you are using Nabble or Gmane, please see 
> > https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> > 
> > -----
> > 
> > Please remember to CC this list on all your replies.
> > 
> > You can do this by using Reply-To-List or Reply-All.
> > 


-- 
Dr David R Cousens
B.Sc, M.Prof. Acc., Ph.D., G.C.Ed
Date,Transaction ID,Number,Description,Notes,Commodity/Currency,Void Reason,Action,Memo,Full Account Name,Account Name,Amount With Sym,Amount Num.,Reconcile,Reconcile Date,Rate/Price
12/09/2016,dd6839ac4ae9411b911a6a1f973d4b65,,Opening Balance-Checking,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"$15,000.00","15,000.00",n,,1.00
,,,,,,,,,Equity:Opening Balances,Opening Balances,"-$15,000.00","-15,000.00",n,,1.00
12/09/2016,e140f32b356948a68b812a946810858d,,Salary ,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"$4,000.00","4,000.00",n,,1.00
,,,,,,,,,Assets:Current Assets:Savings Account,Savings Account,"$1,350.00","1,350.00",n,,1.00
,,,,,,,,,Income:Salary,Salary,"-$5,350.00","-5,350.00",n,,1.00
13/09/2016,9b459c610196496689a526bf6772f29d,,Supermarket,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,-$153.30,-153.30,n,,1.00
,,,,,,,,,Expenses:Groceries,Groceries,$153.30,153.30,n,,1.00
14/09/2016,91ec1cad5b804fc49eb274a4bd1d70b8,,Topup cash in wallet,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,-$50.00,-50.00,n,,1.00
,,,,,,,,,Assets:Current Assets:Cash in Wallet,Cash in Wallet,$50.00,50.00,n,,1.00
16/09/2016,fd0f82af92524269aaa409ef7e2b5d60,,1000 Shares Acme Copr All Ord,,CURRENCY::AUD,,,Purchase 1000 shares Acme Corp All Ord,Assets:Current Assets:Checking Account,Checking Account,"-$13,254.95","-13,254.95",n,,1.00
,,,,,,,Buy,Purcahse,Assets:Investments:Brokerage Account:Stock:Acme Corp,Acme Corp,"1,000 ACM","1,000",n,,13.25
,,,,,,,,Brokerage charges,Expenses:Investments:Brokerage Fees and Commissions,Brokerage Fees and Commissions,$4.95,4.95,n,,1.00
20/09/2016,93a7be5f382948b8bb7303530a3df19b,,Supermarket,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,-$123.40,-123.40,n,,1.00
,,,,,,,,,Expenses:Groceries,Groceries,$123.40,123.40,n,,1.00
20/09/2016,a6fda7a9c1e34b1da03314bc61b22340,,Transfer of Funds from Singapore Saving account,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"$10,000.00","10,000.00",n,,1.00
,,,,,,,,,Assets:Current Assets:Savings Account SGD,Savings Account SGD,"-S$9,440.20","-9,440.20",n,,1 + 2799/47201
23/09/2016,13c2019c80af43c1afe31098cea882bc,,Loan Repayment,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"-$1,540.00","-1,540.00",n,,1.00
,,,,,,,,,Liabilities:Loans:Mortgage Loan,Mortgage Loan,"$1,540.00","1,540.00",n,,1.00
24/09/2016,6420a5f21edc4f558a93ca666b69f74c,,Credit card payment,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"-$1,500.00","-1,500.00",n,,1.00
,,,,,,,,,Liabilities:Credit Card,Credit Card,"$1,500.00","1,500.00",n,,1.00
26/09/2016,eb17c2ac66f14f5286d7e2dac806070a,,Supermarket,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,-$115.00,-115.00,n,,1.00
,,,,,,,,,Expenses:Groceries,Groceries,$115.00,115.00,n,,1.00
10/10/2016,90356001727f4652959068f5b21c33c1,,Supermarket,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,-$123.65,-123.65,n,,1.00
,,,,,,,,,Expenses:Groceries,Groceries,$123.65,123.65,n,,1.00
12/10/2016,d819158b019641699e5db081c6a2bef7,,Salary ,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"$4,000.00","4,000.00",n,,1.00
,,,,,,,,,Assets:Current Assets:Savings Account,Savings Account,"$1,350.00","1,350.00",n,,1.00
,,,,,,,,,Income:Salary,Salary,"-$5,350.00","-5,350.00",n,,1.00
15/10/2016,1f2dd413a8d54983b3708d818e0478d0,,Pharmacy,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,-$11.50,-11.50,n,,1.00
,,,,,,,,,Expenses:Medical Expenses,Medical Expenses,$11.50,11.50,n,,1.00
30/10/2016,21da3fe590a949d882397b36bef63cd1,,Sale 500 shares AcmeCorp All Ord,,CURRENCY::AUD,,,,Assets:Current Assets:Checking Account,Checking Account,"$7,068.75","7,068.75",n,,1.00
,,,,,,,Buy,,Expenses:Commissions,Commissions,$181.25,181.25,n,,1.00
,,,,,,,Sell,,Assets:Investments:Brokerage Account:Stock:Acme Corp,Acme Corp,-500 ACM,-500,n,,14.5
_______________________________________________
gnucash-user mailing list
[email protected]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to