mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-01 12:08:37 -04:00
imports: Don't re-import the same transaction from the same place
This is detected using the RemoteId field on Splits While we're at it, also make gnucash import check numbers
This commit is contained in:
@ -61,6 +61,11 @@ func (s *Split) Valid() bool {
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func (s *Split) AlreadyImportedTx(transaction *gorp.Transaction) (bool, error) {
|
||||
count, err := transaction.SelectInt("SELECT COUNT(*) from splits where RemoteId=? and AccountId=?", s.RemoteId, s.AccountId)
|
||||
return count == 1, err
|
||||
}
|
||||
|
||||
type Transaction struct {
|
||||
TransactionId int64
|
||||
UserId int64
|
||||
|
Reference in New Issue
Block a user