mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Add payment notification on manual payment creation
This commit is contained in:
parent
cac8056832
commit
0426b6c941
@ -592,7 +592,7 @@ class PaymentController extends BaseController
|
||||
$this->payment_repo->restore($payment);
|
||||
|
||||
if (! $bulk) {
|
||||
return $this->listResponse($payment);
|
||||
return $this->itemResponse($payment);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -600,7 +600,7 @@ class PaymentController extends BaseController
|
||||
$this->payment_repo->archive($payment);
|
||||
|
||||
if (! $bulk) {
|
||||
return $this->listResponse($payment);
|
||||
return $this->itemResponse($payment);
|
||||
}
|
||||
// code...
|
||||
break;
|
||||
@ -608,14 +608,26 @@ class PaymentController extends BaseController
|
||||
$this->payment_repo->delete($payment);
|
||||
|
||||
if (! $bulk) {
|
||||
return $this->listResponse($payment);
|
||||
return $this->itemResponse($payment);
|
||||
}
|
||||
// code...
|
||||
break;
|
||||
case 'email':
|
||||
//dispatch email to queue
|
||||
break;
|
||||
$this->payment->service()->sendEmail();
|
||||
|
||||
if (! $bulk) {
|
||||
return $this->itemResponse($payment);
|
||||
}
|
||||
break;
|
||||
case 'email_receipt':
|
||||
$this->payment->service()->sendEmail();
|
||||
|
||||
if (! $bulk) {
|
||||
return $this->itemResponse($payment);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// code...
|
||||
break;
|
||||
|
@ -45,10 +45,10 @@ class CreateCompanyTaskStatuses
|
||||
public function handle()
|
||||
{
|
||||
$task_statuses = [
|
||||
['name' => ctrans('texts.backlog'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => ctrans('texts.ready_to_do'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => ctrans('texts.in_progress'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => ctrans('texts.done'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => ctrans('texts.backlog'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), 'status_order' => 1],
|
||||
['name' => ctrans('texts.ready_to_do'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), 'status_order' => 2],
|
||||
['name' => ctrans('texts.in_progress'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), 'status_order' => 3],
|
||||
['name' => ctrans('texts.done'), 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), 'status_order' => 4],
|
||||
|
||||
];
|
||||
|
||||
|
@ -45,12 +45,29 @@ class Webhook extends BaseModel
|
||||
|
||||
public static $valid_events = [
|
||||
self::EVENT_CREATE_CLIENT,
|
||||
self::EVENT_CREATE_PAYMENT,
|
||||
self::EVENT_CREATE_QUOTE,
|
||||
self::EVENT_CREATE_INVOICE,
|
||||
self::EVENT_CREATE_QUOTE,
|
||||
self::EVENT_CREATE_PAYMENT,
|
||||
self::EVENT_CREATE_VENDOR,
|
||||
self::EVENT_UPDATE_QUOTE,
|
||||
self::EVENT_DELETE_QUOTE,
|
||||
self::EVENT_UPDATE_INVOICE,
|
||||
self::EVENT_DELETE_INVOICE,
|
||||
self::EVENT_UPDATE_CLIENT,
|
||||
self::EVENT_DELETE_CLIENT,
|
||||
self::EVENT_DELETE_PAYMENT,
|
||||
self::EVENT_UPDATE_VENDOR,
|
||||
self::EVENT_DELETE_VENDOR,
|
||||
self::EVENT_CREATE_EXPENSE,
|
||||
self::EVENT_UPDATE_EXPENSE,
|
||||
self::EVENT_DELETE_EXPENSE,
|
||||
self::EVENT_CREATE_TASK,
|
||||
self::EVENT_UPDATE_TASK,
|
||||
self::EVENT_DELETE_TASK,
|
||||
self::EVENT_APPROVE_QUOTE,
|
||||
self::EVENT_LATE_INVOICE,
|
||||
self::EVENT_EXPIRED_QUOTE,
|
||||
self::EVENT_REMIND_INVOICE,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
@ -155,7 +155,11 @@ class PaymentRepository extends BaseRepository {
|
||||
}
|
||||
|
||||
if ( ! $is_existing_payment && ! $this->import_mode ) {
|
||||
event( new PaymentWasCreated( $payment, $payment->company, Ninja::eventVars(auth()->user()->id) ) );
|
||||
|
||||
if ($payment->client->getSetting('client_manual_payment_notification'))
|
||||
$payment->service()->sendEmail();
|
||||
|
||||
event( new PaymentWasCreated( $payment, $payment->company, Ninja::eventVars(auth()->user()->id) ) );
|
||||
}
|
||||
|
||||
nlog("payment amount = {$payment->amount}");
|
||||
|
Loading…
Reference in New Issue
Block a user