mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -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) {
|
if ($estimate->status == Estimate::STATUS_DRAFT) {
|
||||||
$estimate->status = Estimate::STATUS_SENT;
|
$estimate->status = Estimate::STATUS_SENT;
|
||||||
$estimate->save();
|
$estimate->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
\Mail::to($email)->send(new EstimatePdf($data, $notificationEmail));
|
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => true
|
'success' => true
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -392,13 +392,14 @@ class InvoicesController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\Mail::to($email)->send(new invoicePdf($data, $notificationEmail));
|
||||||
|
|
||||||
if ($invoice->status == Invoice::STATUS_DRAFT) {
|
if ($invoice->status == Invoice::STATUS_DRAFT) {
|
||||||
$invoice->status = Invoice::STATUS_SENT;
|
$invoice->status = Invoice::STATUS_SENT;
|
||||||
$invoice->sent = true;
|
$invoice->sent = true;
|
||||||
$invoice->save();
|
$invoice->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
\Mail::to($email)->send(new invoicePdf($data, $notificationEmail));
|
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => true
|
'success' => true
|
||||||
|
|||||||
Reference in New Issue
Block a user