E-Invoice - Reinstate some commented code

This commit is contained in:
Dillon Ngo
2025-09-02 05:09:39 +08:00
parent 8031db446e
commit d5e008d4f3
@@ -75,12 +75,11 @@ class ApproveShippingInvoiceTransactionProcessor
$this->createSalesOrderDocProcessor->execute($invoice_transaction);
$this->updatesTransactionStatus->execute($invoice_transaction, ApprovalStatus::APPROVED);
//cief todo: 90 - to determine if sending email is necessary
// if(app()->environment(['production'])) {
// $companyModule = $packingList->owner->companyModule;
// $user = $companyModule->employees()->first();
// $user->notify(new InvoiceIssuedEmail($user, $packingList));
// }
if(app()->environment(['production']) && $companyModule->company->e_invoice === 0) { //invoice issued email is only send to customer who has not opted in E-Invoice
$companyModule = $packingList->owner->companyModule;
$user = $companyModule->employees()->first();
$user->notify(new InvoiceIssuedEmail($user, $packingList));
}
$order = $packingList->owner()->first();
if($order instanceof Order){