mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
b4b0b8fd18
@ -1 +1 @@
|
|||||||
5.6.2
|
5.6.3
|
@ -88,7 +88,7 @@ class StorePaymentRequest extends Request
|
|||||||
// $input['is_manual'] = true;
|
// $input['is_manual'] = true;
|
||||||
|
|
||||||
if (! isset($input['date'])) {
|
if (! isset($input['date'])) {
|
||||||
$input['date'] = now()->format('Y-m-d');
|
$input['date'] = now()->addSeconds(auth()->user()->company()->timezone()->utc_offset)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
|
@ -67,6 +67,9 @@ class AutoBill implements ShouldQueue
|
|||||||
if ($invitation->contact && ! $invitation->contact->trashed() && strlen($invitation->contact->email) >= 1 && $invoice->client->getSetting('auto_email_invoice')) {
|
if ($invitation->contact && ! $invitation->contact->trashed() && strlen($invitation->contact->email) >= 1 && $invoice->client->getSetting('auto_email_invoice')) {
|
||||||
try {
|
try {
|
||||||
EmailEntity::dispatch($invitation, $invoice->company)->delay(rand(1, 2));
|
EmailEntity::dispatch($invitation, $invoice->company)->delay(rand(1, 2));
|
||||||
|
|
||||||
|
$invoice->entityEmailEvent($invitation, 'invoice', 'email_template_invoice');
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
nlog($e->getMessage());
|
nlog($e->getMessage());
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
$payment->company_gateway_id = $this->company_gateway->id;
|
$payment->company_gateway_id = $this->company_gateway->id;
|
||||||
$payment->status_id = $status;
|
$payment->status_id = $status;
|
||||||
$payment->currency_id = $this->client->getSetting('currency_id');
|
$payment->currency_id = $this->client->getSetting('currency_id');
|
||||||
$payment->date = Carbon::now();
|
$payment->date = Carbon::now()->addSeconds($this->client->company->timezone()->utc_offset)->format('Y-m-d');
|
||||||
$payment->gateway_type_id = $data['gateway_type_id'];
|
$payment->gateway_type_id = $data['gateway_type_id'];
|
||||||
|
|
||||||
$client_contact = $this->getContact();
|
$client_contact = $this->getContact();
|
||||||
|
@ -119,7 +119,7 @@ class CreditService
|
|||||||
$payment->type_id = PaymentType::CREDIT;
|
$payment->type_id = PaymentType::CREDIT;
|
||||||
$payment->is_manual = true;
|
$payment->is_manual = true;
|
||||||
$payment->currency_id = $this->credit->client->getSetting('currency_id');
|
$payment->currency_id = $this->credit->client->getSetting('currency_id');
|
||||||
$payment->date = now();
|
$payment->date = now()->addSeconds($this->credit->company->timezone()->utc_offset)->format('Y-m-d');
|
||||||
|
|
||||||
$payment->saveQuietly();
|
$payment->saveQuietly();
|
||||||
$payment->number = $payment->client->getNextPaymentNumber($payment->client, $payment);
|
$payment->number = $payment->client->getNextPaymentNumber($payment->client, $payment);
|
||||||
|
@ -179,7 +179,7 @@ class AutoBillInvoice extends AbstractService
|
|||||||
$payment->applied = $amount;
|
$payment->applied = $amount;
|
||||||
$payment->client_id = $this->invoice->client_id;
|
$payment->client_id = $this->invoice->client_id;
|
||||||
$payment->currency_id = $this->invoice->client->getSetting('currency_id');
|
$payment->currency_id = $this->invoice->client->getSetting('currency_id');
|
||||||
$payment->date = now();
|
$payment->date = now()->addSeconds($this->invoice->company->timezone()->utc_offset)->format('Y-m-d');
|
||||||
$payment->status_id = Payment::STATUS_COMPLETED;
|
$payment->status_id = Payment::STATUS_COMPLETED;
|
||||||
$payment->type_id = PaymentType::CREDIT;
|
$payment->type_id = PaymentType::CREDIT;
|
||||||
$payment->service()->applyNumber()->save();
|
$payment->service()->applyNumber()->save();
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
|
|
||||||
namespace App\Services\Scheduler;
|
namespace App\Services\Scheduler;
|
||||||
|
|
||||||
|
use App\DataMapper\Schedule\EmailStatement;
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\Scheduler;
|
use App\Models\Scheduler;
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\DataMapper\Schedule\EmailStatement;
|
|
||||||
use App\Utils\Traits\MakesDates;
|
use App\Utils\Traits\MakesDates;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class EmailStatementService
|
class EmailStatementService
|
||||||
@ -95,7 +95,7 @@ class EmailStatementService
|
|||||||
EmailStatement::THIS_YEAR => [now()->startOfDay()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->lastOfYear()->format('Y-m-d')],
|
EmailStatement::THIS_YEAR => [now()->startOfDay()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->lastOfYear()->format('Y-m-d')],
|
||||||
EmailStatement::LAST_YEAR => [now()->startOfDay()->subYearNoOverflow()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->subYearNoOverflow()->lastOfYear()->format('Y-m-d')],
|
EmailStatement::LAST_YEAR => [now()->startOfDay()->subYearNoOverflow()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->subYearNoOverflow()->lastOfYear()->format('Y-m-d')],
|
||||||
EmailStatement::ALL_TIME => [
|
EmailStatement::ALL_TIME => [
|
||||||
Invoice::withTrashed()->where('client_id', $client->id)->selectRaw('MIN(invoices.date) as start_date')->pluck('start_date')->first()
|
$client->invoices()->selectRaw('MIN(invoices.date) as start_date')->pluck('start_date')->first()
|
||||||
?: Carbon::now()->format('Y-m-d'),
|
?: Carbon::now()->format('Y-m-d'),
|
||||||
Carbon::now()->format('Y-m-d')
|
Carbon::now()->format('Y-m-d')
|
||||||
],
|
],
|
||||||
|
@ -69,7 +69,7 @@ trait Inviteable
|
|||||||
$qr = $writer->writeString($this->getPaymentLink(), 'utf-8');
|
$qr = $writer->writeString($this->getPaymentLink(), 'utf-8');
|
||||||
|
|
||||||
return "<svg class='pqrcode' viewBox='0 0 200 200' width='200' height='200' x='0' y='0' xmlns='http://www.w3.org/2000/svg'>
|
return "<svg class='pqrcode' viewBox='0 0 200 200' width='200' height='200' x='0' y='0' xmlns='http://www.w3.org/2000/svg'>
|
||||||
<rect x='0' y='0' width='100%'' height='100%' />{$qr}</svg>";
|
<rect x='0' y='0' width='100%' height='100%' />{$qr}</svg>";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnsubscribeLink()
|
public function getUnsubscribeLink()
|
||||||
|
@ -15,8 +15,8 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => '5.6.2',
|
'app_version' => '5.6.3',
|
||||||
'app_tag' => '5.6.2',
|
'app_tag' => '5.6.3',
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', ''),
|
'api_secret' => env('API_SECRET', ''),
|
||||||
|
@ -40,6 +40,8 @@ class SchedulerTest extends TestCase
|
|||||||
use WithoutEvents;
|
use WithoutEvents;
|
||||||
use DatabaseTransactions;
|
use DatabaseTransactions;
|
||||||
|
|
||||||
|
protected $faker;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
@ -594,12 +596,6 @@ class SchedulerTest extends TestCase
|
|||||||
$scheduler->save();
|
$scheduler->save();
|
||||||
$scheduler->calculateNextRun();
|
$scheduler->calculateNextRun();
|
||||||
|
|
||||||
// $service_object = new SchedulerService($scheduler);
|
|
||||||
|
|
||||||
// $reflectionMethod = new \ReflectionMethod(SchedulerService::class, 'calculateNextRun');
|
|
||||||
// $reflectionMethod->setAccessible(true);
|
|
||||||
// $method = $reflectionMethod->invoke(new SchedulerService($scheduler));
|
|
||||||
|
|
||||||
$scheduler->fresh();
|
$scheduler->fresh();
|
||||||
$offset = $this->company->timezone_offset();
|
$offset = $this->company->timezone_offset();
|
||||||
|
|
||||||
@ -634,7 +630,7 @@ class SchedulerTest extends TestCase
|
|||||||
|
|
||||||
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStartAndEndDates');
|
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStartAndEndDates');
|
||||||
$reflectionMethod->setAccessible(true);
|
$reflectionMethod->setAccessible(true);
|
||||||
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler));
|
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler), $this->client);
|
||||||
|
|
||||||
$this->assertIsArray($method);
|
$this->assertIsArray($method);
|
||||||
|
|
||||||
@ -668,7 +664,7 @@ class SchedulerTest extends TestCase
|
|||||||
|
|
||||||
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStatementProperties');
|
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStatementProperties');
|
||||||
$reflectionMethod->setAccessible(true);
|
$reflectionMethod->setAccessible(true);
|
||||||
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler)); // 'baz'
|
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler), $this->client);
|
||||||
|
|
||||||
$this->assertIsArray($method);
|
$this->assertIsArray($method);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user