Fixes.
This commit is contained in:
@@ -106,6 +106,7 @@
|
|||||||
|
|
||||||
:payment {:fields {:id {:type :id}
|
:payment {:fields {:id {:type :id}
|
||||||
:type {:type :payment_type}
|
:type {:type :payment_type}
|
||||||
|
:original_id {:type 'Int}
|
||||||
:amount {:type 'String}
|
:amount {:type 'String}
|
||||||
:vendor {:type :vendor}
|
:vendor {:type :vendor}
|
||||||
:client {:type :client}
|
:client {:type :client}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
{:client-code (query-params "client-code")
|
{:client-code (query-params "client-code")
|
||||||
:original-id (query-params "original")}
|
:original-id (query-params "original")}
|
||||||
[:id :total :outstanding-balance :invoice-number :date :status :original-id
|
[:id :total :outstanding-balance :invoice-number :date :status :original-id
|
||||||
[:payments [:amount [:payment [:check-number :memo [:bank_account [:id :name :number :bank-name :bank-code]]]]]]
|
[:payments [:amount [:payment [:check-number :memo [:bank_account [:id :name :number :bank-name :bank-code :code]]]]]]
|
||||||
[:vendor [:name :id [:primary_contact [:name]] [:address [:street1 :city :state :zip]]]]
|
[:vendor [:name :id [:primary_contact [:name]] [:address [:street1 :city :state :zip]]]]
|
||||||
[:expense_accounts [:amount :id :expense_account_id :location
|
[:expense_accounts [:amount :id :expense_account_id :location
|
||||||
[:expense_account [:id :name [:parent [:id :name]]]]]]
|
[:expense_account [:id :name [:parent [:id :name]]]]]]
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
(let [query [[:all_payments
|
(let [query [[:all_payments
|
||||||
{:client-code (query-params "client-code")
|
{:client-code (query-params "client-code")
|
||||||
:original-id (query-params "original")}
|
:original-id (query-params "original")}
|
||||||
[:id :check-number :amount :memo :date :status :type
|
[:id :check-number :amount :memo :date :status :type :original-id
|
||||||
[:invoices [[:invoice [:id :original-id]] :amount]]
|
[:invoices [[:invoice [:id :original-id]] :amount]]
|
||||||
[:bank-account [:number :code :bank-name :bank-code :id]]
|
[:bank-account [:number :code :bank-name :bank-code :id]]
|
||||||
[:vendor [:name :id [:primary-contact [:name :email :phone]] :default-expense-account [:address [:street1 :city :state :zip]]]]
|
[:vendor [:name :id [:primary-contact [:name :email :phone]] :default-expense-account [:address [:street1 :city :state :zip]]]]
|
||||||
|
|||||||
@@ -68,23 +68,23 @@
|
|||||||
(try
|
(try
|
||||||
(when client-id
|
(when client-id
|
||||||
@(->> [(remove-nils #:transaction
|
@(->> [(remove-nils #:transaction
|
||||||
{:post-date (time/parse post-date "YYYY-MM-dd")
|
{:post-date (coerce/to-date (time/parse post-date "YYYY-MM-dd"))
|
||||||
:id (sha-256 (str id))
|
:id (sha-256 (str id))
|
||||||
:account-id account-id
|
:account-id account-id
|
||||||
:date (coerce/to-date (time/parse date "YYYY-MM-dd"))
|
:date (coerce/to-date (time/parse date "YYYY-MM-dd"))
|
||||||
:amount amount
|
:amount (double amount)
|
||||||
:description-original description-original
|
:description-original description-original
|
||||||
:description-simple description-simple
|
:description-simple description-simple
|
||||||
:type type
|
:type type
|
||||||
:status status
|
:status status
|
||||||
:client client-id
|
:client client-id
|
||||||
:check-number check-number
|
:check-number check-number
|
||||||
:bank-account (transaction->bank-account-id transaction)
|
:bank-account (transaction->bank-account-id transaction)
|
||||||
:payment (when check-id
|
:payment (when check-id
|
||||||
{:db/id check-id
|
{:db/id check-id
|
||||||
:payment/status :payment-status/cleared}
|
:payment/status :payment-status/cleared}
|
||||||
)
|
)
|
||||||
})]
|
})]
|
||||||
|
|
||||||
|
|
||||||
(d/transact (d/connect uri))))
|
(d/transact (d/connect uri))))
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
|
|
||||||
(defn do-import []
|
(defn do-import []
|
||||||
(let [transactions (client/get-transactions)
|
(let [transactions (client/get-transactions)
|
||||||
_ (println "All accounts:" (client/get-accounts))
|
#_#__ (println "All accounts:" (client/get-accounts))
|
||||||
_ (println "ALL Transactions:" transactions)
|
#_#__ (println "ALL Transactions:" transactions)
|
||||||
all-bank-accounts (mapcat (fn [c] (map
|
all-bank-accounts (mapcat (fn [c] (map
|
||||||
(fn [{:keys [:db/id :bank-account/yodlee-account-id]}]
|
(fn [{:keys [:db/id :bank-account/yodlee-account-id]}]
|
||||||
(when (and id yodlee-account-id)
|
(when (and id yodlee-account-id)
|
||||||
|
|||||||
Reference in New Issue
Block a user