Merge pull request #7571 from turbo124/v5-develop

Minor fixes
This commit is contained in:
David Bomba 2022-06-19 15:22:45 +10:00 committed by GitHub
commit 6ad8e66ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 2 deletions

View File

@ -866,7 +866,7 @@ class CheckData extends Command
foreach(Invoice::with(['payments'])->whereHas('payments')->where('status_id', 4)->where('balance', '>', 0)->where('is_deleted',0)->cursor() as $invoice) foreach(Invoice::with(['payments'])->whereHas('payments')->where('status_id', 4)->where('balance', '>', 0)->where('is_deleted',0)->cursor() as $invoice)
{ {
$this->$this->wrong_paid_status++; $this->wrong_paid_status++;
$this->logMessage("# {$invoice->id} " . ' - '.$invoice->number." - Marked as paid, but balance = {$invoice->balance}"); $this->logMessage("# {$invoice->id} " . ' - '.$invoice->number." - Marked as paid, but balance = {$invoice->balance}");

View File

@ -375,7 +375,7 @@ class Account extends BaseModel
{ {
if(Carbon::createFromTimestamp($this->created_at)->diffInWeeks() == 0) if(Carbon::createFromTimestamp($this->created_at)->diffInWeeks() == 0)
return 50; return 20;
if($this->isPaid()){ if($this->isPaid()){
$limit = $this->paid_plan_email_quota; $limit = $this->paid_plan_email_quota;

View File

@ -123,6 +123,7 @@ class AutoBillInvoice extends AbstractService
->setPaymentHash($payment_hash) ->setPaymentHash($payment_hash)
->tokenBilling($gateway_token, $payment_hash); ->tokenBilling($gateway_token, $payment_hash);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->invoice->auto_bill_tries += 1; $this->invoice->auto_bill_tries += 1;
if ($this->invoice->auto_bill_tries == 3) { if ($this->invoice->auto_bill_tries == 3) {
@ -131,6 +132,8 @@ class AutoBillInvoice extends AbstractService
$this->invoice->save(); $this->invoice->save();
} }
$this->invoice->save();
nlog("payment NOT captured for " . $this->invoice->number . " with error " . $e->getMessage()); nlog("payment NOT captured for " . $this->invoice->number . " with error " . $e->getMessage());
} }

View File

@ -116,6 +116,11 @@ class Helpers
$replacements = [ $replacements = [
'literal' => [ 'literal' => [
':MONTHYEAR' => \sprintf(
'%s %s',
Carbon::createFromDate(now()->month)->translatedFormat('F'),
now()->year,
),
':MONTH' => Carbon::createFromDate(now()->year, now()->month)->translatedFormat('F'), ':MONTH' => Carbon::createFromDate(now()->year, now()->month)->translatedFormat('F'),
':YEAR' => now()->year, ':YEAR' => now()->year,
':QUARTER' => 'Q' . now()->quarter, ':QUARTER' => 'Q' . now()->quarter,
@ -139,6 +144,7 @@ class Helpers
), ),
], ],
'raw' => [ 'raw' => [
':MONTHYEAR' => now()->month,
':MONTH' => now()->month, ':MONTH' => now()->month,
':YEAR' => now()->year, ':YEAR' => now()->year,
':QUARTER' => now()->quarter, ':QUARTER' => now()->quarter,
@ -256,6 +262,18 @@ class Helpers
$output = \Carbon\Carbon::create()->month($output)->translatedFormat('F'); $output = \Carbon\Carbon::create()->month($output)->translatedFormat('F');
} }
if ($matches->keys()->first() == ':MONTHYEAR') {
$final_date = now()->addMonths($output-now()->month);
$output = \sprintf(
'%s %s',
$final_date->translatedFormat('F'),
$final_date->year,
);
}
$value = preg_replace( $value = preg_replace(
$target, $output, $value, 1 $target, $output, $value, 1
); );