Added Notes and cleared against fields.
This commit is contained in:
@@ -52,7 +52,14 @@
|
|||||||
:db/valueType :db.type/boolean
|
:db/valueType :db.type/boolean
|
||||||
:db/cardinality :db.cardinality/one
|
:db/cardinality :db.cardinality/one
|
||||||
:db/doc "Has this cleared?"}
|
:db/doc "Has this cleared?"}
|
||||||
|
{:db/ident :journal-entry/cleared-against
|
||||||
|
:db/valueType :db.type/string
|
||||||
|
:db/cardinality :db.cardinality/one
|
||||||
|
:db/doc "Cleared against"}
|
||||||
|
{:db/ident :journal-entry/note
|
||||||
|
:db/valueType :db.type/string
|
||||||
|
:db/cardinality :db.cardinality/one
|
||||||
|
:db/doc "notes about this journal-entry"}
|
||||||
{:db/ident :journal-entry-line/expense-account
|
{:db/ident :journal-entry-line/expense-account
|
||||||
:db/valueType :db.type/long
|
:db/valueType :db.type/long
|
||||||
:db/cardinality :db.cardinality/one
|
:db/cardinality :db.cardinality/one
|
||||||
|
|||||||
@@ -137,6 +137,8 @@
|
|||||||
{:fields {:id {:type :id}
|
{:fields {:id {:type :id}
|
||||||
:source {:type 'String}
|
:source {:type 'String}
|
||||||
:amount {:type 'String}
|
:amount {:type 'String}
|
||||||
|
:note {:type 'String}
|
||||||
|
:cleared_against {:type 'String}
|
||||||
:client {:type :client}
|
:client {:type :client}
|
||||||
:vendor {:type :vendor}
|
:vendor {:type :vendor}
|
||||||
:date {:type 'String}
|
:date {:type 'String}
|
||||||
@@ -454,6 +456,8 @@
|
|||||||
:date {:type 'String}
|
:date {:type 'String}
|
||||||
:vendor_name {:type 'String}
|
:vendor_name {:type 'String}
|
||||||
:amount {:type 'String}
|
:amount {:type 'String}
|
||||||
|
:note {:type 'String}
|
||||||
|
:cleared_against {:type 'String}
|
||||||
:line_items {:type '(list :import_ledger_line_item)}}}
|
:line_items {:type '(list :import_ledger_line_item)}}}
|
||||||
|
|
||||||
:edit_client {:fields {:id {:type :id}
|
:edit_client {:fields {:id {:type :id}
|
||||||
|
|||||||
@@ -200,6 +200,8 @@
|
|||||||
:journal-entry/external-id (:external_id entry)
|
:journal-entry/external-id (:external_id entry)
|
||||||
:journal-entry/vendor (all-vendors (:vendor_name entry))
|
:journal-entry/vendor (all-vendors (:vendor_name entry))
|
||||||
:journal-entry/amount (:amount entry)
|
:journal-entry/amount (:amount entry)
|
||||||
|
:journal-entry/note (:note entry)
|
||||||
|
:journal-entry/cleared-against (:cleared_against entry)
|
||||||
|
|
||||||
:journal-entry/line-items
|
:journal-entry/line-items
|
||||||
(mapv (fn [ea]
|
(mapv (fn [ea]
|
||||||
@@ -207,12 +209,10 @@
|
|||||||
(get all-client-locations (:client_code entry))
|
(get all-client-locations (:client_code entry))
|
||||||
(:location ea))
|
(:location ea))
|
||||||
(throw (Exception. (str "Location '" (:location ea) "' not found."))))
|
(throw (Exception. (str "Location '" (:location ea) "' not found."))))
|
||||||
|
|
||||||
(when (and (not (all-accounts (:account_identifier ea)))
|
(when (and (not (all-accounts (:account_identifier ea)))
|
||||||
(not (get
|
(not (get
|
||||||
(get all-client-bank-accounts (:client_code entry))
|
(get all-client-bank-accounts (:client_code entry))
|
||||||
(:account_identifier ea))))
|
(:account_identifier ea))))
|
||||||
|
|
||||||
(throw (Exception. (str "Account '" (:account_identifier ea) "' not found."))))
|
(throw (Exception. (str "Account '" (:account_identifier ea) "' not found."))))
|
||||||
(remove-nils {:journal-entry-line/account
|
(remove-nils {:journal-entry-line/account
|
||||||
(if (re-matches #"^[0-9]+$" (:account_identifier ea))
|
(if (re-matches #"^[0-9]+$" (:account_identifier ea))
|
||||||
|
|||||||
@@ -40,16 +40,18 @@
|
|||||||
:query-obj {:venia/queries [[:ledger-page
|
:query-obj {:venia/queries [[:ledger-page
|
||||||
(assoc params :client-id (:id @(re-frame/subscribe [::subs/client])))
|
(assoc params :client-id (:id @(re-frame/subscribe [::subs/client])))
|
||||||
[[:journal-entries [:id
|
[[:journal-entries [:id
|
||||||
:source
|
:source
|
||||||
:amount
|
:amount
|
||||||
[:vendor
|
:note
|
||||||
[:name :id]]
|
:cleared-against
|
||||||
|
[:vendor
|
||||||
|
[:name :id]]
|
||||||
[:client
|
[:client
|
||||||
[:name :id]]
|
[:name :id]]
|
||||||
[:line-items
|
[:line-items
|
||||||
[:id :debit :credit :location
|
[:id :debit :credit :location
|
||||||
[:account [:id :name]]]]
|
[:account [:id :name]]]]
|
||||||
:date]]
|
:date]]
|
||||||
:total
|
:total
|
||||||
:start
|
:start
|
||||||
:end]]]}
|
:end]]]}
|
||||||
|
|||||||
@@ -34,11 +34,13 @@
|
|||||||
(fn [{{lines :line-items :as d} :data :as g}]
|
(fn [{{lines :line-items :as d} :data :as g}]
|
||||||
(into []
|
(into []
|
||||||
(for [[external-id lines] (group-by line->id lines)
|
(for [[external-id lines] (group-by line->id lines)
|
||||||
:let [{:keys [source id client-code date vendor-name] :as line} (first lines)]]
|
:let [{:keys [source id client-code date vendor-name note cleared-against] :as line} (first lines)]]
|
||||||
{:source source
|
{:source source
|
||||||
:external-id (line->id line)
|
:external-id (line->id line)
|
||||||
:client-code client-code
|
:client-code client-code
|
||||||
:date date
|
:date date
|
||||||
|
:note note
|
||||||
|
:cleared-against cleared-against
|
||||||
:vendor-name vendor-name
|
:vendor-name vendor-name
|
||||||
:amount (reduce + 0
|
:amount (reduce + 0
|
||||||
(->> lines
|
(->> lines
|
||||||
@@ -214,7 +216,9 @@
|
|||||||
["Account" :account-identifier]
|
["Account" :account-identifier]
|
||||||
["Location" :location]
|
["Location" :location]
|
||||||
["Debit" :debit]
|
["Debit" :debit]
|
||||||
["Credit" :credit]]
|
["Credit" :credit]
|
||||||
|
["Note" :note]
|
||||||
|
["Cleared against" :cleared-against]]
|
||||||
:read-only-headings
|
:read-only-headings
|
||||||
[["status" :status]]
|
[["status" :status]]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user