Skip to content

Crud invoice - #2558

Merged
jmilljr24 merged 30 commits into
mainfrom
crud-invoice
Sep 25, 2026
Merged

jmilljr24 merged 30 commits into
mainfrom
crud-invoice

Conversation

@jmilljr24

@jmilljr24 jmilljr24 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes [link an issue or remove this line]

What is the goal of this PR and why is this important?

Stakeholders require creating one off invoices. Adding db backed invoices allows CRUD and give the ability to import fm data if required.

How did you approach the change?

UI Testing Checklist

Anything else to add?

@jmilljr24
jmilljr24 requested a review from maebeale September 23, 2026 22:48
Comment thread app/controllers/addresses_controller.rb Outdated
Comment thread app/frontend/javascript/controllers/index.js Outdated
Comment thread app/models/invoice.rb Outdated
Comment thread app/presenters/invoice_presenter.rb
class InvoicePresenter
ISSUER_NAME = "A Window Between Worlds".freeze
ISSUER_ADDRESS_LINES = [ "1029 1/2 W 24th St", "Los Angeles, CA 90007" ].freeze
ISSUER_EMAIL = "info@awbw.org".freeze

@maebeale maebeale Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to use our env var here? and why info@ vs programs@ ?

also think this should be env var. i worry about emails in code esp in botlandia.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the best email? Trainings said they do invoices for materials, is that programs or something else?

This was all copied for event_invoice presenter. I probably could have extracted that one and created some shared code but I didn't want to break anything with the event specific stuff. Worth a new issue to consider some shared env's or anything else that has crossover between the dynamic invoices vs db backed.

class EventInvoice
  ISSUER_NAME = "A Window Between Worlds".freeze
  ISSUER_ADDRESS_LINES = [ "1029 1/2 W 24th St", "Los Angeles, CA 90007" ].freeze
  ISSUER_EMAIL = "info@awbw.org".freeze
  PAYABLE_TO_NOTE = "Please make checks payable to A Window Between Worlds".freeze

Thoughts? I wouldn't love calling the constant from EventInvoice in this invoice presenter but I do agree on not duplicating it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmilljr24 they've worked it out internally to have everything route to one system email and forward as appropriate. my vote/request is we stick w that bc we already said supporting multiple emails is a feature request.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You lost me on this one. Are you saying EventInvoice is wrong and needs to be updated as well? The screenshot of christy's current invoice uses info fyi. I have no stake in this game, I just don't understand the correlation to supporting multiple emails feature request. This is just displayed on the invoice - not connected our outgoing email system in the app.

Use info or use programs? Should I ask in Christy's thread?

@maebeale maebeale Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my vote was keep to same as the one email we service, bc next feature request will be to email the invoice.
yes, happy to have you ask in christy's thread. or, to just go w info@.
whichever email tho, i'm trying to avoid emails/contact info being in OSS code bc it'll increase spam to them and increase hack options.

Comment thread app/presenters/invoice_presenter.rb
Comment thread app/presenters/invoice_presenter.rb Outdated
Comment thread app/views/invoices/_actions.html.erb
Comment thread db/schema.rb
Comment thread app/controllers/addresses_controller.rb Outdated
skip_before_action :preload_current_user_associations, raise: false
skip_verify_authorized

def lookup

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not support a dropdown select rather than only allowing access to one org address?

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context, my though process on this whole feature was to try and keep it bare bones and lower the risking of having to make revisions if we make it over complex or lock fields in before any user feedback.

For the address section of the invoice, I wanted to keep it as a text field because there is a good possibility they want to add to/adjust this info. Normally I would want a real db association but for address I can't see any time soon where we need to know the address record associated with an invoice. The person/organization is important so I kept those fields via id.

It's certainly possible and not a huge lift to 1. check the selected invoicee 2. insert a address dropdown 3. on select of address fill in text field.

It's just getting to in the weeds when they can simply just type an address if different than the primary especially if they are not doing this every single day. Or take the primary and add extra info after if if the invoicee needs it for their records. I little work on there end is ok until it becomes a big problem was my thinking.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have AWBW as an org and all orgs have multiple addresses. then we get out of contact info in code or them writing text here that isn't saved in their db. but, i'm fine w us going w what you've done.

<% content_for(:page_title, "Edit Invoice") %>
<% content_for(:page_bg_class, "admin-only bg-blue-100") %>

<div class="mx-auto max-w-3xl">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would love for there to be a card for page content. happy to do as follow-on later.

<% end %>
</div>

<table class="w-full text-sm">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would love for there to be a card for table content. happy to do as follow-on later to make it look like the other indexes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure! I left ui bare bones. I want to just get the functionally so we can check the box for moving off filemaker features.

@maebeale maebeale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty for hopping on this one!

@maebeale

Copy link
Copy Markdown
Collaborator

i can run a features.yml update after we merge this.

@jmilljr24
jmilljr24 merged commit 16b5abb into main Sep 25, 2026
3 checks passed
@jmilljr24
jmilljr24 deleted the crud-invoice branch September 25, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants