1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Minor fixes for task start date calculations

This commit is contained in:
David Bomba 2024-02-10 13:40:12 +11:00
parent b513ceed11
commit 9593c7c820
3 changed files with 20 additions and 8 deletions

View File

@ -144,7 +144,10 @@ class PaymentMethodController extends Controller
try {
event(new MethodDeleted($payment_method, auth()->guard('contact')->user()->company, Ninja::eventVars(auth()->guard('contact')->user()->id)));
$payment_method->is_deleted = true;
$payment_method->delete();
$payment_method->save();
} catch (Exception $e) {
nlog($e->getMessage());

View File

@ -141,7 +141,7 @@ class TaskRepository extends BaseRepository
{
if(isset($time_log[0][0])) {
return \Carbon\Carbon::createFromTimestamp($time_log[0][0])->addSeconds($task->company->utc_offset());
return \Carbon\Carbon::createFromTimestamp($time_log[0][0]);
}
return null;

View File

@ -323,13 +323,22 @@ class AutoBillInvoice extends AbstractService
public function getGateway($amount)
{
//get all client gateway tokens and set the is_default one to the first record
$gateway_tokens = $this->client
->gateway_tokens()
->whereHas('gateway', function ($query) {
$query->where('is_deleted', 0)
->where('deleted_at', null);
})->orderBy('is_default', 'DESC')
->get();
$gateway_tokens = \App\Models\ClientGatewayToken::query()
->where('client_id', $this->client->id)
->where('is_deleted', 0)
->whereHas('gateway', function ($query) {
$query->where('is_deleted', 0)
->where('deleted_at', null);
})->orderBy('is_default', 'DESC')
->get();
// $gateway_tokens = $this->client
// ->gateway_tokens()
// ->whereHas('gateway', function ($query) {
// $query->where('is_deleted', 0)
// ->where('deleted_at', null);
// })->orderBy('is_default', 'DESC')
// ->get();
$filtered_gateways = $gateway_tokens->filter(function ($gateway_token) use ($amount) {
$company_gateway = $gateway_token->gateway;