mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
email_receipt flag
This commit is contained in:
parent
eaeb47090a
commit
2805e1cc96
@ -208,6 +208,9 @@ class PaymentController extends BaseController
|
|||||||
{
|
{
|
||||||
$payment = $this->payment_repo->save($request->all(), PaymentFactory::create(auth()->user()->company()->id, auth()->user()->id));
|
$payment = $this->payment_repo->save($request->all(), PaymentFactory::create(auth()->user()->company()->id, auth()->user()->id));
|
||||||
|
|
||||||
|
if($request->has('email_receipt') && $request->input('email_receipt') == 'true' && !$payment->client->getSetting('client_manual_payment_notification'))
|
||||||
|
$payment->service()->sendEmail();
|
||||||
|
|
||||||
return $this->itemResponse($payment);
|
return $this->itemResponse($payment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,6 +459,19 @@ class Import implements ShouldQueue
|
|||||||
$user_repository = null;
|
$user_repository = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function checkUniqueConstraint($model, $column, $value)
|
||||||
|
{
|
||||||
|
$model_query = (new $model())
|
||||||
|
->query()
|
||||||
|
->where($column, $value)
|
||||||
|
->exists();
|
||||||
|
|
||||||
|
if($model_query)
|
||||||
|
return $value.'_'. Str::random(5);
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@ -476,6 +489,7 @@ class Import implements ShouldQueue
|
|||||||
$modified['user_id'] = $this->processUserId($resource);
|
$modified['user_id'] = $this->processUserId($resource);
|
||||||
$modified['balance'] = $modified['balance'] ?: 0;
|
$modified['balance'] = $modified['balance'] ?: 0;
|
||||||
$modified['paid_to_date'] = $modified['paid_to_date'] ?: 0;
|
$modified['paid_to_date'] = $modified['paid_to_date'] ?: 0;
|
||||||
|
$modified['number'] = $this->checkUniqueConstraint(Client::class, 'number', $modified['number']);
|
||||||
|
|
||||||
unset($modified['id']);
|
unset($modified['id']);
|
||||||
unset($modified['contacts']);
|
unset($modified['contacts']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user