diff --git a/project.clj b/project.clj index e99c1051..90f91a06 100644 --- a/project.clj +++ b/project.clj @@ -131,7 +131,7 @@ :main auto-ap.server - :aot [auto-ap.server auto-ap.datomic.migrate] + :aot [auto-ap.server auto-ap.datomic.migrate auto-ap.time clj-time.core clj-time.coerce clj-time.format] :uberjar-name "auto-ap.jar" diff --git a/resources/account customizations/NSG.csv b/resources/account customizations/NSG.csv new file mode 100644 index 00000000..df8b157b --- /dev/null +++ b/resources/account customizations/NSG.csv @@ -0,0 +1,24 @@ +Client Account,IOL Account,IOL Account Name,This Client's Account Name,"Action needed (Use existing, customize existing, Add shared account, Add custom account, Make Visible)","Account Type (Dividend, Expense, Asset, Liability, Equity, Revenue)","Location (e.g., A or HQ)","Default Setting +(Per-Customer +Visible by default +Hidden by default)" +41000 SC San Jose,49001,Service Income 1,SCSJ Labor Fees,Add Custom Account,revenue,,Per-Customer + Billable Expense Income,49002,Service Income 2,Expense Income,Add Custom Account,revenue,,Per-Customer + Markup,49003,Service Income 3,Markup,Add Custom Account,revenue,,Per-Customer + Sales,49004,Service Income 4,Sales,Add Custom Account,revenue,,Per-Customer + Sales of Product Income,49005,Service Income 5,Sales of Product Income,Add Custom Account,revenue,,Per-Customer + Unapplied Cash Payment Income,49006,Service Income 6,Unapplied.Cash Payment Income,Add Custom Account,revenue,,Per-Customer + Uncategorized Income,49007,Service Income 7,Uncategorized Income,Add Custom Account,revenue,,Per-Customer +40000 SC Campbell,49000,Service Income,SCCB Labor Fees,Customize Existing,revenue,,Hidden by default +10001 Bank:US bank 3774,11100,Bank 1,US Bank 3774 (Histroical),Customize Existing,Equity,, +25000 Payable to SCSJ,21001,Accounts Payable 1,Payable to SCSJ,Customize Existing,Liability,, +26000 Payable to SCC,21002,Accounts Payable 2,Payable to SCCB,Customize Existing,Liability,, +54000 Labor Cost,62001,BOH Payroll 1,Sushi Chef Payroll,Customize Existing,expense,, +54010 Labor Cost:Regular Wages,62001,BOH Payroll 1,Sushi Chef Payroll,Customize Existing,expense,, +54020 Labor Cost:Overtime Wages,62001,BOH Payroll 1,Sushi Chef Payroll,Customize Existing,expense,, +54030 Labor Cost:Double Time wages,62001,BOH Payroll 1,Sushi Chef Payroll,Customize Existing,expense,, +54045 Labor Cost:Sushi Wages,62001,BOH Payroll 1,Sushi Chef Payroll,Customize Existing,expense,, +54050 Labor Cost:Federal Payroll Taxes,69801,Other Payroll Taxes 1,Federal Payroll Taxes,Customize Existing,expense,, +54060 Labor Cost:State Payroll Taxes,69802,Other Payroll Taxes 2,CA Payroll Taxes,Customize Existing,expense,, +,12001,AR 1,Due from SCCB,Add Custom Account,asset,,Per Customer +,12002,AR 2,Due from SCSJ,Add Custom Account,asset,,Per Customer diff --git a/resources/account customizations/NSG.numbers b/resources/account customizations/NSG.numbers new file mode 100755 index 00000000..d8b7bcac Binary files /dev/null and b/resources/account customizations/NSG.numbers differ diff --git a/resources/account customizations/PWL.csv b/resources/account customizations/PWL.csv new file mode 100644 index 00000000..72e2df24 --- /dev/null +++ b/resources/account customizations/PWL.csv @@ -0,0 +1,95 @@ +Client Account,IOL Account,IOL Account Name,This Client's Account Name,"Action needed (Use existing, customize existing, Add shared account, Add custom account, Make Visible)","Account Type (Dividend, Expense, Asset, Liability, Equity, Revenue)","Location (e.g., A or HQ)","Default Setting +(Per-Customer +Visible by default +Hidden by default)" +469 E Campbell Sublease,49011,Service Income 11,469 E. Campbell Sublease,Add Custom Account,Revenue,,Per-Customer +471 E Campbell Sublease,49012,Service Income 12,471 E. Campbell Sublease,Add Custom Account,Revenue,,Per-Customer +40800 Income - Van use,49021,Service Income 21,Van Use Income (Pass through),Add Custom Account,Revenue,,Per-Customer + Passthrough Contractor,49022,Service Income 22,Catering Contractor (Pass Through),Add Custom Account,Revenue,,Per-Customer +40110 Passthru Salary Reimbursement,49031,Service Income 31,Passthru Salary Reimbursement,Add Custom Account,Revenue,,Per-Customer +40115 Passthru for Bonus,49032,Service Income 32,Passthru for Bonus,Add Custom Account,Revenue,,Per-Customer +40120 Passthru for taxes,49033,Service Income 33,Passthru for taxes,Add Custom Account,Revenue,,Per-Customer +40140 Interest Reimbursement Passthrough,49702,Non-Business Income 2,Interest Reimbursement Passthrough,Add Custom Account,Revenue,,Per-Customer +12110 Receivable from SCC,12820,Loans Receivable 20,SCCB Receivable,Add Custom Account,asset,A,Per-Customer +12110-1 $90K Loan - Principal Amount,12821,Loans Receivable 21,$90K Loan - Principal Amount,Add Custom Account,asset,A,Per-Customer +12110-2 $90K Loan - Interest on loan,12822,Loans Receivable 22,$90K Loan - Interest on loan,Add Custom Account,asset,A,Per-Customer +12110-3 $50K Loan#1 Principal,12823,Loans Receivable 23,$50K Loan#1 Principal,Add Custom Account,asset,A,Per-Customer +12110-4 50K Loan#1 Interest,12824,Loans Receivable 24,50K Loan#1 Interest,Add Custom Account,asset,A,Per-Customer +12110-5 50K Loan#2 Principal,12825,Loans Receivable 25,50K Loan#2 Principal,Add Custom Account,asset,A,Per-Customer +12110-6 50K Loan#2 Interest,12826,Loans Receivable 26,50K Loan#2 Interest,Add Custom Account,asset,A,Per-Customer +12110-7 150K Loan#3 Principal,12827,Loans Receivable 27,150K Loan#3 Principal,Add Custom Account,asset,A,Per-Customer +12110-8 150K Loan#3 Interest,12828,Loans Receivable 28,150K Loan#3 Interest,Add Custom Account,asset,A,Per-Customer +12120 Receivable from SCSJ,12830,Loans Receivable 30,Receivable from SCSJ,Add Custom Account,asset,A,Per-Customer +12121 Loan USB 7793 P1 Equipment 300k,12831,Loans Receivable 31,Loan USB 7793 P1 Equipment 300k,Add Custom Account,asset,A,Per-Customer +12122 Loan USB 1838 Constr P2 100k re,12832,Loans Receivable 32,Loan USB 1838 Constr P2 100k re,Add Custom Account,asset,A,Per-Customer +12123 Loan USB 6712 Constr P2 72k,12833,Loans Receivable 33,Loan USB 6712 Constr P2 72k,Add Custom Account,asset,A,Per-Customer +12124-1 Original loan from the bank,12834,Loans Receivable 34,Original loan from the bank,Add Custom Account,asset,A,Per-Customer +12125 SCSJ P2 Contsruction loan,12836,Loans Receivable 36,P2 Contsruction loan,Add Custom Account,asset,A,Per-Customer +12127 CC Loan for SCSJ,12837,Loans Receivable 37,CC Loan to SCSJ,Add Custom Account,asset,A,Per-Customer +12128-1 Principal Amount,12838,Loans Receivable 38,CC Loan to SCSJ - Principal Amount,Add Custom Account,asset,A,Per-Customer +12128-2 Interest on Loan,12839,Loans Receivable 39,CC Loan to SCSJ - Interest,Add Custom Account,asset,A,Per-Customer + Short-Term Loan to SCSJ,,,Short term Loan to SCSJ,Add Custom Account,asset,A,Per-Customer +13000 Investment in SCSJ,17001,Investment 1,Investment in SCSJ,Add Custom Account,asset,A,Per-Customer +13100 Investment in SCC,17002,Investment 2,Investment in SCCB,Add Custom Account,asset,A,Per-Customer +20001 Accounts Payable,21003,Accounts Payable 3,Accounts Payable General,Add Custom Account,liability,A,Per-Customer +22100 Bus CC#7034,21004,Accounts Payable 4,Bus CC#7034,Add Custom Account,liability,A,Per-Customer +22110 CC 9017 (cc x6721 and 6995),21005,Accounts Payable 5,CC 9017 (cc x6721 and 6995),Add Custom Account,liability,A,Per-Customer +22111 CCard CM x6721,21006,Accounts Payable 6,CCard CM x6721,Add Custom Account,liability,A,Per-Customer +22112 CCard RSM x6595,21007,Accounts Payable 7,CCard RSM x6595,Add Custom Account,liability,A,Per-Customer +22120 Central Acct 0010 (0028/0036),21008,Accounts Payable 8,Central Acct 0010 (0028/0036),Add Custom Account,liability,A,Per-Customer +22130 CCard RSM x9988,21009,Accounts Payable 9,CCard RSM x9988,Add Custom Account,liability,A,Per-Customer +22140 CCard RSM x7042,21010,Accounts Payable 10,CCard RSM x7042,Add Custom Account,liability,A,Per-Customer +40100 Income-Management Fee SCC,49001,Service Income 1,Management Fee SCCB,Customize Existing,,, +,49002,Service Income 2,Management Fee SCSJ,Customize Existing,,, +50310 Bonus - MS,61001,Manager Payroll 1,Manager Bonuses,Customize Existing,,, +50320 Van Depreciation,57003,Delivery Costs 3,Van Depreciation,Customize Existing,,, +50325 Van Finance Cost,57002,Delivery Cost 2,Van Finance Cost,Customize Existing,,, +50330 Van & Driving Expenses,57001,Delivery Cost 1,Van Gas and Operating Costs,Customize Existing,,, +66800 Meeting Meals Deductible,91201,Meals & Entertainment 1,Meeting Meals - Deductible,Customize Existing,,, +67410 Transportation,91301,Travel 1,Transportation,Customize Existing,,, +67420 Lodging Expenses,91302,Travel 2,Lodging Expenses,Customize Existing,,, +67440 Taxi/Parking/Tolls,91303,Travel 3,Taxi/ Parking/ Tolls,Customize Existing,,, +68400 CP - Brick & Mortar,82101,Rent 1,Stripe Location Rent,Customize Existing,,, +69350 Severance paid,61001,Manager Payroll 1,Manager Bonuses,Customize Existing,,, +69740 Payroll Processing Fee,81110,Professional Fees,Payroll Processing,Customize Existing,,, +44200 Dividend income,49701,Non-Business Income 1,Dividend Income,Customize Existing,,, +67640 Interest Exp. for Randy's loan,93401,Interest Expense 1,Interest Exp. for Randy's loan,Customize Existing,,, +67650 Credit Card Interest Expense,93402,Interest Expense 2,Credit Card Interest Expense,Customize Existing,,, + Reconciliation Discrepancies,75451,Other Cash Shortfalls 1,Reconciliation Discrepancies,Customize Existing,,, +10001 US Bank Checking Main x2370,11100,Bank 1,US Bank Checking Main x2370,Customize Existing,,, +10002 US Bank Checking Petty x2388,11110,Bank 2,US Bank Checking Petty x2388,Customize Existing,,, +10003 US Bank Savings x3818,11120,Bank 3,US Bank Savings x3818,Customize Existing,,, +10008 US Bank Checking x8522,11130,Bank 4,US Bank Checking x8522,Customize Existing,,, +12300 Receivable against NSG payroll,12001,Accounts Receivable1,NSG Receivable,Customize Existing,,, +12500 Prepaid Rent,14400,Other - Prepaid,Rent - Prepaid,Customize Existing,,, +12800 Distribution Receivable from SCC,12800,Other AR,Distribution Receivable from SCSJ,Customize Existing,,, + Uncategorized Asset,15400,Equipment,Uncategorized Asset,Customize Existing,,, +15101 Comp & Equip - Original cost,15401,Equipment 1,Comp & Equip - Original cost,Customize Existing,,, +15102 Accum Depreciaton,15402,Equipment 2,Comp & Equip - Accum Depreciaton,Customize Existing,,, +15301 Van2-GMC van with wrap - Origin,15403,Equipment 3,GMC van with wrap - Origin,Customize Existing,,, +15302 Van2 - Accum Depreciation,15404,Equipment 4,GMC van with wrap - Accum Depreciation,Customize Existing,,, +15401 Van2- Ford van with wrap - Origin,15405,Equipment 5,Ford van with wrap - Origin,Customize Existing,,, +15402 Van2 Ford- Accum Depreciation,15406,Equipment 6,Ford van with wrap - Accum Depreciation,Customize Existing,,, +26100 Payable to SCSJ,21001,Accounts Payable 1,Payable to SCSJ,Customize Existing,,, +26200 Payable to SCC,21002,Accounts Payable 2,Payable to SCCB,Customize Existing,,, +24200 Accrued Payroll for Caanan,28101,Notes Payable 101,Accrued Payroll for Caanan,Customize Existing,,, +24300 Accrued GM Payroll,28102,Notes Payable 102,Accrued GM Payroll,Customize Existing,,, +24350 Accrued GM Bonus,28103,Notes Payable 103,Accrued GM Bonus,Customize Existing,,, +24500 Accrued Payroll For Randy,28100,Notes Payable 100,Accrued Randy Payroll,Customize Existing,,, +26000 Accrued Expenses,28110,Notes Payable 110,SCC Accrued Expenses,Customize Existing,,, +26300-1 Principal Amount,28111,Notes Payable 111,Loan 1 Principal Amount,Customize Existing,,, +26300-2 Interest Accrued,28112,Notes Payable 112,Loan 1 Interest Accrued,Customize Existing,,, +26310-1 Principal Amount (100K),28113,Notes Payable 113,Loan 2 Principal Amount (100K),Customize Existing,,, +26310-2 Interest Accrued (100K),28114,Notes Payable 114,Loan 2 Accrued Interest (100K),Customize Existing,,, +26320-1 Principal Amount (100K-2),28115,Notes Payable 115,Loan 3 Principal Amount (100K),Customize Existing,,, +26320-2 Interest Accrued (100K-2),28116,Notes Payable 116,Loan 3 Accrued Interest (100K),Customize Existing,,, +26330-1 Principal Amount (200K),28117,Notes Payable 117,Loan 4 Principal Amount (200K),Customize Existing,,, +26330-2 Interest Accrued (200K),28118,Notes Payable 118,Loan 4 Accrued Interest (200K),Customize Existing,,, +26400 Advance Received,28070,Notes Payable 7,Advance Received,Customize Existing,,, +27200 USBank Cash Flow Mgr 2448 (75K),28010,Notes Payable 1,USBank Cash Flow Mgr 2448 (75K),Customize Existing,,, +27250 US Bank Van Loan 9874,28020,Notes Payable 2,US Bank Van Loan 9874,Customize Existing,,, +27300 USBank Equip Loan $300k,28030,Note Payable 3,USBank Equip Loan $300k,Customize Existing,,, +27350 UBOC Loan from CLS $28k,28040,Note Payable 4,UBOC Loan from CLS $28k,Customize Existing,,, +27400 USBank Quick Loan $72k,28050,Notes Payable 5,USBank Quick Loan $72k,Customize Existing,,, +27450 USBank Quick Loan Refi $100k,28060,Notes Payable 6,USBank Quick Loan Refi $100k,Customize Existing,,, +30910 Dist. to Randy (IRS payments),34000,Distributions / Capital Withdrawal - 1,Distributions - Randy,Customize Existing,,, \ No newline at end of file diff --git a/resources/account customizations/SCSJ.csv b/resources/account customizations/SCSJ.csv new file mode 100644 index 00000000..b3ea2fb2 --- /dev/null +++ b/resources/account customizations/SCSJ.csv @@ -0,0 +1,185 @@ +Sushi Confidential Account,IOL Account,IOL Account Name,This Client's Account Name,"Action needed (Use existing, customize existing, Add shared account, Add custom account, Make Visible)","Account Type (Dividend, Expense, Asset, Liability, Equity, Revenue)","Location (e.g., A or HQ)","Default Setting +(Per-Customer +Visible by default +Hidden by default)", +15125 Leasehold Improvements P1:Building Improvements P1,15309,Leashold Improvements 9,15125 Leasehold Improvements P1:Building Improvements P1,Add Custom Account,Asset,A,Per Customer, +15210 Leasehold Improvement P2,15310,Leashold Improvements 10,Leasehold Improvement P2,Add Custom Account,Asset,A,Visible by default, +15211 Leasehold Improvement P2:Plan Check P2,15311,Leashold Improvements 11,Leasehold Improvement P2:Plan Check P2,Add Custom Account,Asset,A,Visible by default, +"15213 Leasehold Improvement P2:City Permits, Inspections, P2",15312,Leashold Improvements 12,"Leasehold Improvement P2:City Permits, Inspections",Add Custom Account,Asset,A,Visible by default, +"15215 Leasehold Improvement P2:Plans, Drawings, Architect, P2",15313,Leashold Improvements 13,"Leasehold Improvement P2:Plans, Drawings, Architec",Add Custom Account,Asset,A,Visible by default, +15221 Leasehold Improvement P2:Construction P2 -Demo,15314,Leashold Improvements 14,Leasehold Improvement P2:Construction P2 -Demo,Add Custom Account,Asset,A,Visible by default, +15224 Leasehold Improvement P2:Construction P2,15315,Leashold Improvements 15,Leasehold Improvement P2:Construction P2,Add Custom Account,Asset,A,Visible by default, +15225 Leasehold Improvement P2:Building Improvements P2,15316,Leashold Improvements 16,Leasehold Improvement P2:Building Improvements P2,Add Custom Account,Asset,A,Visible by default, +15245 Leasehold Improvement P2:Accum Depreciation-P2 Leasehold,15317,Leashold Improvements 17,Leasehold Improvement P2:Accum Depreciation-P2 Lea,Add Custom Account,Asset,A,Visible by default, +15310 Leasehold Improvement P2b,15318,Leashold Improvements 18,Leasehold Improvement P2b,Add Custom Account,Asset,A,Visible by default, +15311 Leasehold Improvement P2b:Plan Check P2b,15319,Leashold Improvements 19,Leasehold Improvement P2b:Plan Check P2b,Add Custom Account,Asset,A,Visible by default, +"15313 Leasehold Improvement P2b:City Permits, Inspections, P2b",15320,Leashold Improvements 20,"Leasehold Improvement P2b:City Permits, Inspection",Add Custom Account,Asset,A,Visible by default, +"15315 Leasehold Improvement P2b:Plans, Drawings, Architect, P2b",15321,Leashold Improvements 21,"Leasehold Improvement P2b:Plans, Drawings, Archite",Add Custom Account,Asset,A,Visible by default, +15324 Leasehold Improvement P2b:Construction P2b,15322,Leashold Improvements 22,Leasehold Improvement P2b:Construction P2b,Add Custom Account,Asset,A,Visible by default, +15325 Leasehold Improvement P2b:Building Improvements P2b,15323,Leashold Improvements 23,Leasehold Improvement P2b:Building Improvements P2,Add Custom Account,Asset,A,Visible by default, +15330 Leasehold Improvement P2b:Equipment Purchase P2b,15324,Leashold Improvements 24,Leasehold Improvement P2b:Equipment Purchase P2b,Add Custom Account,Asset,A,Visible by default, +30120 Equity:Partner 1 Investment-PWL Phase2,33011,Contributions/ Capital Account - 2.1,Partner 1 - PWL - Investment Phase 2,Add Custom Account,Equity,A,Per Customer, +30130 Equity:Partner 1 Invest-DirectPurchase,33012,Contributions/ Capital Account - 2.2,Partner 1 - PWL - Invest-Direct Purchase,Add Custom Account,Equity,A,Per Customer, +21510 Accrued Liabilities:Accrued Payables,21001,Accounts Payable 1,Other Accrued Payables,Add Custom Account,Liability,A,Per-Customer, +21520 Accrued Liabilities:Payable to CLS,21002,Accounts Payable 2,Payable to CLS,Add Custom Account,Liability,A,Per-Customer, +21530 Accrued Liabilities:Payable to Sushi Randy LLC,21003,Accounts Payable 3,Payable to Sushi Randy LLC,Add Custom Account,Liability,A,Per-Customer, +21540 Loan from PWL:Payable to PWL,21004,Accounts Payable 4,Payable to PWL,Add Custom Account,Liability,A,Per-Customer, +21541 Accrued Liabilities:Accrued Management Fees,21005,Accounts Payable 5,Management Fees Payable,Add Custom Account,Liability,A,Per-Customer, +21542 Accrued Liabilities:Accrued DOPS Fee,21006,Accounts Payable 6,DOPS Fee Payable,Add Custom Account,Liability,A,Per-Customer, +21542-1 Accrued Liabilities:Accrued DOCE Fees,21007,Accounts Payable 7,DOCE Fees Payable,Add Custom Account,Liability,A,Per-Customer, +21543 Accrued Liabilities:Van Use (catering),21008,Accounts Payable 8,Van Use (catering) Payable,Add Custom Account,Liability,A,Per-Customer, +21550 Payable to NSG,21009,Accounts Payable 9,Payable to NSG,Add Custom Account,Liability,A,Per-Customer, +"23000 Loan from PWL:Loans, Phase 1 Startup",28100,Notes Payable 10,Loan from PWL - P1 - USB 2448 75K,Add Custom Account,Liability,A,Per Customer, +"23100 Loan from PWL:Loans, Phase 1 Startup:P1 Loan USB 7793 Equipment 300k",28110,Notes Payable 11,Loan from PWL - P1 - USB 7793 Equipment 300k,Add Custom Account,Liability,A,Per-Customer, +"23200 Loan from PWL:Loans, Phase 1 Startup:P1 Loan UBOC 7183 CLSEquity 28k",28120,Notes Payable 12,Loan from PWL - P1 - UBOC 7183 CLSEquity 28k,Add Custom Account,Liability,A,Per-Customer, +"23300 Loan from PWL:Loans, Phase 1 Startup:P1 Loan FRB Constr 100k",28130,Notes Payable 13,Loan from PWL - P1 - Loan FRB Constr 100k,Add Custom Account,Liability,A,Per-Customer, +"23350 Loan from PWL:Loans, Phase 1 Startup:P1 Loan USB 1838 Const 100kReFi",28140,Notes Payable 14,Loan from PWL - P1 - USB 1838 Const 100kReFi,Add Custom Account,Liability,A,Per-Customer, +"23400 Loan from PWL:Loans, Phase 1 Startup:P2 Loan USB 6712 Constr 72k",28150,Notes Payable 15,Loan from PWL - P2 - USB 6712 Constr 72k,Add Custom Account,Liability,A,Per-Customer, +"23500 Loan from PWL:Loans, Phase 1 Startup:P2 Cash Loan from PWL",28160,Notes Payable 16,Loan from PWL - P2 - Cash Loan from PWL,Add Custom Account,Liability,A,Per-Customer, +"23050 Loan from PWL:Loans, Phase 1 Startup:P1 Loan Principle USB 2448 75k",28100,Notes Payable 10,Loan from PWL - P1 - USB 2448 75K,Add Custom Account,Liability,A,Per Customer, +"23055 Loan from PWL:Loans, Phase 1 Startup:P1 Loan Interest USB 2448 75K",28100,Notes Payable 10,Loan from PWL - P1 - USB 2448 75K,Add Custom Account,Liability,A,Per Customer, +10021 Bank Accounts:US Bank x2974,11100,Bank 1,US Bank x2974,Customize Existing,Asset,A,Per Customer, +10022 Bank Accounts:US Bank x1455 P2 Construction,11110,Bank 2,US Bank x1455 P2 Construction,Customize Existing,Asset,A,Per Customer, +Receivable from NSG,12001,Accounts Receivable 1,Receivable from NSG,Customize Existing,Asset,,Per Customer, +Receivable from PWL,12002,Accounts Receivable 2,Receivable from PWL,Customize Existing,Asset,,Per Customer, +11020 Advance Wages,14401,Other - Prepaid 1,Advance Wages,Customize Existing,Asset,,Per Customer, +11025 House Account,12200,Invoice Receivable,House Account,Customize Existing,Asset,A,Visible by default, +12410 All Inventory Items:Produce,13001,Food Inventory 1,All Inventory Items:Produce,Customize Existing,Asset,,Per Customer, +12415 All Inventory Items:Dairy,13002,Food Inventory 2,All Inventory Items:Dairy,Customize Existing,Asset,,Per Customer, +12420 All Inventory Items:Proteins - All,13003,Food Inventory 3,All Inventory Items:Proteins - All,Customize Existing,Asset,,Per Customer, +12421 All Inventory Items:Proteins - All:Beef/Pork,13004,Food Inventory 4,All Inventory Items:Proteins - All:Beef/Pork,Customize Existing,Asset,,Per Customer, +12422 All Inventory Items:Proteins - All:Seafood,13005,Food Inventory 5,All Inventory Items:Proteins - All:Seafood,Customize Existing,Asset,,Per Customer, +12423 All Inventory Items:Proteins - All:Poultry/Chicken,13006,Food Inventory 6,All Inventory Items:Proteins - All:Poultry/Chicken,Customize Existing,Asset,,Per Customer, +12430 All Inventory Items:Sakes - All,13301,Beer Inventory 1,All Inventory Items:Sakes - All,Customize Existing,Asset,,Per Customer, +12431 All Inventory Items:Sakes - All:Draft Sake,13302,Beer Inventory 2,All Inventory Items:Sakes - All:Draft Sake,Customize Existing,Asset,,Per Customer, +12432 All Inventory Items:Sakes - All:Bottled Sake,13303,Beer Inventory 3,All Inventory Items:Sakes - All:Bottled Sake,Customize Existing,Asset,,Per Customer, +12436 All Inventory Items:Beers - All:Draft Beer,13304,Beer Inventory 4,All Inventory Items:Beers - All:Draft Beer,Customize Existing,Asset,,Per Customer, +12437 All Inventory Items:Beers - All:Bottled Beer,13305,Beer Inventory 5,All Inventory Items:Beers - All:Bottled Beer,Customize Existing,Asset,,Per Customer, +12450 All Inventory Items:Bar Mixes,13201,Liquor Inventory 1,All Inventory Items:Bar Mixes,Customize Existing,Asset,,Per Customer, +12500 Keg Deposits,13306,Beer Inventory 6,Keg Deposits,Customize Existing,Asset,,Per Customer, +15010 Fixed Assets:FFE-Furniture and Equipment P1,15401,Equipment 1,Fixed Assets:FFE-Furniture and Equipment P1,Customize Existing,Asset,A,Per Customer, +15020 Fixed Assets:FFE-Furniture/Equipment P2,15402,Equipment 2,Fixed Assets:FFE-Furniture/Equipment P2,Customize Existing,Asset,A,Per Customer, +15110 Leasehold Improvements P1,15301,Leashold Improve. 1,Leasehold Improvements P1,Customize Existing,Asset,A,Per Customer, +15111 Leasehold Improvements P1:Plan Check P1,15302,Leashold Improve. 2,Leasehold Improvements P1:Plan Check P1,Customize Existing,Asset,A,Per Customer, +"15113 Leasehold Improvements P1:City Permits, Inspections, P1",15303,Leashold Improve. 3,"Leasehold Improvements P1:City Permits, Inspection",Customize Existing,Asset,A,Per Customer, +"15115 Leasehold Improvements P1:Plans, Drawings, Architect, P1",15304,Leashold Improve. 4,"15115 Leasehold Improvements P1:Plans, Drawings, Architect, P1",Customize Existing,Asset,A,Per Customer, +15121 Leasehold Improvements P1:Construction P1 - Demo,15305,Leashold Improve. 5,15121 Leasehold Improvements P1:Construction P1 - Demo,Customize Existing,Asset,A,Per Customer, +15122 Leasehold Improvements P1:Construction P1 - Sewer,15306,Leashold Improve. 6,15122 Leasehold Improvements P1:Construction P1 - Sewer,Customize Existing,Asset,A,Per Customer, +15123 Leasehold Improvements P1:Construction P1-Roof Replace,15307,Leashold Improve. 7,15123 Leasehold Improvements P1:Construction P1-Roof Replace,Customize Existing,Asset,A,Per Customer, +15124 Leasehold Improvements P1:Construction(Contractor) P1,15308,Leashold Improve. 8,15124 Leasehold Improvements P1:Construction(Contractor) P1,Customize Existing,Asset,A,Per Customer, +20220 SJ CreditCard USB x7446 Central,11120,Bank 3,SJ CreditCard USB x7446 Central,Customize Existing,Asset,A,Per Customer, +20230 SJ CreditCard USB x7446 Central:SJ Credit Card USB x9340 - RSM,11130,Bank 4,SJ CreditCard USB x7446 Central:SJ Credit Card USB,Customize Existing,Asset,A,Per Customer, +20240 SJ CreditCard USB x7446 Central:SJ Credit Card USB x9357 -CM,11140,Bank 5,SJ CreditCard USB x7446 Central:SJ Credit Card USB,Customize Existing,Asset,A,Per Customer, +20250 SJ CreditCard USB x7446 Central:SJ Credit Card USB x9365 -MS,11150,Bank 6,SJ CreditCard USB x7446 Central:SJ Credit Card USB,Customize Existing,Asset,A,Per Customer, +20260 SJ CreditCard USB x7446 Central:SJ Credit Card USB x9373 -LF,11160,Bank 7,SJ CreditCard USB x7446 Central:SJ Credit Card USB,Customize Existing,Asset,A,Per Customer, +20261 SJ CreditCard USB x7446 Central:CC-4126 AP,11170,Bank 8,SJ CreditCard USB x7446 Central:CC-4126 AP,Customize Existing,Asset,A,Per Customer, +20270 SJ CreditCard USB x7446 Central:SJ Credit Card USB x7335 -AG,11180,Bank 9,SJ CreditCard USB x7446 Central:SJ Credit Card USB,Customize Existing,Asset,A,Per Customer, +20280 SJ CreditCard USB x7446 Central:9340 Credit Card-RSM - 5512,11190,Bank 10,SJ CreditCard USB x7446 Central:9340 Credit Card-R,Customize Existing,Asset,A,Per Customer, +30100 Equity:Partner 1 Investment-PWL,33010,Contributions/ Capital Account - 2,Partner 1 - PWL - Investment,Customize Existing,Equity,A,Per Customer, +30150 Equity:Partner 1 Withdraws - PWL,34010,Distributions / Capital Withdrawal - 2,Partner 1 - PWL - Withdraws,Customize Existing,Equity,A,Per Customer, +30200 Equity:Partner 2 Investment - DM,33020,Contributions/ Capital Account - 3,Partner 2 - DM - Investment,Customize Existing,Equity,A,Per Customer, +30250 Equity:Partner 2 Withdraws - DM,34020,Distributions / Capital Withdrawal - 3,Partner 2 - DM - Withdraws,Customize Existing,Equity,A,Per Customer, +30300 Equity:Partner 3 Investment - MP,33030,Contributions/ Capital Account - 4,Partner 3 - MP - Investment,Customize Existing,Equity,A,Per Customer, +30350 Equity:Partner 3 Withdraws - MP,34030,Distributions / Capital Withdrawal - 4,Partner 3 - MP - Withdraws,Customize Existing,Equity,A,Per Customer, +30360 Equity:Partners 4 Investment - LD,33040,Contributions/ Capital Account - 5,Partner 3 - LD - Investment,Customize Existing,Equity,A,Per Customer, +30370 Equity:Partner 4 Withdrawals - LD,34040,Distributions / Capital Withdrawal - 5,Partner 3 - LD - Withdraws,Customize Existing,Equity,A,Per Customer, +51021 Draft Sake,54611,Sake Cost 1,Draft Sake,Customize Existing,Expense,,Per Customer, +51022 Bottled Sake,54612,Sake Cost 2,Bottled Sake,Customize Existing,Expense,,Per Customer, +51570 Fuel Surcharge Costs,57001,Delivery Cost 1,Fuel Surcharge Costs,Customize Existing,Expense,,Per Customer, +51580 Taxes - sales tax paid,57002,Delivery Cost 2,Taxes - sales tax paid,Customize Existing,Expense,,Per Customer, +57010 Uniforms/StaffShirts/ChefCoats,73301,Uniforms 1,Uniforms/StaffShirts/ChefCoats,Customize Existing,Expense,,Per Customer, +57020 Employee Shirts/Hoodies,73302,Uniforms 2,Employee Shirts/Hoodies,Customize Existing,Expense,,Per Customer, +60110 Employee Meal Discount,72701,Meal Comps 1,Employee Meal Discount,Customize Existing,Expense,,Per Customer, +"60130 Comps - Service, etc",72702,Meal Comps 2,"Comps - Service, etc",Customize Existing,Expense,,Per Customer, +60240 Charitable Contributions,72711,Promotional or Donation Meal Comps 1,Charitable Contributions,Customize Existing,Expense,,Per Customer, +60345 Advertising / Signage/Bus.Cards,72181,Advertising 1,Advertising / Signage/Bus.Cards,Customize Existing,Expense,,Per Customer, +60360 Advertising Print/Coupons/Flyers,72182,Advertising 2,Advertising Print/Coupons/Flyers,Customize Existing,Expense,,Per Customer, +60380 Photography/Video/Pictures,72183,Advertising 3,Photography/Video/Pictures,Customize Existing,Expense,,Per Customer, +"60390 Memberships (Chambers, Etc)",72184,Advertising 4,"Memberships (Chambers, Etc)",Customize Existing,Expense,,Per Customer, +60420 InHouse Event/Holiday Decor,73701,Company Picnics 1,InHouse Event/Holiday Decor,Customize Existing,Expense,,Per Customer, +60430 Florals/Balloons,73702,Company Picnics 2,Florals/Balloons,Customize Existing,Expense,,Per Customer, +60460 Team Building for our staff,73703,Company Picnics 3,Team Building for our staff,Customize Existing,Expense,,Per Customer, +60470 DJ/Live Entertainment,73704,Company Picnics 4,DJ/Live Entertainment,Customize Existing,Expense,,Per Customer, +60480 Benefits to Employees,73705,Company Picnics 5,Benefits to Employees,Customize Existing,Expense,,Per Customer, +61250 Chopsticks,71101,FOH Supplies - Consumable 1,Chopsticks,Customize Existing,Expense,,Per Customer, +61270 POS Receipt Paper,71181,Staff Supplies - Consumable 1,POS Receipt Paper,Customize Existing,Expense,,Per Customer, +61300 To Go consumables,71182,Staff Supplies - Consumable 2,To Go consumables,Customize Existing,Expense,,Per Customer, +61470 Medical Supplies-FirstAid,71183,Staff Supplies - Consumable 3,Medical Supplies-FirstAid,Customize Existing,Expense,,Per Customer, +61520 Dishwasher Rental & Consumables,74101,Cleaning Supplies 1,Dishwasher Rental & Consumables,Customize Existing,Expense,,Per Customer, +61530 Janitorial/Bathroom Consumables,74102,Cleaning Supplies 2,Janitorial/Bathroom Consumables,Customize Existing,Expense,,Per Customer, +61920 Catering 1-time use items,71801,Caterinig Expenses 1,Catering 1-time use items,Customize Existing,Expense,,Per Customer, +61940 Van & Driving Expenses,71802,Caterinig Expenses 2,Van & Driving Expenses,Customize Existing,Expense,,Per Customer, +61970 Catering Equipment Rental,71803,Caterinig Expenses 3,Catering Equipment Rental,Customize Existing,Expense,,Per Customer, +62410 Linen Laundry,74401,Laundry and Drycleaning 1,Linen Laundry,Customize Existing,Expense,,Per Customer, +62860 HotSchedules,75101,Office Supplies 1,HotSchedules,Customize Existing,Expense,,Per Customer, +62870 Printing & copys for office,75102,Office Supplies 2,Printing & copys for office,Customize Existing,Expense,,Per Customer, +62880 Postage,75103,Office Supplies 3,Postage,Customize Existing,Expense,,Per Customer, +64150 Office Electric,83101,Electric 1,Office Electric,Customize Existing,Expense,,Per Customer, +65105 Craig - Handyman,74501,Repairs to Building 1,Craig - Handyman,Customize Existing,Expense,,Per Customer, +65110 Building Repairs & Improvement,74502,Repairs to Building 2,Building Repairs & Improvement,Customize Existing,Expense,,Per Customer, +65205 Equipment Purchase/Repair,74701,Repairs to Equipment 1,Equipment Purchase/Repair,Customize Existing,Expense,,Per Customer, +66710 Inventory - Software,75301,Restaurant Software Fees 1,Inventory - Software,Customize Existing,Expense,,Per Customer, +66720 POS Annual Fees,75302,Restaurant Software Fees 2,POS Annual Fees,Customize Existing,Expense,,Per Customer, +66750 Reservation Software,75303,Restaurant Software Fees 3,Reservation Software,Customize Existing,Expense,,Per Customer, +66770 Computer Software/Hardware,75304,Restaurant Software Fees 4,Computer Software/Hardware,Customize Existing,Expense,,Per Customer, +66780 Caterease Software,75305,Restaurant Software Fees 5,Caterease Software,Customize Existing,Expense,,Per Customer, +67410 Transportation,91301,Travel 1,Transportation,Customize Existing,Expense,,Per Customer, +67430 Meals / Entertainment,91302,Travel 2,Travel Meals,Customize Existing,Expense,,Per Customer, +67440 Parking,91303,Travel 3,Parking,Customize Existing,Expense,,Per Customer, +69200 NSG Contracted Staff,62001,BOH Payroll 1,NSG Contracted Staff,Customize Existing,Expense,,Per Customer, +69400 Reimbursements for Managers,73181,Employee Mileage Reimbursements 1,Reimbursements for Managers,Customize Existing,Expense,,Per Customer, +69850 Training / Continued Education,73501,Employee Training 1,Training / Continued Education,Customize Existing,Expense,,Per Customer, +69720 State Payroll Taxes,69802,Other Payroll Taxes 2,State Payroll Taxes,Customize Existing,Expense,,Per Customer, +68050 Interest on 2448 P1cashflow75K,93401,Interest Expense 1,Interest on 2448 P1cashflow75K,Customize Existing,Expense,,Per Customer, +68100 Interest on 7793 300K P1 Loan,93402,Interest Expense 2,Interest on 7793 300K P1 Loan,Customize Existing,Expense,,Per Customer, +68150 Interest on 7183UBOC P1Loan 28K,93403,Interest Expense 3,Interest on 7183UBOC P1Loan 28K,Customize Existing,Expense,,Per Customer, +68300 Interest on 1838 P2 100k refi,93404,Interest Expense 4,Interest on 1838 P2 100k refi,Customize Existing,Expense,,Per Customer, +68400 Interest on 6712 Const P2 72k,93405,Interest Expense 5,Interest on 6712 Const P2 72k,Customize Existing,Expense,,Per Customer, +71400 Interest Expense on TH Loan,93406,Interest Expense on TH Loan,erest Expense on TH Loan,Customize Existing,Expense,,Per Customer, +71500 Interest PWL Loan,93407,Interest Expense 7,erest PWL Loan,Customize Existing,Expense,,Per Customer, +71600 Interest Expense PWL Loan (SCC),93408,Interest Expense 8,erest Expense PWL Loan (SCC),Customize Existing,Expense,,Per Customer, +71650 Interest on 500K Loan(SCC),93409,Interest Expense 9,erest on 500K Loan(SCC),Customize Existing,Expense,,Per Customer, +71700 Interest Expense on NDR Loan,93411,Interest Expense 11,erest Expense on NDR Loan,Customize Existing,Expense,,Per Customer, +77420 Interest on 300K,93412,Interest Expense 12,Interest on 300K,Customize Existing,Expense,,Per Customer, +77440 Interest Expense 850K Loan,93413,Interest Expense 13,Interest Expense 850K Loan,Customize Existing,Expense,,Per Customer, +40600 Doordash Comps - NEW,48201,Food App Sales 1,Doordash Comps - NEW,Customize Existing,Revenue,,Per Customer, +41021 Sake Sales Draft,45301,Sake Sales 1,Sake Sales Draft,Customize Existing,Revenue,,Per Customer, +41022 Sake Sales Bottle,45302,Sake Sales 2,Sake Sales Bottle,Customize Existing,Revenue,,Per Customer, +41055 SakeBombs & Specials,44201,Beer Sales 1,SakeBombs & Specials,Customize Existing,Revenue,,Per Customer, +44600 Cash Reward Income,49701,Non-Business Income 1,Cash Reward Income,Customize Existing,Revenue,,Per Customer, +21120 Loan from Nance Danner Rocha,28050,Notes Payable 5,Loan from Nance Danner Rocha,Customize Existing,Liability,,, +21130 Loan from Trivium Holdings LLC,28060,Notes Payable 6,Loan from Trivium Holdings LLC,Customize Existing,Liability,,, +21140 Payable to SCC:Construction Loan From SCC 500K,28070,Notes Payable 7,Loan from SCCB - Construction (500K),Customize Existing,Liability,,, +62300 China/Flatware/Utensils <$500,71221,Dining Room Supplies - Reuseable 1,China/Flatware/Utensils <$500,Customize Existing,Liability,,Per Customer, +69710 Federal Payroll Taxes,69801,Other Payroll Taxes 1,Federal Payroll Taxes,Customize Existing,Liability,,, +15710 Loan Temporary,16501,Other intangible 1,Loan Temporary,Customize Existing,Asset,,, +16000 CUP Amendment,16502,Other intangible 2,CUP Amendment,Customize Existing,Asset,,, +21000 Loan from PWL,28010,Notes Payable 1,Loan from PWL - Bills,Customize Existing,Liability,,, +21010 Loan from PWL:Short term Loan-Construction,28020,Notes Payable 2,Loan from PWL - Construction,Customize Existing,Liability,,, +21100 Payable to SCC,28030,Notes Payable 3,Loan from SCCB (500K),Customize Existing,Liability,,, +21110 Payable to SCC:Loan From SCC 600K,28040,Notes Payable 4,Loan from SCCB (600K),Customize Existing,Liability,,, +21150 Payable to SCC:Construction Loan SCC 300K,28080,Notes Payable 8,Loan from SCCB - Construction (300K),Customize Existing,Liability,,, +21250 Deferred Revenue-Habitec Credit,12201,AR 1,Deferred Revenue-Habitec Credit,Customize Existing,Asset,,, +21544 Loan from PWL:28K Loan,28090,Notes Payable 9,PWL 28 K Loan,Customize Existing,Liability,,, +21005 Loan from PWL:Short term Loan-Bills,28010,Notes Payable 1,Loan from PWL - Bills,Customize Existing,Liability,,, +21020 Loan from PWL:Principal amount PWL Loan,28010,Notes Payable 1,Loan from PWL - Bills,Customize Existing,Liability,,, +21025 Loan from PWL:Interest amount PWL Loan,28010,Notes Payable 1,Loan from PWL - Bills,Customize Existing,Liability,,, +21105 Payable to SCC:Accrued Interest- 500K Loan,28030,Notes Payable 3,Loan from SCCB (500K),Customize Existing,Liability,,, +21111 Payable to SCC:Loan From SCC 600K:Principal amount 600K,28040,Notes Payable 4,Loan from SCCB (600K),Customize Existing,Liability,,, +21112 Payable to SCC:Loan From SCC 600K:Interest amount 600K,28040,Notes Payable 4,Loan from SCCB (600K),Customize Existing,Liability,,, +21113 Payable to SCC:Loan From SCC 600K:Accrued Interest on 850K Loan,28040,Notes Payable 4,Loan from SCCB (600K),Customize Existing,Liability,,, +21122 Loan from Nance Danner Rocha:Principal amount NDR Loan,28050,Notes Payable 5,Loan from Nance Danner Rocha,Customize Existing,Liability,,, +21125 Loan from Nance Danner Rocha:Accrued Interest NDR loan,28050,Notes Payable 5,Loan from Nance Danner Rocha,Customize Existing,Liability,,, +21132 Loan from Trivium Holdings LLC:Principal amount THL Loan,28060,Notes Payable 6,Loan from Trivium Holdings LLC,Customize Existing,Liability,,, +21135 Loan from Trivium Holdings LLC:Accrued Interest THL loan,28060,Notes Payable 6,Loan from Trivium Holdings LLC,Customize Existing,Liability,,, +21142 Payable to SCC:Construction Loan From SCC 500K:Principal amount 500K,28070,Notes Payable 7,Loan from SCCB - Construction (500K),Customize Existing,Liability,,, +21145 Payable to SCC:Construction Loan From SCC 500K:Accrued Interest 500K,28070,Notes Payable 7,Loan from SCCB - Construction (500K),Customize Existing,Liability,,, +21152 Payable to SCC:Construction Loan SCC 300K:Principal amount 300K,28080,Notes Payable 8,Loan from SCCB - Construction (300K),Customize Existing,Liability,,, +21155 Payable to SCC:Construction Loan SCC 300K:Accrued Interest on 300K,28080,Notes Payable 8,Loan from SCCB - Construction (300K),Customize Existing,Liability,,, +21545 Loan from PWL:28K Loan:Interest on 28K loan,28090,Notes Payable 9,PWL 28 K Loan,Customize Existing,Liability,,, +67700 Management Cost,81350,% of Sales Management Fee,Management Fee,Add Custom Account,Expense,,Hidden By Default, +67710 Management - DOPS,81351,% of Sales Management Fee 1,Management - DOPS,Add Custom Account,Expense,,Per Customer, +67720 Management - DOPS Bonus,81352,% of Sales Management Fee 2,Management - DOPS Bonus,Add Custom Account,Expense,,Per Customer, +67730 Management - DOCE,81353,% of Sales Management Fee 3,Management - DOCE,Add Custom Account,Expense,,Per Customer, +67740 Management - DOCE Bonus,81354,% of Sales Management Fee 4,Management - DOCE Bonus,Add Custom Account,Expense,,Per Customer, +67800 Management Fees,81355,% of Sales Management Fee 5,Management Fees,Add Custom Account,Expense,,Per Customer, \ No newline at end of file diff --git a/resources/account customizations/SCSJ.numbers b/resources/account customizations/SCSJ.numbers new file mode 100755 index 00000000..c7bd9713 Binary files /dev/null and b/resources/account customizations/SCSJ.numbers differ diff --git a/src/clj/auto_ap/datomic/migrate.clj b/src/clj/auto_ap/datomic/migrate.clj index 65697c84..5704a741 100644 --- a/src/clj/auto_ap/datomic/migrate.clj +++ b/src/clj/auto_ap/datomic/migrate.clj @@ -278,7 +278,11 @@ :db/valueType :db.type/boolean :db/cardinality :db.cardinality/one}]] :depends-on [:auto-ap/add-manager-schema]} - :auto-ap/migrate-include-in-reports {:txes-fn `add-include-in-reports :depends-on [:auto-ap/add-include-in-reports1] }} + :auto-ap/migrate-include-in-reports {:txes-fn `add-include-in-reports :depends-on [:auto-ap/add-include-in-reports1] } + :auto-ap/add-forecasted-transaction-match {:txes [[{:db/ident :transaction/forecast-match + :db/doc "Which forecast this transaction matches, for cashflow" + :db/valueType :db.type/ref + :db/cardinality :db.cardinality/one}]]}} ] (println "Conforming database...") (c/ensure-conforms conn norms-map) diff --git a/src/clj/auto_ap/datomic/transactions.clj b/src/clj/auto_ap/datomic/transactions.clj index 23300196..92b92649 100644 --- a/src/clj/auto_ap/datomic/transactions.clj +++ b/src/clj/auto_ap/datomic/transactions.clj @@ -126,6 +126,7 @@ (let [results (->> (d/pull-many db '[* {:transaction/client [:client/name :db/id :client/code] :transaction/approval-status [:db/ident :db/id] :transaction/bank-account [:bank-account/name :bank-account/code :bank-account/yodlee-account-id :db/id :bank-account/locations] + :transaction/forecast-match [:db/id :forecasted-transaction/identifier] :transaction/vendor [:db/id :vendor/name] :transaction/matched-rule [:db/id :transaction-rule/note] :transaction/accounts [:transaction-account/amount diff --git a/src/clj/auto_ap/graphql.clj b/src/clj/auto_ap/graphql.clj index 28525682..45360955 100644 --- a/src/clj/auto_ap/graphql.clj +++ b/src/clj/auto_ap/graphql.clj @@ -208,11 +208,14 @@ :yodlee_id {:type 'String} :name {:type 'String}}} + :forecast_match {:fields {:id {:type :id} + :identifier {:type 'String}}} :transaction {:fields {:id {:type :id} :amount {:type 'String} :description_original {:type 'String} :description_simple {:type 'String} :location {:type 'String} + :forecast_match {:type :forecast_match} :status {:type 'String} :yodlee_merchant {:type :yodlee_merchant} :client {:type :client} @@ -355,6 +358,7 @@ }} :upcoming_transaction {:fields {:amount {:type :money} + :identifier {:type 'String} :date {:type :iso_date}}} :cash_flow_result {:fields {:beginning_balance {:type :money} @@ -633,6 +637,7 @@ :edit_transaction {:fields {:id {:type :id} :vendor_id {:type :id} + :forecast_match {:type :id} :approval_status {:type :transaction_approval_status} :accounts {:type '(list :edit_expense_account)}}} @@ -919,7 +924,7 @@ (defn get-cash-flow [context {:keys [client_id]} value] (when client_id - (let [{:client/keys [weekly-credits weekly-debits ]} (d/pull (d/db (d/connect uri)) '[*] client_id ) + (let [{:client/keys [weekly-credits weekly-debits forecasted-transactions ]} (d/pull (d/db (d/connect uri)) '[*] client_id ) total-cash (reduce (fn [total [credit debit]] (- (+ total credit) @@ -953,23 +958,35 @@ '(or [?p :payment/type :payment-type/debit] [?p :payment/type :payment-type/check])]} - :args [(d/db (d/connect uri)) client_id (coerce/to-date (t/plus (auto-ap.time/local-now) (t/days 31)))]})))] + :args [(d/db (d/connect uri)) client_id (coerce/to-date (t/plus (time/local-now) (t/days 31)))]}))) + forecasted-transactions (->> forecasted-transactions + (filter (fn [{:forecasted-transaction/keys [day-of-month]}] + (>= day-of-month (t/day (time/local-now))))) + (mapv (fn [{:forecasted-transaction/keys [amount identifier day-of-month]}] + {:identifier identifier + :amount amount + :date (coerce/to-date-time (t/local-date (t/year (time/local-now)) (t/month (time/local-now)) day-of-month ))} + )))] {:beginning_balance total-cash :outstanding_payments outstanding-checks :invoices_due_soon (mapv (fn [[due outstanding]] {:due (coerce/to-date-time due) :outstanding_balance outstanding}) bills-due-soon) - :upcoming_credits (mapv - (fn [date] - {:amount (or weekly-credits 0) - :date (coerce/to-date-time date)}) - (take 5 (auto-ap.time/day-of-week-seq 1))) - :upcoming_debits (mapv - (fn [date] - {:amount (- (or weekly-debits 0)) - :date (coerce/to-date-time date)}) - (take 5 (auto-ap.time/day-of-week-seq 1)))}))) + :upcoming_credits (into (mapv + (fn [date] + {:amount (or weekly-credits 0) + :date (coerce/to-date-time date)}) + (take 5 (time/day-of-week-seq 1))) + (filter #(>= (:amount %) 0) forecasted-transactions)) + :upcoming_debits (doto (into (mapv + (fn [date] + {:amount (- (or weekly-debits 0)) + :date (coerce/to-date-time date)}) + (take 5 (time/day-of-week-seq 1))) + (filter #(< (:amount %) 0) forecasted-transactions)) + println) + }))) (def schema (-> integreat-schema diff --git a/src/clj/auto_ap/graphql/transactions.clj b/src/clj/auto_ap/graphql/transactions.clj index aded1ddd..a32a8c23 100644 --- a/src/clj/auto_ap/graphql/transactions.clj +++ b/src/clj/auto_ap/graphql/transactions.clj @@ -58,7 +58,7 @@ set)] (set/difference existing-ids specified-ids))) -(defn edit-transaction [context {{:keys [id accounts vendor_id approval_status] :as transaction} :transaction} value] +(defn edit-transaction [context {{:keys [id accounts vendor_id approval_status forecast_match] :as transaction} :transaction} value] (let [existing-transaction (d-transactions/get-by-id id) _ (assert-can-see-client (:id context) (:transaction/client existing-transaction) ) deleted (deleted-accounts existing-transaction accounts) @@ -80,17 +80,28 @@ (throw (ex-info (str "Location '" (str/join ", " missing-locations) "' not found on client.") {})) ) @(d/transact (d/connect uri) - (concat [(remove-nils {:db/id id - :transaction/vendor vendor_id - :transaction/approval-status (some->> approval_status - name - snake->kebab - (keyword "transaction-approval-status")) - :transaction/accounts (map transaction-account->entity accounts) - })] - (map (fn [d] - [:db/retract id :transaction/accounts d]) - deleted))) + (doto (concat [(remove-nils {:db/id id + :transaction/vendor vendor_id + :transaction/approval-status (some->> approval_status + name + snake->kebab + (keyword "transaction-approval-status")) + :transaction/accounts (map transaction-account->entity accounts) + }) + ] + (cond forecast_match + [[:db/add id :transaction/forecast-match forecast_match]] + + (:db/id (:transaction/forecast-match existing-transaction)) + [[:db/retract id :transaction/forecast-match (:db/id (:transaction/forecast-match existing-transaction))]] + + :else + []) + + (map (fn [d] + [:db/retract id :transaction/accounts d]) + deleted)) + clojure.pprint/pprint)) (-> (d-transactions/get-by-id id) approval-status->graphql ->graphql))) diff --git a/src/clj/auto_ap/parse/templates.clj b/src/clj/auto_ap/parse/templates.clj index 48171244..eb0d378c 100644 --- a/src/clj/auto_ap/parse/templates.clj +++ b/src/clj/auto_ap/parse/templates.clj @@ -174,6 +174,15 @@ :multi #"\n" :multi-match? #"^\s+.*?\d{6,}.*?\$"} + {:vendor "General Produce Company" + :keywords [#"generalproduce.com"] + :extract {:date #"INVOICE DATE.*\n.*?([0-9]+/[0-9]+/[0-9]+)" + :customer-identifier #"SHIP TO.*\n.*\n\s+(.*?)\s{2,}" + :invoice-number #"INVOICE NO.*\n.*?(\d{7,}?)\s+" + :total #"TOTAL\s+([\-0-9,]+\.[0-9]+)"} + :parser {:date [:clj-time "MM/dd/yy"] + :total [:trim-commas-and-negate nil]}} + ;; Young's Market Co new statement {:vendor "Youngs Market" :keywords [#"(YOUNG'S MARKET COMPANY|Young.*Statement)"] diff --git a/src/clj/auto_ap/routes/invoices.clj b/src/clj/auto_ap/routes/invoices.clj index 45cee686..129081ec 100644 --- a/src/clj/auto_ap/routes/invoices.clj +++ b/src/clj/auto_ap/routes/invoices.clj @@ -329,7 +329,7 @@ :errors (map #(dissoc % :date) error-rows)}) :headers {"Content-Type" "application/edn"}}) (catch Exception e - (println (.toString e)) + (println e) {:status 500 :body (pr-str {:message (.getMessage e) :error (.toString e) diff --git a/src/clj/auto_ap/rule_matching.clj b/src/clj/auto_ap/rule_matching.clj index 91eaed6b..4dea14dc 100644 --- a/src/clj/auto_ap/rule_matching.clj +++ b/src/clj/auto_ap/rule_matching.clj @@ -97,23 +97,23 @@ (defn apply-rule [transaction rule valid-locations] (with-precision 2 (let [accounts (vec (mapcat - (fn [tra] - (if (= "Shared" (:transaction-rule-account/location tra)) - (map - (fn [location] - {:transaction-account/account (:db/id (:transaction-rule-account/account tra)) - :transaction-account/amount (Math/abs (* (/ 1.0 (count valid-locations)) - (:transaction-rule-account/percentage tra) - (:transaction/amount transaction))) - :transaction-account/location location}) + (fn [tra] + (if (= "Shared" (:transaction-rule-account/location tra)) + (map + (fn [location] + {:transaction-account/account (:db/id (:transaction-rule-account/account tra)) + :transaction-account/amount (Math/abs (* (/ 1.0 (count valid-locations)) + (:transaction-rule-account/percentage tra) + (:transaction/amount transaction))) + :transaction-account/location location}) - valid-locations) - [(cond-> {:transaction-account/account (:db/id (:transaction-rule-account/account tra)) - :transaction-account/amount (Math/abs (* (:transaction-rule-account/percentage tra) - (:transaction/amount transaction)))} - (:transaction-rule-account/location tra) (assoc :transaction-account/location (:transaction-rule-account/location tra)))])) - (:transaction-rule/accounts rule))) + valid-locations) + [(cond-> {:transaction-account/account (:db/id (:transaction-rule-account/account tra)) + :transaction-account/amount (Math/abs (* (:transaction-rule-account/percentage tra) + (:transaction/amount transaction)))} + (:transaction-rule-account/location tra) (assoc :transaction-account/location (:transaction-rule-account/location tra)))])) + (filter (comp seq :transaction-rule-account/account) (:transaction-rule/accounts rule)))) accounts (mapv (fn [a] (update a :transaction-account/amount @@ -123,7 +123,9 @@ leftover (with-precision 2 (.round (bigdec (- (Math/abs (:transaction/amount transaction)) (Math/abs (reduce + 0.0 (map #(:transaction-account/amount %) accounts))))) *math-context*)) - accounts (update-in accounts [(dec (count accounts)) :transaction-account/amount] #(+ % (double leftover)))] + accounts (if (seq accounts) + (update-in accounts [(dec (count accounts)) :transaction-account/amount] #(+ % (double leftover))) + [])] (assoc transaction :transaction/matched-rule (:db/id rule) :transaction/approval-status (:transaction-rule/transaction-approval-status rule) diff --git a/src/clj/auto_ap/time.clj b/src/clj/auto_ap/time.clj index 0a104ab4..6b9987c8 100644 --- a/src/clj/auto_ap/time.clj +++ b/src/clj/auto_ap/time.clj @@ -23,7 +23,7 @@ (defn day-of-week-seq [day] - (let [next-day (loop [d (auto-ap.time/local-now)] + (let [next-day (loop [d (local-now)] (if (= (time/day-of-week d) day) d (recur (time/plus d (time/days 1)))))] diff --git a/src/clj/auto_ap/yodlee/import.clj b/src/clj/auto_ap/yodlee/import.clj index 0f62c4a7..940ec017 100644 --- a/src/clj/auto_ap/yodlee/import.clj +++ b/src/clj/auto_ap/yodlee/import.clj @@ -141,7 +141,7 @@ (mapcat (fn [client] (->> client :client/bank-accounts - (filter :bank-account/yodlee-account-id) + #_(filter :bank-account/yodlee-account-id) (filter :db/id) (map (fn [{:keys [:db/id :bank-account/yodlee-account-id] :as bank-account}] (assoc bank-account @@ -168,8 +168,9 @@ all-bank-accounts (by :db/id (get-all-bank-accounts)) transaction->bank-account (comp all-bank-accounts :bank-account-id)] (println "importing manual transactions" transformed-transactions) - (batch-transact - (transactions->txs transformed-transactions transaction->bank-account (rm/rule-applying-fn all-rules) (get-existing))))) + (let [result (batch-transact + (transactions->txs transformed-transactions transaction->bank-account (rm/rule-applying-fn all-rules) (get-existing)))] + (println "imported " (count result))))) (defn do-import ([] diff --git a/src/clj/user.clj b/src/clj/user.clj index 361f7a43..7e23da63 100644 --- a/src/clj/user.clj +++ b/src/clj/user.clj @@ -201,14 +201,29 @@ :where ['[?e :account/name]]} :args [(d/db conn)]}))) + + + _ (if-let [bad-rows (seq (->> rows + (group-by (fn [[_ account]] + account)) + vals + (filter #(> (count %) 1)) + (filter (fn [duplicates] + (apply not= (map rest duplicates)))) + #_(map (fn [[[_ account]]] + account)) + ))] + (throw (Exception. (str "These accounts are duplicated:" (str bad-rows))))) + rows (vec (set (map rest rows))) + txes (transduce (comp - (filter (fn [[_ account _ override-name]] + (filter (fn [[account _ override-name]] (and (not (str/blank? override-name)) (not (str/blank? account))))) - (map (fn parse-map [[_ account account-name override-name _ type]] + (map (fn parse-map [[account account-name override-name _ type]] (let [code (Integer/parseInt account) existing-id (:db/id (code->existing-account code))] (cond-> {:account/client-overrides [{:account-client-override/client client-id @@ -219,11 +234,15 @@ :account/account-set "default" :account/numeric-code code :account/code (str code) - :account/type (keyword "account-type" (str/lower-case type)))))))) + :account/type (if (str/blank? type) + :account-type/expense + (keyword "account-type" (str/lower-case type))))))))) conj [] rows)] + + #_txes @(d/transact conn txes))) diff --git a/src/cljc/auto_ap/entities/transaction_rule.cljc b/src/cljc/auto_ap/entities/transaction_rule.cljc index 6fbf283a..6ba3281a 100644 --- a/src/cljc/auto_ap/entities/transaction_rule.cljc +++ b/src/cljc/auto_ap/entities/transaction_rule.cljc @@ -1,5 +1,6 @@ (ns auto-ap.entities.transaction-rule - (:require [clojure.spec.alpha :as s] + (:require [auto-ap.entities.transaction-rule-account :as transaction-rule-account] + [clojure.spec.alpha :as s] [clojure.string :as str])) (s/def ::client (s/nilable map?)) @@ -12,6 +13,7 @@ (s/def ::bank-account (s/nilable map?)) (s/def ::vendor (s/nilable map?)) (s/def ::yodlee-merchant (s/nilable map?)) +(s/def ::accounts (s/coll-of ::transaction-rule-account/transaction-rule-account :min-count 1)) (s/def ::transaction-rule (s/and (s/keys :req-un [::client ::description @@ -21,7 +23,8 @@ ::dom-lte ::note ::bank-account - ::vendor] + ::vendor + ::accounts] :opt-un [::yodlee-merchant]) (s/or :description-required #(not (str/blank? (:description %))) diff --git a/src/cljc/auto_ap/entities/transaction_rule_account.cljc b/src/cljc/auto_ap/entities/transaction_rule_account.cljc new file mode 100644 index 00000000..781e94ae --- /dev/null +++ b/src/cljc/auto_ap/entities/transaction_rule_account.cljc @@ -0,0 +1,10 @@ +(ns auto-ap.entities.transaction-rule-account + (:require [clojure.spec.alpha :as s] + [clojure.string :as str])) + + + +(s/def ::account map?) + +(s/def ::transaction-rule-account (s/keys :req-un [::account] + :opt-un [])) diff --git a/src/cljs/auto_ap/events.cljs b/src/cljs/auto_ap/events.cljs index c276f33c..81b62267 100644 --- a/src/cljs/auto_ap/events.cljs +++ b/src/cljs/auto_ap/events.cljs @@ -77,7 +77,7 @@ [:bank-accounts [:id :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id :locations :include-in-reports] ] [:forecasted-transactions [:id :amount :identifier :day-of-month]]]] [:vendor - [:id :name :hidden [:default-account [:name :id :location]] [:primary-contact [:name :phone :email :id]] [:secondary-contact [:id :name :phone :email]] :print-as :invoice-reminder-schedule :code]] + vendor-query] [:accounts [:numeric-code :name :location :type :account_set :applicability :id [:client-overrides [:name [:client [:name :id]]]]]]]} :on-success [::received-initial]} diff --git a/src/cljs/auto_ap/subs.cljs b/src/cljs/auto_ap/subs.cljs index 804ecb80..c9769cff 100644 --- a/src/cljs/auto_ap/subs.cljs +++ b/src/cljs/auto_ap/subs.cljs @@ -118,6 +118,11 @@ (fn [db [_ client]] (:locations (get (:clients db) (or client (:client db)))))) +(re-frame/reg-sub + ::forecasted-transactions-for-client + (fn [db [_ client]] + (:forecasted-transactions (get (:clients db) (or client (:client db)))))) + (re-frame/reg-sub ::locations-for-client-or-bank-account (fn [db [_ client-id bank-account-id]] @@ -180,7 +185,7 @@ ::vendor-default-account (fn [db [_ v client]] (let [accounts (accounts-by-id (:accounts db) client) - vendor (if (:default-account v) + vendor (if (map? v) v (-> (:vendors db) (get v))) client-override (->> (:account-overrides vendor) diff --git a/src/cljs/auto_ap/views/components/invoice_table.cljs b/src/cljs/auto_ap/views/components/invoice_table.cljs index 46880794..7ff4e79b 100644 --- a/src/cljs/auto_ap/views/components/invoice_table.cljs +++ b/src/cljs/auto_ap/views/components/invoice_table.cljs @@ -203,7 +203,7 @@ [sort-by-list {:sort sort :on-change opc}]] [:div.level-item - "Outstanding" (nf outstanding)]]] + "Outstanding " (nf outstanding)]]] (doall (for [invoices invoice-groups] ^{:key (:id (first invoices))} diff --git a/src/cljs/auto_ap/views/pages/transactions/common.cljs b/src/cljs/auto_ap/views/pages/transactions/common.cljs index 0e35470d..8b60c3a7 100644 --- a/src/cljs/auto_ap/views/pages/transactions/common.cljs +++ b/src/cljs/auto_ap/views/pages/transactions/common.cljs @@ -11,6 +11,7 @@ :date [:yodlee_merchant [:name :yodlee-id :id]] :post_date + [:forecast-match [:id :identifier]] :status :description_original [:payment [:check_number :s3_url]] diff --git a/src/cljs/auto_ap/views/pages/transactions/form.cljs b/src/cljs/auto_ap/views/pages/transactions/form.cljs index 3a73de42..03861870 100644 --- a/src/cljs/auto_ap/views/pages/transactions/form.cljs +++ b/src/cljs/auto_ap/views/pages/transactions/form.cljs @@ -15,7 +15,7 @@ (re-frame/reg-sub ::submit-query :<- [::forms/form ::form] - (fn [{{:keys [id vendor accounts approval-status]} :data}] + (fn [{{:keys [id vendor accounts approval-status forecast-match]} :data}] {:venia/operation {:operation/type :mutation :operation/name "EditTransaction"} :venia/queries [{:query/data @@ -23,6 +23,7 @@ {:transaction {:id id :vendor-id (:id vendor) :approval-status approval-status + :forecast-match (:id forecast-match) :accounts (map (fn [{:keys [id account amount location]}] {:id (when-not (str/starts-with? id "new-") @@ -51,6 +52,7 @@ (-> which (select-keys [:vendor :amount :payment :client :description-original :yodlee-merchant :id :potential-payment-matches + :forecast-match :location :accounts :approval-status :matched-rule]) (assoc :original-status (:approval-status which)) @@ -262,6 +264,12 @@ [:excluded "Excluded from Ledger"]] :disabled should-disable-for-client?}]] + [field "Forecasted-transaction" + [typeahead-entity {:matches (doto @(re-frame/subscribe [::subs/forecasted-transactions-for-client (:id (:client data))]) println) + :match->text :identifier + :type "typeahead-entity" + :field [:forecast-match]}]] + [:hr] [error-notification]