Merge pull request #8561 from turbo124/v5-develop

v5.6.3
This commit is contained in:
David Bomba 2023-06-17 04:42:39 +00:00 committed by GitHub
commit b4b0b8fd18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 20 deletions

View File

@ -1 +1 @@
5.6.2
5.6.3

View File

@ -88,7 +88,7 @@ class StorePaymentRequest extends Request
// $input['is_manual'] = true;
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);

View File

@ -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')) {
try {
EmailEntity::dispatch($invitation, $invoice->company)->delay(rand(1, 2));
$invoice->entityEmailEvent($invitation, 'invoice', 'email_template_invoice');
} catch (\Exception $e) {
nlog($e->getMessage());
}

View File

@ -320,7 +320,7 @@ class BaseDriver extends AbstractPaymentDriver
$payment->company_gateway_id = $this->company_gateway->id;
$payment->status_id = $status;
$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'];
$client_contact = $this->getContact();

View File

@ -119,7 +119,7 @@ class CreditService
$payment->type_id = PaymentType::CREDIT;
$payment->is_manual = true;
$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->number = $payment->client->getNextPaymentNumber($payment->client, $payment);

View File

@ -179,7 +179,7 @@ class AutoBillInvoice extends AbstractService
$payment->applied = $amount;
$payment->client_id = $this->invoice->client_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->type_id = PaymentType::CREDIT;
$payment->service()->applyNumber()->save();

View File

@ -11,11 +11,11 @@
namespace App\Services\Scheduler;
use App\DataMapper\Schedule\EmailStatement;
use App\Models\Client;
use App\Models\Scheduler;
use App\Utils\Traits\MakesHash;
use App\DataMapper\Schedule\EmailStatement;
use App\Utils\Traits\MakesDates;
use App\Utils\Traits\MakesHash;
use Carbon\Carbon;
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::LAST_YEAR => [now()->startOfDay()->subYearNoOverflow()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->subYearNoOverflow()->lastOfYear()->format('Y-m-d')],
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')
],

View File

@ -69,7 +69,7 @@ trait Inviteable
$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'>
<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()

View File

@ -15,8 +15,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.6.2',
'app_tag' => '5.6.2',
'app_version' => '5.6.3',
'app_tag' => '5.6.3',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''),

View File

@ -40,6 +40,8 @@ class SchedulerTest extends TestCase
use WithoutEvents;
use DatabaseTransactions;
protected $faker;
protected function setUp(): void
{
parent::setUp();
@ -594,12 +596,6 @@ class SchedulerTest extends TestCase
$scheduler->save();
$scheduler->calculateNextRun();
// $service_object = new SchedulerService($scheduler);
// $reflectionMethod = new \ReflectionMethod(SchedulerService::class, 'calculateNextRun');
// $reflectionMethod->setAccessible(true);
// $method = $reflectionMethod->invoke(new SchedulerService($scheduler));
$scheduler->fresh();
$offset = $this->company->timezone_offset();
@ -634,7 +630,7 @@ class SchedulerTest extends TestCase
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStartAndEndDates');
$reflectionMethod->setAccessible(true);
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler));
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler), $this->client);
$this->assertIsArray($method);
@ -668,7 +664,7 @@ class SchedulerTest extends TestCase
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStatementProperties');
$reflectionMethod->setAccessible(true);
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler)); // 'baz'
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler), $this->client);
$this->assertIsArray($method);