mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
62c101d247
@ -1 +1 @@
|
||||
5.5.16
|
||||
5.5.17
|
||||
|
@ -232,7 +232,12 @@ class BaseController extends Controller
|
||||
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts.company', 'gateway_tokens', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_client')) {
|
||||
// $query->where('clients.user_id', $user->id)->orWhere('clients.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('clients.user_id', $user->id)->orWhere('clients.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.company_gateways' => function ($query) use ($user) {
|
||||
@ -246,7 +251,11 @@ class BaseController extends Controller
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_credit')) {
|
||||
// $query->where('credits.user_id', $user->id)->orWhere('credits.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('credits.user_id', $user->id)->orWhere('credits.assigned_user_id', $user->id);
|
||||
});
|
||||
}
|
||||
},
|
||||
'company.designs'=> function ($query) use ($updated_at, $user) {
|
||||
@ -263,7 +272,11 @@ class BaseController extends Controller
|
||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_expense')) {
|
||||
// $query->where('expenses.user_id', $user->id)->orWhere('expenses.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('expenses.user_id', $user->id)->orWhere('expenses.assigned_user_id', $user->id);
|
||||
});
|
||||
}
|
||||
},
|
||||
'company.groups' => function ($query) use ($updated_at, $user) {
|
||||
@ -276,14 +289,25 @@ class BaseController extends Controller
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_invoice')) {
|
||||
// $query->where('invoices.user_id', $user->id)->orWhere('invoices.assigned_user_id', $user->id);
|
||||
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('invoices.user_id', $user->id)->orWhere('invoices.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.payments'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('paymentables', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_payment')) {
|
||||
// $query->where('payments.user_id', $user->id)->orWhere('payments.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('payments.user_id', $user->id)->orWhere('payments.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.payment_terms'=> function ($query) use ($updated_at, $user) {
|
||||
@ -297,49 +321,88 @@ class BaseController extends Controller
|
||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_product')) {
|
||||
// $query->where('products.user_id', $user->id)->orWhere('products.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('products.user_id', $user->id)->orWhere('products.assigned_user_id', $user->id);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
'company.projects'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_project')) {
|
||||
// $query->where('projects.user_id', $user->id)->orWhere('projects.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('projects.user_id', $user->id)->orWhere('projects.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.purchase_orders'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_purchase_order')) {
|
||||
// $query->where('purchase_orders.user_id', $user->id)->orWhere('purchase_orders.assigned_user_id', $user->id);
|
||||
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('purchase_orders.user_id', $user->id)->orWhere('purchase_orders.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.quotes'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_quote')) {
|
||||
// $query->where('quotes.user_id', $user->id)->orWhere('quotes.assigned_user_id', $user->id);
|
||||
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('quotes.user_id', $user->id)->orWhere('quotes.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.recurring_invoices'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'client.company');
|
||||
|
||||
if (! $user->hasPermission('view_recurring_invoice')) {
|
||||
// $query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.recurring_expenses'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_recurring_expense')) {
|
||||
// $query->where('recurring_expenses.user_id', $user->id)->orWhere('recurring_expenses.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('recurring_expenses.user_id', $user->id)->orWhere('recurring_expenses.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.tasks'=> function ($query) use ($updated_at, $user) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_task')) {
|
||||
// $query->where('tasks.user_id', $user->id)->orWhere('tasks.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('tasks.user_id', $user->id)->orWhere('tasks.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.tax_rates'=> function ($query) use ($updated_at, $user) {
|
||||
@ -349,7 +412,12 @@ class BaseController extends Controller
|
||||
$query->where('updated_at', '>=', $updated_at)->with('contacts', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_vendor')) {
|
||||
// $query->where('vendors.user_id', $user->id)->orWhere('vendors.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('vendors.user_id', $user->id)->orWhere('vendors.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.expense_categories'=> function ($query) use ($updated_at, $user) {
|
||||
@ -480,7 +548,12 @@ class BaseController extends Controller
|
||||
$query->where('clients.created_at', '>=', $created_at)->with('contacts.company', 'gateway_tokens', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_client')) {
|
||||
// $query->where('clients.user_id', $user->id)->orWhere('clients.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('clients.user_id', $user->id)->orWhere('clients.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.company_gateways' => function ($query) use ($user) {
|
||||
@ -494,7 +567,11 @@ class BaseController extends Controller
|
||||
$query->where('created_at', '>=', $created_at)->with('invitations', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_credit')) {
|
||||
// $query->where('credits.user_id', $user->id)->orWhere('credits.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('credits.user_id', $user->id)->orWhere('credits.assigned_user_id', $user->id);
|
||||
});
|
||||
}
|
||||
},
|
||||
'company.documents'=> function ($query) use ($created_at, $user) {
|
||||
@ -504,7 +581,13 @@ class BaseController extends Controller
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_expense')) {
|
||||
// $query->where('expenses.user_id', $user->id)->orWhere('expenses.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('expenses.user_id', $user->id)->orWhere('expenses.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
'company.groups' => function ($query) use ($created_at, $user) {
|
||||
@ -514,14 +597,24 @@ class BaseController extends Controller
|
||||
$query->where('created_at', '>=', $created_at)->with('invitations', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_invoice')) {
|
||||
// $query->where('invoices.user_id', $user->id)->orWhere('invoices.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('invoices.user_id', $user->id)->orWhere('invoices.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.payments'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('paymentables', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_payment')) {
|
||||
// $query->where('payments.user_id', $user->id)->orWhere('payments.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('payments.user_id', $user->id)->orWhere('payments.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.payment_terms'=> function ($query) use ($created_at, $user) {
|
||||
@ -531,42 +624,67 @@ class BaseController extends Controller
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_product')) {
|
||||
// $query->where('products.user_id', $user->id)->orWhere('products.assigned_user_id', $user->id);
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('products.user_id', $user->id)->orWhere('products.assigned_user_id', $user->id);
|
||||
});
|
||||
}
|
||||
},
|
||||
'company.projects'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_project')) {
|
||||
// $query->where('projects.user_id', $user->id)->orWhere('projects.assigned_user_id', $user->id);
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('projects.user_id', $user->id)->orWhere('projects.assigned_user_id', $user->id);
|
||||
});
|
||||
}
|
||||
},
|
||||
'company.purchase_orders'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_purchase_order')) {
|
||||
// $query->where('purchase_orders.user_id', $user->id)->orWhere('purchase_orders.assigned_user_id', $user->id);
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('purchase_orders.user_id', $user->id)->orWhere('purchase_orders.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.quotes'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('invitations', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_quote')) {
|
||||
// $query->where('quotes.user_id', $user->id)->orWhere('quotes.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('quotes.user_id', $user->id)->orWhere('quotes.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.recurring_invoices'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('invitations', 'documents', 'client.gateway_tokens', 'client.group_settings', 'client.company');
|
||||
|
||||
if (! $user->hasPermission('view_recurring_invoice')) {
|
||||
// $query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('recurring_invoices.user_id', $user->id)->orWhere('recurring_invoices.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.tasks'=> function ($query) use ($created_at, $user) {
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_task')) {
|
||||
// $query->where('tasks.user_id', $user->id)->orWhere('tasks.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('tasks.user_id', $user->id)->orWhere('tasks.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.tax_rates' => function ($query) use ($created_at, $user) {
|
||||
@ -576,7 +694,12 @@ class BaseController extends Controller
|
||||
$query->where('created_at', '>=', $created_at)->with('contacts', 'documents');
|
||||
|
||||
if (! $user->hasPermission('view_vendor')) {
|
||||
// $query->where('vendors.user_id', $user->id)->orWhere('vendors.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('vendors.user_id', $user->id)->orWhere('vendors.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'company.expense_categories'=> function ($query) use ($created_at, $user) {
|
||||
@ -610,7 +733,12 @@ class BaseController extends Controller
|
||||
$query->where('created_at', '>=', $created_at)->with('documents');
|
||||
|
||||
if (! $user->hasPermission('view_recurring_expense')) {
|
||||
// $query->where('recurring_expenses.user_id', $user->id)->orWhere('recurring_expenses.assigned_user_id', $user->id);
|
||||
|
||||
$query->whereNested(function($query) use ($user) {
|
||||
$query->where('recurring_expenses.user_id', $user->id)->orWhere('recurring_expenses.assigned_user_id', $user->id);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
]
|
||||
|
@ -98,6 +98,27 @@ class NinjaPlanController extends Controller
|
||||
$stripe_response = json_decode($request->input('gateway_response'));
|
||||
$customer = $gateway_driver->findOrCreateCustomer();
|
||||
|
||||
//27-08-2022 Ensure customer is updated appropriately
|
||||
$update_client_object['name'] = $client->present()->name();
|
||||
$update_client_object['phone'] = substr($client->present()->phone(), 0, 20);
|
||||
|
||||
$update_client_object['address']['line1'] = $client->address1 ?: '';
|
||||
$update_client_object['address']['line2'] = $client->address2 ?: '';
|
||||
$update_client_object['address']['city'] = $client->city ?: '';
|
||||
$update_client_object['address']['postal_code'] = $client->postal_code ?: '';
|
||||
$update_client_object['address']['state'] = $client->state ?: '';
|
||||
$update_client_object['address']['country'] = $client->country ? $client->country->iso_3166_2 : '';
|
||||
|
||||
$update_client_object['shipping']['name'] = $client->present()->name();
|
||||
$update_client_object['shipping']['address']['line1'] = $client->shipping_address1 ?: '';
|
||||
$update_client_object['shipping']['address']['line2'] = $client->shipping_address2 ?: '';
|
||||
$update_client_object['shipping']['address']['city'] = $client->shipping_city ?: '';
|
||||
$update_client_object['shipping']['address']['postal_code'] = $client->shipping_postal_code ?: '';
|
||||
$update_client_object['shipping']['address']['state'] = $client->shipping_state ?: '';
|
||||
$update_client_object['shipping']['address']['country'] = $client->shipping_country ? $client->shipping_country->iso_3166_2 : '';
|
||||
|
||||
\Stripe\Customer::update($customer->id, $update_client_object, $gateway_driver->stripe_connect_auth);
|
||||
|
||||
$gateway_driver->attach($stripe_response->payment_method, $customer);
|
||||
$method = $gateway_driver->getStripePaymentMethod($stripe_response->payment_method);
|
||||
|
||||
|
@ -181,7 +181,6 @@ class QuoteController extends Controller
|
||||
if ($process) {
|
||||
foreach ($quotes as $quote) {
|
||||
$quote->service()->approve(auth()->user())->save();
|
||||
// event(new QuoteWasApproved(auth()->guard('contact')->user(), $quote, $quote->company, Ninja::eventVars()));
|
||||
|
||||
if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) {
|
||||
InjectSignature::dispatch($quote, request()->signature);
|
||||
|
@ -69,7 +69,7 @@ class StoreExpenseRequest extends Request
|
||||
|
||||
/* Ensure the project is related */
|
||||
if (array_key_exists('project_id', $input) && isset($input['project_id'])) {
|
||||
$project = Project::withTrashed()->find($input['project_id'])->company()->first();
|
||||
$project = Project::withTrashed()->where('id', $input['project_id'])->company()->first();
|
||||
|
||||
if($project){
|
||||
$input['client_id'] = $project->client_id;
|
||||
|
@ -64,7 +64,7 @@ class UpdateExpenseRequest extends Request
|
||||
|
||||
/* Ensure the project is related */
|
||||
if (array_key_exists('project_id', $input) && isset($input['project_id'])) {
|
||||
$project = Project::withTrashed()->find($input['project_id'])->company()->first();
|
||||
$project = Project::withTrashed()->where('id', $input['project_id'])->company()->first();
|
||||
|
||||
if($project){
|
||||
$input['client_id'] = $project->client_id;
|
||||
|
@ -85,6 +85,11 @@ class CreateAccount
|
||||
$sp794f3f->hosted_client_count = config('ninja.quotas.free.clients');
|
||||
$sp794f3f->hosted_company_count = config('ninja.quotas.free.max_companies');
|
||||
$sp794f3f->account_sms_verified = true;
|
||||
|
||||
if(in_array($this->getDomain($this->request['email']), ['gmail.com', 'hotmail.com', 'outlook.com', 'yahoo.com'])){
|
||||
$sp794f3f->account_sms_verified = false;
|
||||
}
|
||||
|
||||
// $sp794f3f->trial_started = now();
|
||||
// $sp794f3f->trial_plan = 'pro';
|
||||
}
|
||||
@ -155,4 +160,19 @@ class CreateAccount
|
||||
|
||||
return $sp794f3f;
|
||||
}
|
||||
|
||||
private function getDomain($email)
|
||||
{
|
||||
if( filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
||||
// split on @ and return last value of array (the domain)
|
||||
$domain = explode('@', $email);
|
||||
|
||||
$domain_name = end($domain);
|
||||
|
||||
return $domain_name;
|
||||
}
|
||||
|
||||
return 'gmail.com';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ class Company extends BaseModel
|
||||
'inventory_notification_threshold',
|
||||
'stock_notification',
|
||||
'enabled_expense_tax_rates',
|
||||
'invoice_task_project',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
|
@ -73,7 +73,10 @@ class PaymentRepository extends BaseRepository {
|
||||
unset($data['exchange_rate']);
|
||||
|
||||
$is_existing_payment = false;
|
||||
$client = Client::where('id', $data['client_id'])->withTrashed()->first();
|
||||
|
||||
\DB::connection(config('database.default'))->transaction(function () use ($data) {
|
||||
|
||||
$client = Client::where('id', $data['client_id'])->withTrashed()->lockForUpdate()->first();
|
||||
|
||||
/*We only update the paid to date ONCE per payment*/
|
||||
if (array_key_exists('invoices', $data) && is_array($data['invoices']) && count($data['invoices']) > 0) {
|
||||
@ -81,21 +84,28 @@ class PaymentRepository extends BaseRepository {
|
||||
$data['amount'] = array_sum(array_column($data['invoices'], 'amount'));
|
||||
}
|
||||
|
||||
$client->service()->updatePaidToDate($data['amount'])->save();
|
||||
// $client->service()->updatePaidToDate($data['amount'])->save();
|
||||
$client->paid_to_date += $data['amount'];
|
||||
$client->save();
|
||||
}
|
||||
|
||||
else{
|
||||
//this fixes an edge case with unapplied payments
|
||||
$client->service()->updatePaidToDate($data['amount'])->save();
|
||||
// $client->service()->updatePaidToDate($data['amount'])->save();
|
||||
$client->paid_to_date += $data['amount'];
|
||||
$client->save();
|
||||
}
|
||||
|
||||
if (array_key_exists('credits', $data) && is_array($data['credits']) && count($data['credits']) > 0) {
|
||||
$_credit_totals = array_sum(array_column($data['credits'], 'amount'));
|
||||
|
||||
$client->service()->updatePaidToDate($_credit_totals)->save();
|
||||
|
||||
// $client->service()->updatePaidToDate($_credit_totals)->save();
|
||||
$client->paid_to_date += $_credit_totals;
|
||||
$client->save();
|
||||
}
|
||||
|
||||
}, 1);
|
||||
|
||||
}
|
||||
|
||||
/*Fill the payment*/
|
||||
|
@ -70,7 +70,8 @@ class InstantPayment
|
||||
$invoices->each(function ($invoice) {
|
||||
$invoice->service()
|
||||
->markSent()
|
||||
->removeUnpaidGatewayFees();
|
||||
->removeUnpaidGatewayFees()
|
||||
->save();
|
||||
});
|
||||
|
||||
/* pop non payable invoice from the $payable_invoices array */
|
||||
|
@ -49,6 +49,6 @@ class SendEmail
|
||||
}
|
||||
});
|
||||
|
||||
$this->credit->service()->markSent();
|
||||
$this->credit->service()->markSent()->save();
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class ApplyPaymentAmount extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if ($this->invoice->status_id == Invoice::STATUS_DRAFT) {
|
||||
$this->invoice->service()->markSent();
|
||||
$this->invoice->service()->markSent()->save();
|
||||
}
|
||||
|
||||
/*Don't double pay*/
|
||||
|
@ -178,6 +178,7 @@ class CompanyTransformer extends EntityTransformer
|
||||
'track_inventory' => (bool) $company->track_inventory,
|
||||
'enable_applying_payments' => (bool) $company->enable_applying_payments,
|
||||
'enabled_expense_tax_rates' => (int) $company->enabled_expense_tax_rates,
|
||||
'invoice_task_project' => (bool) $company->invoice_task_project,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ namespace App\Transformers;
|
||||
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\PurchaseOrderInvitation;
|
||||
use App\Models\Vendor;
|
||||
use App\Transformers\DocumentTransformer;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
|
||||
@ -27,7 +28,8 @@ class PurchaseOrderTransformer extends EntityTransformer
|
||||
];
|
||||
|
||||
protected $availableIncludes = [
|
||||
'expense'
|
||||
'expense',
|
||||
'vendor',
|
||||
];
|
||||
|
||||
public function includeInvitations(PurchaseOrder $purchase_order)
|
||||
@ -49,7 +51,22 @@ class PurchaseOrderTransformer extends EntityTransformer
|
||||
{
|
||||
$transformer = new ExpenseTransformer($this->serializer);
|
||||
|
||||
return $this->includeItem($purchase_order->expense, $transformer, Document::class);
|
||||
if (!$purchase_order->expense) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->includeItem($purchase_order->expense, $transformer, Expense::class);
|
||||
}
|
||||
|
||||
public function includeVendor(PurchaseOrder $purchase_order)
|
||||
{
|
||||
$transformer = new VendorTransformer($this->serializer);
|
||||
|
||||
if (!$purchase_order->vendor) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->includeItem($purchase_order->vendor, $transformer, Vendor::class);
|
||||
}
|
||||
|
||||
public function transform(PurchaseOrder $purchase_order)
|
||||
|
@ -95,12 +95,6 @@ return [
|
||||
'strict' => env('DB_STRICT', false),
|
||||
'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',
|
||||
'options' => [],
|
||||
// 'options' => [
|
||||
// PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
|
||||
// PDO::MYSQL_ATTR_SSL_KEY => env("DB_CLIENT_KEY", ''),
|
||||
// PDO::MYSQL_ATTR_SSL_CERT => env("DB_CLIENT_CERT", ''),
|
||||
// PDO::MYSQL_ATTR_SSL_CA => env("DB_CA_CERT", ''),
|
||||
// ],
|
||||
],
|
||||
|
||||
'db-ninja-01a' => [
|
||||
|
@ -14,8 +14,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => '5.5.16',
|
||||
'app_tag' => '5.5.16',
|
||||
'app_version' => '5.5.17',
|
||||
'app_tag' => '5.5.17',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
$table->boolean('invoice_task_project')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
Schema::table('purchase_order_invitations', function (Blueprint $table) {
|
||||
$table->enum('email_status', ['delivered', 'bounced', 'spam'])->nullable();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
@ -4767,6 +4767,9 @@ $LANG = array(
|
||||
'bulk_email_invoices' => 'Email Invoices',
|
||||
'bulk_email_quotes' => 'Email Quotes',
|
||||
'bulk_email_credits' => 'Email Credits',
|
||||
'archive_purchase_order' => 'Archive Purchase Order',
|
||||
'restore_purchase_order' => 'Restore Purchase Order',
|
||||
'delete_purchase_order' => 'Delete Purchase Order',
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
6
public/flutter_service_worker.js
vendored
6
public/flutter_service_worker.js
vendored
@ -7,7 +7,7 @@ const RESOURCES = {
|
||||
"canvaskit/profiling/canvaskit.js": "ae2949af4efc61d28a4a80fffa1db900",
|
||||
"canvaskit/profiling/canvaskit.wasm": "95e736ab31147d1b2c7b25f11d4c32cd",
|
||||
"canvaskit/canvaskit.wasm": "4b83d89d9fecbea8ca46f2f760c5a9ba",
|
||||
"main.dart.js": "809c193905ea4c80a7c0b2b0e484e1db",
|
||||
"main.dart.js": "3234746bf3c8a3ccec3cf901969c352c",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628",
|
||||
"assets/AssetManifest.json": "759f9ef9973f7e26c2a51450b55bb9fa",
|
||||
"assets/assets/google_fonts/Roboto-Regular.ttf": "8a36205bd9b83e03af0591a004bc97f4",
|
||||
@ -295,9 +295,9 @@ const RESOURCES = {
|
||||
"assets/FontManifest.json": "087fb858dc3cbfbf6baf6a30004922f1",
|
||||
"assets/NOTICES": "254a5bf1eeb00601955e148b31cb925c",
|
||||
"flutter.js": "eb2682e33f25cd8f1fc59011497c35f8",
|
||||
"/": "f1ab1648b6acf56aebbd6ae07968a461",
|
||||
"/": "48872e415511ff066e9403545e4ba572",
|
||||
"favicon.png": "dca91c54388f52eded692718d5a98b8b",
|
||||
"version.json": "a10748384e57f928f4d2871ac7563faf",
|
||||
"version.json": "9eca00898047311eda7456072e79d77d",
|
||||
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
|
||||
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
||||
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35"
|
||||
|
78643
public/main.dart.js
vendored
78643
public/main.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
78401
public/main.foss.dart.js
vendored
78401
public/main.foss.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
606
public/main.profile.dart.js
vendored
606
public/main.profile.dart.js
vendored
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"app_name":"invoiceninja_flutter","version":"5.0.91","build_number":"91","package_name":"invoiceninja_flutter"}
|
||||
{"app_name":"invoiceninja_flutter","version":"5.0.92","build_number":"92","package_name":"invoiceninja_flutter"}
|
Loading…
x
Reference in New Issue
Block a user