diff --git a/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountLogic.php index 9b58b4be..916a817b 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountLogic.php @@ -144,7 +144,14 @@ class UpdateBookingAmountLogic extends AbstractControllerLogic $this->updatesBookingInvoiceStatus->execute($booking, $updateBookingInvoiceStatusObject); } else{ - $this->createInvoiceTransactionProcessor->execute($booking); + // $this->createInvoiceTransactionProcessor->execute($booking); + $this->createInvoiceTransactionProcessor->execute($booking, "", null, [ + 'generateEInvoice' => false, + 'generateEInvoiceWithNormalInvoiceTemplate' => false, + 'generateEInvoiceRefund' => false, + 'bookingOriginalStatus' => $booking->status + ] + ); } return $this->resourceResponse(new BookingResource($booking)); diff --git a/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountWithPOLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountWithPOLogic.php index 48cc7d94..88b3d2fb 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountWithPOLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/UpdateBookingAmountWithPOLogic.php @@ -130,7 +130,14 @@ class UpdateBookingAmountWithPOLogic extends AbstractControllerLogic $this->updatesBookingInvoiceStatus->execute($booking, $updateBookingInvoiceStatusObject); } else{ - $this->createInvoiceTransactionProcessor->execute($booking); + // $this->createInvoiceTransactionProcessor->execute($booking); + $this->createInvoiceTransactionProcessor->execute($booking, "", null, [ + 'generateEInvoice' => false, + 'generateEInvoiceWithNormalInvoiceTemplate' => false, + 'generateEInvoiceRefund' => false, + 'bookingOriginalStatus' => $booking->status + ] + ); } $request->merge(['is_privilleged_update' => true]); diff --git a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php index 66254a9d..c13e02ef 100644 --- a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php +++ b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php @@ -221,7 +221,7 @@ class ExportsSalesInvoiceReport implements FromQuery, WithHeadings, WithHeadingR $company->debtor, $invoiceTransaction ? $invoiceTransaction->bill_no : '', $booking->marking, - $category === 'Compensation Voucher' ? '1000-000' : '949-2000', + $category === 'Compensation Voucher' ? '920-0000' : '949-2000', 'PRODUCT NAME :', $voucher->code, '022', diff --git a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php index 9f134a04..6a7232d8 100644 --- a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php +++ b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php @@ -221,7 +221,7 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi $company->debtor, $invoiceTransaction ? $invoiceTransaction->bill_no : '', $booking->marking, - $category === 'Compensation Voucher' ? '1000-000' : '949-2000', + $category === 'Compensation Voucher' ? '920-0000' : '949-2000', 'PRODUCT NAME :', $voucher->code, '022', diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index e118f2e9..cdc46d71 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -66,6 +66,8 @@ class BookingResource extends JsonResource 'supplier_delivery_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->latest()->first()), 'proforma_invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::PROFORMA_INVOICE)->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::EXPIRED])->latest()->first()), 'ecommerce_purchase_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->latest()->first()), + 'banking_invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::BANKING_INVOICE)->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::EXPIRED])->orderByDesc('id')->first()), + 'delivery_order_banking' => new DocumentResource($this->documents()->where('document_type', DocumentType::DELIVER_ORDER_BANKING)->orderByDesc('id')->first()), ], 'order_reference_no' => $this->modelAttributes()->where('name', BookingAttributeNames::ORDER_REFERENCE_NO)->get()->map(function ($attr) { return [