only inserting transactions if company found
This commit is contained in:
@@ -68,23 +68,24 @@
|
||||
|
||||
|
||||
(try
|
||||
(transactions/upsert!
|
||||
{:post-date (time/parse post-date "YYYY-MM-dd")
|
||||
:id (sha-256 (str id))
|
||||
:account-id account-id
|
||||
:date (time/parse date "YYYY-MM-dd")
|
||||
:amount amount
|
||||
:description-original description-original
|
||||
:description-simple description-simple
|
||||
:type type
|
||||
:status status
|
||||
:company-id company-id
|
||||
:check-number check-number
|
||||
:bank-account-id (transaction->bank-account-id transaction)
|
||||
:check-id check-id
|
||||
})
|
||||
(when check-id
|
||||
(checks/update! {:id check-id :status "cleared"}))
|
||||
(when company-id
|
||||
(transactions/upsert!
|
||||
{:post-date (time/parse post-date "YYYY-MM-dd")
|
||||
:id (sha-256 (str id))
|
||||
:account-id account-id
|
||||
:date (time/parse date "YYYY-MM-dd")
|
||||
:amount amount
|
||||
:description-original description-original
|
||||
:description-simple description-simple
|
||||
:type type
|
||||
:status status
|
||||
:company-id company-id
|
||||
:check-number check-number
|
||||
:bank-account-id (transaction->bank-account-id transaction)
|
||||
:check-id check-id
|
||||
})
|
||||
(when check-id
|
||||
(checks/update! {:id check-id :status "cleared"})))
|
||||
|
||||
(catch Exception e
|
||||
(println e)))))
|
||||
|
||||
Reference in New Issue
Block a user