@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Correct use of "trigger.this-epoch" vs "trigger.next-epoch"

These parameters were set inconsistently. Use the value that the storage task uses.
Also, allow `bin/phortune invoice` to invoice in the past and future to aid testing.

+10 -7
+2 -1
src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php
··· 153 153 array( 154 154 'subscriptionPHID' => $subscription->getPHID(), 155 155 'trigger.last-epoch' => $last_time, 156 - 'trigger.next-epoch' => $next_time, 156 + 'trigger.this-epoch' => $next_time, 157 + 'manual' => true, 157 158 ), 158 159 array( 159 160 'objectPHID' => $subscription->getPHID(),
+8 -6
src/applications/phortune/worker/PhortuneSubscriptionWorker.php
··· 187 187 // creation date as the start of the billing period. 188 188 $last_epoch = $subscription->getDateCreated(); 189 189 } 190 - $this_epoch = idx($data, 'trigger.next-epoch'); 190 + $this_epoch = idx($data, 'trigger.this-epoch'); 191 191 192 192 if (!$last_epoch || !$this_epoch) { 193 193 throw new PhabricatorWorkerPermanentFailureException( ··· 202 202 'Subscription has invalid billing period.')); 203 203 } 204 204 205 - if (PhabricatorTime::getNow() < $this_epoch) { 206 - throw new Exception( 207 - pht( 208 - 'Refusing to generate a subscription invoice for a billing period '. 209 - 'which ends in the future.')); 205 + if (empty($data['manual'])) { 206 + if (PhabricatorTime::getNow() < $this_epoch) { 207 + throw new Exception( 208 + pht( 209 + 'Refusing to generate a subscription invoice for a billing period '. 210 + 'which ends in the future.')); 211 + } 210 212 } 211 213 212 214 return array($last_epoch, $this_epoch);