Merge branch 'namespace-changes' into 'master'

refactor send invoice and estimate

See merge request mohit.panjvani/crater-web!32
This commit is contained in:
Mohit Panjwani
2019-11-15 13:40:27 +00:00
2 changed files with 4 additions and 3 deletions

View File

@@ -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
]);

View File

@@ -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