-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from kwheelan/49-reorg
49 reorg
- Loading branch information
Showing
58 changed files
with
1,238 additions
and
1,334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// temporary hard-coding | ||
export let TARGET = 10000000; | ||
|
||
// Set to equal current fiscal year | ||
export var FISCAL_YEAR = '26'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// sheets to expect on detail sheet | ||
export const SHEETS = { | ||
'FTE, Salary-Wage, & Benefits' : 'personnel' , | ||
'Overtime & Other Personnel' : 'overtime', | ||
'Non-Personnel Operating' : 'nonpersonnel', | ||
'Revenue' : 'revenue' | ||
} | ||
|
||
export const OBJ_CATEGORIES = { | ||
list : [ | ||
// 'Salaries & Wages', | ||
// 'Employee Benefits', | ||
'Professional & Contractual Services', | ||
'Operating Supplies', | ||
'Operating Services', | ||
'Equipment Acquisition', | ||
'Capital Outlays', | ||
'Fixed Charges', | ||
'Other Expenses' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './app_constants'; | ||
export * from './excel_constants'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
|
||
export const AccountString = { | ||
getNumber: function(input) { | ||
// isolate the numerical part of a appropriation/cost center/object | ||
const match = input.match(/^\d+/); | ||
return match ? match[0] : null; | ||
}, | ||
|
||
build : function(approp, cc, obj = null, fund = null) { | ||
// put together account string fund-approp-costcenter[-obj] (w optional object) | ||
if (!fund) { fund = CurrentFund.number() }; | ||
// hits error here | ||
approp = this.getNumber(approp); | ||
cc = this.getNumber(cc); | ||
var string = `${fund}-${approp}-${cc}`; | ||
string = obj ? `${string}-${this.getNumber(obj)}` : string; | ||
return string; | ||
}, | ||
|
||
getAccountStringSection : function(account_string, section) { | ||
const sections = account_string.split("-"); | ||
return sections.length > section ? sections[section] : null; | ||
}, | ||
|
||
fund : function(account_string) { | ||
return this.getAccountStringSection(account_string, 0) | ||
}, | ||
|
||
approp : function(account_string) { | ||
return this.getAccountStringSection(account_string, 1) | ||
}, | ||
|
||
costCenter : function(account_string) { | ||
return this.getAccountStringSection(account_string, 2) | ||
}, | ||
|
||
object : function(account_string) { | ||
return this.getAccountStringSection(account_string, 3) | ||
}, | ||
} | ||
|
||
export default AccountString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Fund from "./fund.js"; | ||
import FundLookupTable from "./fund_lookup_table.js"; | ||
|
||
|
||
export class Baseline { | ||
// baseline will just contain a list of funds, each with | ||
// running tallies for their budgets | ||
constructor() { | ||
const allFunds = FundLookupTable.listFunds(); | ||
this.funds = []; | ||
allFunds.forEach((fund) => { | ||
this.funds.push(new Fund(fund)); | ||
}); | ||
} | ||
|
||
personnel() { | ||
let total = 0; | ||
this.funds.forEach(fund => { | ||
total += fund.getPersonnelCost(); | ||
}); | ||
return total; | ||
} | ||
|
||
nonpersonnel() { | ||
let total = 0; | ||
this.funds.forEach(fund => { | ||
total += fund.getNonPersonnelCost(); | ||
}); | ||
return total; | ||
} | ||
|
||
revenue() { | ||
let total = 0; | ||
this.funds.forEach(fund => { | ||
total += fund.getRevenue(); | ||
}); | ||
return total; | ||
} | ||
|
||
total() { | ||
return this.nonpersonnel() + this.personnel() - this.revenue(); | ||
} | ||
} | ||
|
||
export default Baseline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
import FundLookupTable from "./fund_lookup_table"; | ||
|
||
export const CurrentFund = { | ||
update : function(fund){ | ||
localStorage.setItem('fund', fund); | ||
}, | ||
number : function(){ | ||
return localStorage.getItem("fund"); | ||
}, | ||
name : function(){ | ||
return FundLookupTable.getName( this.number()); | ||
}, | ||
reset : function() { | ||
this.update(''); | ||
} | ||
} | ||
|
||
export default CurrentFund; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { visitPage } from "../views/view_logic"; | ||
|
||
export const CurrentPage = { | ||
update : function(page){ | ||
localStorage.setItem('page_state', page); | ||
}, | ||
load : function(){ | ||
const pageState = localStorage.getItem('page_state'); | ||
return pageState !== null ? pageState : 'welcome'; | ||
}, | ||
visit : function(){ | ||
visitPage(this.load()); | ||
} | ||
} | ||
|
||
export default CurrentPage; |
Oops, something went wrong.