mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Payment notifications for autobilling
This commit is contained in:
parent
b4bf6cc760
commit
9b72acf506
@ -19,20 +19,6 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
*/
|
*/
|
||||||
class DocumentFilters extends QueryFilters
|
class DocumentFilters extends QueryFilters
|
||||||
{
|
{
|
||||||
public function type_id(int $type_id) :Builder
|
|
||||||
{
|
|
||||||
return $this->builder->where('type_id', $type_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function category_id(int $category_id) :Builder
|
|
||||||
{
|
|
||||||
return $this->builder->where('category_id', $category_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function event_id(int $event_id) :Builder
|
|
||||||
{
|
|
||||||
return $this->builder->where('event_id', $event_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function client_id(int $client_id) :Builder
|
public function client_id(int $client_id) :Builder
|
||||||
{
|
{
|
||||||
|
@ -104,6 +104,7 @@ class BaseController extends Controller
|
|||||||
'user.company_user',
|
'user.company_user',
|
||||||
'token',
|
'token',
|
||||||
'company.activities',
|
'company.activities',
|
||||||
|
'company.documents',
|
||||||
//'company.users.company_user',
|
//'company.users.company_user',
|
||||||
'company.tax_rates',
|
'company.tax_rates',
|
||||||
'company.groups',
|
'company.groups',
|
||||||
@ -183,6 +184,9 @@ class BaseController extends Controller
|
|||||||
|
|
||||||
protected function refreshResponse($query)
|
protected function refreshResponse($query)
|
||||||
{
|
{
|
||||||
|
if (auth()->user()->getCompany()->is_large)
|
||||||
|
$this->manager->parseIncludes($this->mini_load);
|
||||||
|
else
|
||||||
$this->manager->parseIncludes($this->first_load);
|
$this->manager->parseIncludes($this->first_load);
|
||||||
|
|
||||||
$this->serializer = request()->input('serializer') ?: EntityTransformer::API_SERIALIZER_ARRAY;
|
$this->serializer = request()->input('serializer') ?: EntityTransformer::API_SERIALIZER_ARRAY;
|
||||||
@ -196,9 +200,9 @@ class BaseController extends Controller
|
|||||||
$transformer = new $this->entity_transformer($this->serializer);
|
$transformer = new $this->entity_transformer($this->serializer);
|
||||||
$updated_at = request()->has('updated_at') ? request()->input('updated_at') : 0;
|
$updated_at = request()->has('updated_at') ? request()->input('updated_at') : 0;
|
||||||
|
|
||||||
if (auth()->user()->getCompany()->is_large && ! request()->has('updated_at')) {
|
// if (auth()->user()->getCompany()->is_large && ! request()->has('updated_at')) {
|
||||||
return response()->json(['message' => ctrans('texts.large_account_update_parameter'), 'errors' =>[]], 401);
|
// return response()->json(['message' => ctrans('texts.large_account_update_parameter'), 'errors' =>[]], 401);
|
||||||
}
|
// }
|
||||||
|
|
||||||
$updated_at = date('Y-m-d H:i:s', $updated_at);
|
$updated_at = date('Y-m-d H:i:s', $updated_at);
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ class SendRecurring implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) {
|
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) {
|
||||||
|
nlog("attempting to autobill {$invoice->number}");
|
||||||
$invoice->service()->autoBill()->save();
|
$invoice->service()->autoBill()->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,13 +91,13 @@ class CompanyPresenter extends EntityPresenter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSpcQrCode($client_custom, $invoice_number, $balance)
|
public function getSpcQrCode($client_currency, $invoice_number, $balance)
|
||||||
{
|
{
|
||||||
$settings = $this->entity->settings;
|
$settings = $this->entity->settings;
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
"SPC\n0200\n1\nCH860021421411198240K\nK\n{$this->name}\n{$settings->address1}\n{$settings->postal_code} {$settings->city}\n\n\nCH\n\n\n\n\n\n\n\n{$balance}\n{$client_custom}\n\n\n\n\n\n\n\nNON\n\n{$invoice_number}\nEPD\n";
|
"SPC\n0200\n1\nCH860021421411198240K\nK\n{$this->name}\n{$settings->address1}\n{$settings->postal_code} {$settings->city}\n\n\nCH\n\n\n\n\n\n\n\n{$balance}\n{$client_currency}\n\n\n\n\n\n\n\nNON\n\n{$invoice_number}\nEPD\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -175,10 +175,8 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
return $this->payment_method->paymentView($data);
|
return $this->payment_method->paymentView($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processPaymentResponse($request) //We never have to worry about unsuccessful payments as failures are handled at the front end for this driver.
|
public function processPaymentResponse($request)
|
||||||
{
|
{
|
||||||
$this->setPaymentHash($request->payment_hash);
|
|
||||||
|
|
||||||
return $this->payment_method->paymentResponse($request);
|
return $this->payment_method->paymentResponse($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ class HtmlEngine
|
|||||||
$data['$company.website'] = ['value' => $this->settings->website ?: ' ', 'label' => ctrans('texts.website')];
|
$data['$company.website'] = ['value' => $this->settings->website ?: ' ', 'label' => ctrans('texts.website')];
|
||||||
$data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: ' ', 'label' => ctrans('texts.address')];
|
$data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: ' ', 'label' => ctrans('texts.address')];
|
||||||
|
|
||||||
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->custom1, $this->entity->number, $this->entity->balance), 'label' => ''];
|
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->currency()->code, $this->entity->number, $this->entity->balance), 'label' => ''];
|
||||||
|
|
||||||
$logo = $this->company->present()->logo($this->settings);
|
$logo = $this->company->present()->logo($this->settings);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user