Page MenuHomePhabricator

Add a basic invoice view for printing to Phortune
ClosedPublic

Authored by chad on Oct 27 2016, 11:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 10:09 AM
Unknown Object (File)
Sun, Dec 8, 1:45 PM
Unknown Object (File)
Sun, Dec 8, 5:18 AM
Unknown Object (File)
Sat, Dec 7, 7:20 AM
Unknown Object (File)
Thu, Nov 28, 1:01 AM
Unknown Object (File)
Nov 10 2024, 12:01 AM
Unknown Object (File)
Nov 9 2024, 8:46 PM
Unknown Object (File)
Nov 9 2024, 8:43 PM
Subscribers

Details

Summary

Makes a more complete PDF looking invoice form for printing in Phortune.

Test Plan

Make an invoice, click print view, print.

Diff Detail

Repository
rP Phabricator
Branch
new-receipt
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/phortune/controller/PhortuneCartViewController.php:227XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 14279
Build 18575: Run Core Tests
Build 18574: arc lint + arc unit

Unit TestsFailed

TimeTest
109 msPhabricatorProjectCoreTestCase::Unknown Unit Message ("")
Assertion failed, expected 'true' (at PhabricatorProjectCoreTestCase.php:1118). ACTUAL VALUE
1 msAlmanacNamesTestCase::Unknown Unit Message ("")
30 assertions passed.
0 msAlmanacServiceTypeTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAphrontHTTPSinkTestCase::Unknown Unit Message ("")
2 assertions passed.
0 msAphrontHTTPSinkTestCase::Unknown Unit Message ("")
3 assertions passed.
View Full Test Results (1 Failed · 332 Passed)

Event Timeline

chad retitled this revision from to Add a basic invoice view for printing to Phortune.
chad updated this object.
chad edited the test plan for this revision. (Show Details)
chad added a reviewer: epriestley.

This looks good except for the Phacility-specific text. We can put that on the Merchant instead, like the logo/contact info.

src/applications/phortune/view/PhortuneInvoiceView.php
139–146

This can't go upstream.

src/applications/phortune/view/PhortuneInvoiceView.php
139–146

lol oops!

I mean, unless you want to offer free support for all the Korean/Japanese consulting companies apparently using Phortune to do billing.

chad edited edge metadata.
  • Add invoiceEmail and invoiceFooter
epriestley edited edge metadata.

See inline discussion about orders vs invoices. I don't think it's hugely important to resolve, but I think using the word "Invoice" on the traditional "Order" flow is a bit confusing.

src/applications/phortune/controller/PhortuneCartViewController.php
289

This isn't necessarily an invoice, exactly, per se.

For example, if you support an initiative in Fund, you also end up here, but it's vaguely confusing/misleading to call that an invoice. If we later let you buy Phabricator Gold or conference sponsorships or something, you'll probably end up here on a traditional order flow too.

You can call $cart->getIsInvoice() to get some details about the invoiciness of an order. There are currently three ways an order can be created:

  • Via a purchasing flow, like in Fund. In this case, the order is NOT marked as an invoice.
  • Via a subscription flow, like on Phacility. In this case, the order IS marked as an invoice.
  • Via the explicit invoicing flow (MerchantNew Invoice). In this case, the order IS marked as an invoice.

Better might be to use language like "Invoice Status" only for invoices, and language like "Order Status" for non-invoices?

src/applications/phortune/editor/PhortuneMerchantEditor.php
155

(This isn't a missing field error -- the field isn't required, so this isn't "Required field X is missing".)

This revision is now accepted and ready to land.Oct 30 2016, 12:21 AM
src/applications/phortune/controller/PhortuneCartViewController.php
189

We could reasonably use the word "Order" or "Invoice" (depending on invoiciness) instead of "Cart" for submitted carts, too. So the logic would be something like this:

if ($cart->getIsInvoice()) {
  // This is a paid or unpaid invoice.
  $what = 'Invoice';
}  else if ($cart->getStatus() == PhortuneCart::STATUS_READY) {
  // This is an unpaid cart on an "order" workflow which hasn't been charged yet.
  // Maybe still just call this an "Order"?
  $what = 'Cart';
} else {
  // This is a paid/charged/refunded/in-review cart on an "order" workflow, so we can safely
  // call it an "Order" now. Basically, the user clicked "Checkout" with some kind of payment method.
  $what = 'Order';
}

That might be more clear.

I think the backend treatment of these is correct (invoices, carts and orders are all really the same "thing") but it definitely defies expectation a bit on some flows to see "Cart" when you're thinking of the object as an "Invoice".

chad edited edge metadata.
  • per comments

I just put the name of the cart into the header instead of "Order Details" which was static.

This revision was automatically updated to reflect the committed changes.

LMK if I missed anything.

I'd like to fix the default file name, for one, table headers for another.

Screen Shot 2016-10-29 at 5.55.06 PM.png (90×690 px, 18 KB)