mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
refactor send invoice and estimate
This commit is contained in:
@ -328,13 +328,13 @@ class EstimatesController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
\Mail::to($email)->send(new EstimatePdf($data, $notificationEmail));
|
||||
|
||||
if ($estimate->status == Estimate::STATUS_DRAFT) {
|
||||
$estimate->status = Estimate::STATUS_SENT;
|
||||
$estimate->save();
|
||||
}
|
||||
|
||||
\Mail::to($email)->send(new EstimatePdf($data, $notificationEmail));
|
||||
|
||||
return response()->json([
|
||||
'success' => true
|
||||
]);
|
||||
|
||||
@ -392,13 +392,14 @@ class InvoicesController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
\Mail::to($email)->send(new invoicePdf($data, $notificationEmail));
|
||||
|
||||
if ($invoice->status == Invoice::STATUS_DRAFT) {
|
||||
$invoice->status = Invoice::STATUS_SENT;
|
||||
$invoice->sent = true;
|
||||
$invoice->save();
|
||||
}
|
||||
|
||||
\Mail::to($email)->send(new invoicePdf($data, $notificationEmail));
|
||||
|
||||
return response()->json([
|
||||
'success' => true
|
||||
|
||||
Reference in New Issue
Block a user