Making WordPress.org

Opened 10 years ago

Closed 9 years ago

#790 closed enhancement (fixed)

Add Sponsor Invoices Post Type to WordCamp Payments Plugin

Reported by: iandunn's profile iandunn Owned by: iandunn's profile iandunn
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: good-first-bug
Cc:

Description

Right now information on sponsor invoices is tracked in various spreadsheets, but it'd be better to track them in a central location and be able to run reports on them.

It will essentially be the same functionality as the WordCamp Payments and WordCamp Payments Dashboard plugins provide for vendor payments, just with a different set of fields.

https://wordpress.slack.com/archives/community/p1418060022000025

Attachments (1)

790_basic_invoice.diff (12.0 KB) - added by utkarshd_42 10 years ago.
A basic custom post type for sponsor invoices

Download all attachments as: .zip

Change History (10)

#1 @utkarshd_42
10 years ago

@iandunn Can you please specify what different sets of fields would be required?

#2 @iandunn
10 years ago

Some of these will probably change a bit, but this is the gist of it:

  • Contact Name
  • Contact E-mail Address - html5 type="email"
  • Company Name
  • Type of Sponsorship - dropdown "Money", "In-Kind Donation", "Other"
  • Notes - textarea
  • Sponsorship Level
  • Published Blog Post - checkbox
  • Published Logo - checkbox
  • Coupon Code
  • Check Requested - checkbox
  • Check Sent - checkbox
  • Received Amount

These are all just <input type="text"> unless otherwise specified. It'll also need custom post statuses: "Pre-Contact", "Negotiation", "Invoiced", "Received Payment", "Cancelled".

The existing Payments class has some methods for generating form fields; it'd be good to abstract those into Traits.

#3 follow-up: @bansod_deven
10 years ago

Replying to iandunn:

These are all just <input type="text"> unless otherwise specified. It'll also need custom post statuses: "Pre-Contact", "Negotiation", "Invoiced", "Received Payment", "Cancelled".

Can you please clarify a bit on how will these Post Statuses will be decided ? or will they be manually be selected from a drop down as done for post/page post types?


The existing Payments class has some methods for generating form fields; it'd be good to abstract those into Traits.

Also , the WordCamp Payments plugin gives the editing permission of paid requests to only the admins with manage_network capabilities while others can only view it. Do we require such a thing over some of these post statuses ?

#4 follow-up: @utkarshd_42
10 years ago

  • Keywords dev-feedback added

Hi,

I have made a basic custom post type for the sponsor invoice plugin (diff attached). More of a copy & paste material. Some things on which I wasn't clear about and hence not here in the diff :

  • Deciding how post statuses will be set
  • Columns, managing & rendering (on what fields to be included)
  • Status Metabox? Should we make our own like we did in payment requests
  • Informing Central about new invoices?
  • Should we make some fields readonly based on user's network management status?

Anything else left out? Feel free to comment.

Last edited 10 years ago by utkarshd_42 (previous) (diff)

@utkarshd_42
10 years ago

A basic custom post type for sponsor invoices

#5 in reply to: ↑ 3 @iandunn
10 years ago

Replying to bansod_deven:

Can you please clarify a bit on how will these Post Statuses will be decided ? or will they be manually be selected from a drop down as done for post/page post types?

I don't think there are really any triggers to automate setting the status in the same way that payment requests can be marked as paid once the payment date is entered, so for invoices the user would just select the status from a dropdown.

Also , the WordCamp Payments plugin gives the editing permission of paid requests to only the admins with manage_network capabilities while others can only view it. Do we require such a thing over some of these post statuses ?

No, I don't think that's important for sponsor invoices in the same way that is it for payment requests.

#6 in reply to: ↑ 4 @iandunn
10 years ago

Replying to utkarshd_42:

Deciding how post statuses will be set

I think comment:5 answers that, but let me know if you have any questions.

Columns, managing & rendering (on what fields to be included)

In the Network Dashboard, let's have these columns:

Company Name
Sponsorship Level
Status

Status Metabox? Should we make our own like we did in payment requests

Yeah

Informing Central about new invoices?

No, but when a new invoice is created, it would email the details to the sponsor, to ask them to send payment.

When the post is marked as paid, then it would e-mail the user who created the post, to notify them that it was paid.


Should we make some fields readonly based on user's network management status?

I think comment:5 answers that, but let me know if you have any questions.

#7 @iandunn
10 years ago

  • Keywords dev-feedback removed
  • Owner set to iandunn
  • Status changed from new to accepted

790_basic_invoice.diff looks like a good start. I think the next steps are:

  • Abstract the form input functions like render_text_input() into PHP Traits, so that they can be shared by both of the classes and the code is kept DRY. This is a significant change in-and-of-itself, so it'd be good to make a separate patch just for this.
  • Add aggregated reports for all invoices across all sites in the network, similar to what Payments has. These are done in wordcamp-payments-network. Since this is a separate plugin, it'd be good to make changes to it a separate patch than the one for work on wordcamp-payments.

This ticket was mentioned in Slack in #meta by justinsainton. View the logs.


9 years ago

#9 @iandunn
9 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 2301:

WordCamp Budgets: Add new post type for Sponsor Invoices.

Fixes #790

Note: See TracTickets for help on using tickets.