-
Notifications
You must be signed in to change notification settings - Fork 3
Seasonal income classes #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
93297a9
32e574d
10ee3a0
558d7c3
82d9a45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,66 @@ metadata: | |
| include: | ||
| - al_income.yml | ||
| --- | ||
| mandatory: True | ||
| code: | | ||
| class ALSeasonalItemizedJob(ALItemizedJobList): | ||
| """ | ||
| Attributes: | ||
| .to_add {ALItemizedValueDict} Dict of ALItemizedValues that would be added | ||
| to a job's net total, like wages and tips. | ||
| .to_subtract {ALItemizedValueDict} Dict of ALItemizedValues that would be | ||
| subtracted from a net total, like union dues or insurance premiums. | ||
| .times_per_year {float} A denominator of a year, like 12 for monthly, that | ||
| represents how frequently the income is earned | ||
| .employer {Individual} (Optional) Individual assumed to have a name and, | ||
| optionally, an address and phone. | ||
| .source {str} (Optional) The category of this item, like "public service". | ||
| """ | ||
| def init(self, *pargs, **kwargs): | ||
| super().init(*pargs, **kwargs) | ||
| self.ask_number = True | ||
| self.target_number = 12 | ||
| month_names = [ | ||
| "january", "february", "march", "april", "may", "june", | ||
| "july", "august", "september", "october", "november" | ||
| ] | ||
|
Comment on lines
+26
to
+29
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question as above. I'm just curious if this needs to be limited to chunking by month. Biweekly pay is a bit more common for most folks.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question. @CaroRob and I have been thinking about that discussion. I had hesitated to go beyond months since some seemed reluctant about getting even this granular, but if folks are open to that discussion, I am too.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think about whether limiting it to months helps achieve any of the goals. It might, but I'm not sure. I think you discussed letting people avoid math. Monthly chunking doesn't seem like it would save any math. Maybe letting users enter a date range? E.g., teachers usually have 9 month contracts, although they don't always have the choice to get paid over 9 months rather than 12.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've made it more flexible. Will wait to fully adjust the demo till I get the go-ahead. Here's a sample file that shows the most basic application (you must answer that, yes, your job is seasonal). It's .txt and you have to have to change it to .yml because GitHub won't let me upload a .yml. |
||
| for index, month_name in enumerate(month_names): | ||
| month = self.initializeObject(index, ALJob) | ||
| month.source = month_name | ||
| month.is_hourly = False | ||
| month.times_per_year = 1 | ||
|
|
||
| if not hasattr(self, "employer"): | ||
| if hasattr(self, "employer_type"): | ||
| self.initializeAttribute("employer", self.employer_type) | ||
| else: | ||
| self.initializeAttribute("employer", Individual) | ||
|
|
||
| def employer_name_address_phone(self) -> str: | ||
| """ | ||
| Returns concatenation of employer name and, if they exist, employer | ||
| address and phone number. | ||
| """ | ||
| info_list = [] | ||
| has_address = ( | ||
| hasattr(self.employer.address, "address") and self.employer.address.address | ||
| ) | ||
| has_number = ( | ||
| hasattr(self.employer, "phone_number") and self.employer.phone_number | ||
| ) | ||
| # Create a list so we can take advantage of `comma_list` instead | ||
| # of doing further fiddly list manipulation | ||
| if has_address: | ||
| info_list.append(self.employer.address.on_one_line()) | ||
| if has_number: | ||
| info_list.append(self.employer.phone_number) | ||
| # If either exist, add a colon and the appropriate strings | ||
| if has_address or has_number: | ||
| return ( | ||
| f"{ self.employer.name.full(middle='full') }: {comma_list( info_list )}" | ||
| ) | ||
| return self.employer.name.full(middle="full") | ||
| --- | ||
| comment: | | ||
| translation options: | ||
| - map dict/lookup from key to lang word. See https://github.com/nonprofittechy/docassemble-HousingCodeChecklist/blob/0cbfe02b29bbec66b8a2b925b36b3c67bb300e84/docassemble/HousingCodeChecklist/data/questions/language.yml#L41 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.