Differential D20733 Diff 49440 src/applications/phortune/controller/account/PhortuneAccountSubscriptionViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/controller/account/PhortuneAccountSubscriptionViewController.php
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | private function buildDueInvoices(PhortuneSubscription $subscription) { | ||||
$invoices = id(new PhortuneCartQuery()) | $invoices = id(new PhortuneCartQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withSubscriptionPHIDs(array($subscription->getPHID())) | ->withSubscriptionPHIDs(array($subscription->getPHID())) | ||||
->needPurchases(true) | ->needPurchases(true) | ||||
->withInvoices(true) | ->withInvoices(true) | ||||
->execute(); | ->execute(); | ||||
$phids = array(); | |||||
foreach ($invoices as $invoice) { | |||||
$phids[] = $invoice->getPHID(); | |||||
$phids[] = $invoice->getMerchantPHID(); | |||||
foreach ($invoice->getPurchases() as $purchase) { | |||||
$phids[] = $purchase->getPHID(); | |||||
} | |||||
} | |||||
$handles = $this->loadViewerHandles($phids); | |||||
$invoice_table = id(new PhortuneOrderTableView()) | $invoice_table = id(new PhortuneOrderTableView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setCarts($invoices) | ->setCarts($invoices) | ||||
->setIsInvoices(true) | ->setIsInvoices(true); | ||||
->setHandles($handles); | |||||
$invoice_header = id(new PHUIHeaderView()) | $invoice_header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('Invoices Due')); | ->setHeader(pht('Invoices Due')); | ||||
return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
->setHeader($invoice_header) | ->setHeader($invoice_header) | ||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
->appendChild($invoice_table); | ->appendChild($invoice_table); | ||||
Show All 12 Lines | $invoices = id(new PhortuneCartQuery()) | ||||
PhortuneCart::STATUS_CHARGED, | PhortuneCart::STATUS_CHARGED, | ||||
PhortuneCart::STATUS_HOLD, | PhortuneCart::STATUS_HOLD, | ||||
PhortuneCart::STATUS_REVIEW, | PhortuneCart::STATUS_REVIEW, | ||||
PhortuneCart::STATUS_PURCHASED, | PhortuneCart::STATUS_PURCHASED, | ||||
)) | )) | ||||
->setLimit(50) | ->setLimit(50) | ||||
->execute(); | ->execute(); | ||||
$phids = array(); | |||||
foreach ($invoices as $invoice) { | |||||
$phids[] = $invoice->getPHID(); | |||||
foreach ($invoice->getPurchases() as $purchase) { | |||||
$phids[] = $purchase->getPHID(); | |||||
} | |||||
} | |||||
$handles = $this->loadViewerHandles($phids); | |||||
$invoice_table = id(new PhortuneOrderTableView()) | $invoice_table = id(new PhortuneOrderTableView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setCarts($invoices) | ->setCarts($invoices); | ||||
->setHandles($handles); | |||||
$account = $subscription->getAccount(); | $account = $subscription->getAccount(); | ||||
$merchant = $subscription->getMerchant(); | $merchant = $subscription->getMerchant(); | ||||
$account_id = $account->getID(); | $account_id = $account->getID(); | ||||
$merchant_id = $merchant->getID(); | $merchant_id = $merchant->getID(); | ||||
$subscription_id = $subscription->getID(); | $subscription_id = $subscription->getID(); | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |