diff --git a/app/Classes/Modules/Addresses/ControllersLogic/SetAddressToDefaultLogic.php b/app/Classes/Modules/Addresses/ControllersLogic/SetAddressToDefaultLogic.php new file mode 100644 index 00000000..2f94809b --- /dev/null +++ b/app/Classes/Modules/Addresses/ControllersLogic/SetAddressToDefaultLogic.php @@ -0,0 +1,70 @@ + 'Updated Address', + 'message' => 'You have successfully set the default Address' + ]; + } + + /** @var ResetsAddressesDefault */ + private $resetsAddressesDefault; + + /** @var FetchesAddress */ + private $fetchesAddress; + + /** @var SetsAddressToDefault*/ + private $setsAddressToDefault; + + /** + * SetAddressToDefaultLogic constructor. + * @param ResetsAddressesDefault $resetsAddressesDefault + * @param FetchesAddress $fetchesAddress + * @param SetsAddressToDefault $setsAddressToDefault + */ + public function __construct(ResetsAddressesDefault $resetsAddressesDefault, FetchesAddress $fetchesAddress, SetsAddressToDefault $setsAddressToDefault) + { + $this->resetsAddressesDefault = $resetsAddressesDefault; + $this->fetchesAddress = $fetchesAddress; + $this->setsAddressToDefault = $setsAddressToDefault; + } + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\MalformedRequestException + */ + public function logic(Request $request): JsonResponse + { + + /** @var Address $address */ + + $address = $this->fetchesAddress->execute(['id' => $request->route('id')]); + + $this->resetsAddressesDefault->execute($address); + + return $this->resourceResponse(new AddressResource($this->setsAddressToDefault->execute($address))); + } +} diff --git a/app/Classes/Modules/Addresses/Services/ResetsAddressesDefault.php b/app/Classes/Modules/Addresses/Services/ResetsAddressesDefault.php new file mode 100644 index 00000000..b9f6346e --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/ResetsAddressesDefault.php @@ -0,0 +1,19 @@ +company->addresses()->update(['billing' => false]); + } +} diff --git a/app/Classes/Modules/Addresses/Services/SetsAddressToDefault.php b/app/Classes/Modules/Addresses/Services/SetsAddressToDefault.php new file mode 100644 index 00000000..07d2a2fc --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/SetsAddressToDefault.php @@ -0,0 +1,22 @@ +billing = true; + + return $this->handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Bookings/ControllersLogic/ApprovePaymentVerificationLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/ApprovePaymentVerificationLogic.php index 1f814831..ebe4ce62 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/ApprovePaymentVerificationLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/ApprovePaymentVerificationLogic.php @@ -4,12 +4,17 @@ namespace App\Classes\Modules\Bookings\ControllersLogic; use App\Classes\General\Abstracts\AbstractControllerLogic; + +use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor; + use App\Classes\Modules\Documents\Services\ApprovesDocument; use App\Classes\Modules\Documents\Services\FetchesDocument; use App\Classes\Modules\Documents\Services\RejectsDocument; use App\Classes\Modules\Transactions\Services\FetchesTransaction; use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus; + use App\Classes\ValueObjects\Constants\ApprovalStatus; + use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -22,14 +27,15 @@ class ApprovePaymentVerificationLogic extends AbstractControllerLogic * @param ApprovesDocument $approvesDocument * @param RejectsDocument $rejectsDocument * @param FetchesDocument $fetchesDocument + * @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor */ - public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument) + public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor) { $this->fetchesTransaction = $fetchesTransaction; $this->updatesTransactionStatus = $updatesTransactionStatus; $this->approvesDocument = $approvesDocument; $this->rejectsDocument = $rejectsDocument; - $this->fetchesDocument = $fetchesDocument; + $this->createInvoiceTransactionProcessor = $createInvoiceTransactionProcessor; } /** @@ -54,10 +60,8 @@ class ApprovePaymentVerificationLogic extends AbstractControllerLogic /** @var RejectsDocument */ private $rejectsDocument; - /** @var FetchesDocument */ - private $fetchesDocument; - - + /** @var CreateInvoiceTransactionProcessor */ + private $createInvoiceTransactionProcessor; /** * @param Request $request @@ -75,6 +79,8 @@ class ApprovePaymentVerificationLogic extends AbstractControllerLogic $this->updatesTransactionStatus->execute($transaction, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED); + $this->createInvoiceTransactionProcessor->execute($transaction->booking); + return $this->response([]); } diff --git a/app/Classes/Modules/Bookings/Services/CalculatesBookingCurrencyAverageRate.php b/app/Classes/Modules/Bookings/Services/CalculatesBookingCurrencyAverageRate.php new file mode 100644 index 00000000..996c8248 --- /dev/null +++ b/app/Classes/Modules/Bookings/Services/CalculatesBookingCurrencyAverageRate.php @@ -0,0 +1,19 @@ +transactions() + ->where('type', TransactionType::PAYMENT) + ->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]) + ->avg('currency_rate'); + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Bookings/Services/UpdatesBookingStatus.php b/app/Classes/Modules/Bookings/Services/UpdatesBookingStatus.php new file mode 100644 index 00000000..3264f7a7 --- /dev/null +++ b/app/Classes/Modules/Bookings/Services/UpdatesBookingStatus.php @@ -0,0 +1,22 @@ +status = $status; + return $this->handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/ServiceTypes/Services/FetchesServiceBankConfigurations.php b/app/Classes/Modules/ServiceTypes/Services/FetchesServiceBankConfigurations.php new file mode 100644 index 00000000..28843e4d --- /dev/null +++ b/app/Classes/Modules/ServiceTypes/Services/FetchesServiceBankConfigurations.php @@ -0,0 +1,27 @@ +fetchesBank = $fetchesBank; + } + + public function execute(SegmentConstant $constants) + { + return $this->fetchesBank->execute(['id' => $constants->detail->bank_id]); + } +} diff --git a/app/Classes/Modules/ServiceTypes/Services/FetchesServiceConfigurations.php b/app/Classes/Modules/ServiceTypes/Services/FetchesServiceConfigurations.php index b4230257..ae418ebf 100644 --- a/app/Classes/Modules/ServiceTypes/Services/FetchesServiceConfigurations.php +++ b/app/Classes/Modules/ServiceTypes/Services/FetchesServiceConfigurations.php @@ -14,15 +14,19 @@ class FetchesServiceConfigurations /** @var FetchesServiceCurrenciesConfigurations */ private $fetchesServiceCurrenciesConfigurations; + /** @var FetchesServiceBankConfigurations */ + private $fetchesServiceBankConfigurations; + /** * FetchesServiceConfigurations constructor. * @param FetchesConstant $fetchesConstant * @param FetchesServiceCurrenciesConfigurations $fetchesServiceCurrenciesConfigurations */ - public function __construct(FetchesConstant $fetchesConstant, FetchesServiceCurrenciesConfigurations $fetchesServiceCurrenciesConfigurations) + public function __construct(FetchesConstant $fetchesConstant, FetchesServiceCurrenciesConfigurations $fetchesServiceCurrenciesConfigurations, FetchesServiceBankConfigurations $fetchesServiceBankConfigurations) { $this->fetchesConstant = $fetchesConstant; $this->fetchesServiceCurrenciesConfigurations = $fetchesServiceCurrenciesConfigurations; + $this->fetchesServiceBankConfigurations = $fetchesServiceBankConfigurations; } @@ -32,6 +36,7 @@ class FetchesServiceConfigurations 'active' => (int) $constant->detail->is_active ?? false, 'billable' => (int) $constant->detail->is_billable ?? false, 'bank_id' => $constant->detail->bank_id ?? '', + 'bank_info' => $constant->detail->bank_id ? $this->fetchesServiceBankConfigurations->execute($constant) : '', 'currencies' => $this->fetchesServiceCurrenciesConfigurations->execute($constant) ], $this->addConfigurations($constant)->toArray()); diff --git a/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php index 3e627645..8d5c87bc 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php @@ -114,7 +114,7 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic $path = Str::studly($supplier->name).'_'.Carbon::now()->format('Y_m_d_h_s_i').'.pdf'; $object = new DocumentObject( - DocumentType::CUSTOMER_PAYMENT_PROOF, + DocumentType::CURRENCY_VENDOR_ORDER, [chunk_split('data:application/pdf;base64,'.base64_encode($pdf->output()))], '', ApprovalStatus::COMPLETED, diff --git a/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionProcessor.php b/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionProcessor.php new file mode 100644 index 00000000..22a3d9fa --- /dev/null +++ b/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionProcessor.php @@ -0,0 +1,186 @@ +listsTransactions = $listsTransactions; + $this->generatesTransactionBillNumber = $generatesTransactionBillNumber; + $this->createsTransaction = $createsTransaction; + $this->calculatesBookingPaidAmount = $calculatesBookingPaidAmount; + $this->calculatesBookingCurrencyAverageRate = $calculatesBookingCurrencyAverageRate; + $this->fetchesCompany = $fetchesCompany; + $this->createsDocument = $createsDocument; + $this->createsFile = $createsFile; + $this->updatesBookingStatus = $updatesBookingStatus; + $this->purchase_pdf = $purchase_pdf; + $this->deliver_pdf = $deliver_pdf; + $this->payment_pdf = $payment_pdf; + $this->supplier_pdf = $supplier_pdf; + } + + /** + * @param Booking $booking + * @return Model + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\MalformedRequestException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + public function execute(Booking $booking) + { + $po_order_transaction = $booking->transactions() + ->where('type', TransactionType::PURCHASE_ORDER) + ->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]) + ->first(); + if ($po_order_transaction) { + $paymant_amount = $this->calculatesBookingPaidAmount->execute($booking, $booking->fix_currency_id); + $booking_amount = $booking->fix_amount; + + if ((float) $booking_amount === (float) $paymant_amount) { + + $transaction = $booking->transactions() + ->where('type', TransactionType::PAYMENT) + ->first(); + + $billNumber = $this->generatesTransactionBillNumber->execute('INV-'); + + $booking_currency_average_rate = $this->calculatesBookingCurrencyAverageRate->execute($booking); + + $transaction_object = new TransactionObject( + $billNumber, + TransactionType::INVOICE, + $transaction->issuer, + $transaction->receiver, + $transaction->recipient_bank_account_id, + $transaction->payment_method, + $paymant_amount, + $booking_amount, + $transaction->currency_id, + $transaction->original_currency_id, + $booking_currency_average_rate, + $transaction->tax, + $transaction->service_charge, + null, + ApprovalStatus::APPROVED + ); + + $supplier = $this->fetchesCompany->execute(['id' => $transaction->receiver]); + + $purchase_order_pdf = $this->purchase_pdf->loadView('pages.pdfs.purchase_order', ['transaction' => $po_order_transaction, 'supplier' => $supplier]); + $document_object = new DocumentObject( + DocumentType::PURCHASE_ORDER, + [chunk_split('data:application/pdf;base64,'.base64_encode($purchase_order_pdf->output()))], + '', + ApprovalStatus::COMPLETED, + 'purchase_orders' + ); + $document = $this->createsDocument->execute($po_order_transaction->booking, $document_object); + $this->createsFile->execute($document, $document_object); + + $deliver_order_pdf = $this->deliver_pdf->loadView('pages.pdfs.deliver_order', ['transaction' => $po_order_transaction, 'supplier' => $supplier]); + $document_object = new DocumentObject( + DocumentType::DELIVER_ORDER, + [chunk_split('data:application/pdf;base64,'.base64_encode($deliver_order_pdf->output()))], + '', + ApprovalStatus::COMPLETED, + 'deliver_orders' + ); + $document = $this->createsDocument->execute($po_order_transaction->booking, $document_object); + $this->createsFile->execute($document, $document_object); + + $payment_order_pdf = $this->payment_pdf->loadView('pages.pdfs.payment_order', ['transaction' => $po_order_transaction, 'supplier' => $supplier]); + $document_object = new DocumentObject( + DocumentType::PAYMENT_ORDER, + [chunk_split('data:application/pdf;base64,'.base64_encode($payment_order_pdf->output()))], + '', + ApprovalStatus::COMPLETED, + 'payment_orders' + ); + $document = $this->createsDocument->execute($po_order_transaction->booking, $document_object); + $this->createsFile->execute($document, $document_object); + + $supplier_order_pdf = $this->supplier_pdf->loadView('pages.pdfs.supplier_order', ['transaction' => $po_order_transaction, 'supplier' => $supplier]); + $document_object = new DocumentObject( + DocumentType::SUPPLIER_ORDER, + [chunk_split('data:application/pdf;base64,'.base64_encode($supplier_order_pdf->output()))], + '', + ApprovalStatus::COMPLETED, + 'supplier_orders' + ); + $document = $this->createsDocument->execute($po_order_transaction->booking, $document_object); + $this->createsFile->execute($document, $document_object); + + $transaction = $this->createsTransaction->execute($po_order_transaction->booking, $transaction_object); + $this->updatesBookingStatus->execute($booking, ApprovalStatus::COMPLETED); + } + } + } +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Constants/DocumentType.php b/app/Classes/ValueObjects/Constants/DocumentType.php index 6a9a348c..299e599e 100644 --- a/app/Classes/ValueObjects/Constants/DocumentType.php +++ b/app/Classes/ValueObjects/Constants/DocumentType.php @@ -12,8 +12,13 @@ final class DocumentType { public const CUSTOMER_PAYMENT_PROOF = 'CUSTOMER_PAYMENT_PROOF'; public const CURRENCY_VENDOR_PAYMENT_PROOF = 'CURRENCY_VENDOR_PAYMENT_PROOF'; + public const CURRENCY_VENDOR_ORDER = 'CURRENCY_VENDOR_ORDER'; public const WALLET_TOP_UP_PAYMENT_PROOF = 'WALLET_TOP_UP_PAYMENT_PROOF'; public const WALLET_REFUND_PAYMENT_PROOF = 'WALLET_REFUND_PAYMENT_PROOF'; + public const PURCHASE_ORDER = 'PURCHASE_ORDER'; + public const DELIVER_ORDER = 'DELIVER_ORDER'; + public const PAYMENT_ORDER = 'PAYMENT_ORDER'; + public const SUPPLIER_ORDER = 'SUPPLIER_ORDER'; } diff --git a/app/Http/Controllers/Addresses/SetAddressToDefaultController.php b/app/Http/Controllers/Addresses/SetAddressToDefaultController.php new file mode 100644 index 00000000..4dc7115f --- /dev/null +++ b/app/Http/Controllers/Addresses/SetAddressToDefaultController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index 57d93e57..ec3c4d9e 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -7,6 +7,7 @@ use App\Classes\Modules\Bookings\Services\CalculatesBookingOutstanding; use App\Classes\Modules\Bookings\Services\CalculatesBookingPaidAmount; use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\TransactionType; +use App\Classes\ValueObjects\Constants\DocumentType; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -35,6 +36,10 @@ class BookingResource extends JsonResource 'fixed_currency' => new CurrencyResource($this->fixedCurrency), 'convertible_currency' => new CurrencyResource($this->convertibleCurrency), 'conversion_currency' => new CurrencyResource($this->conversionCurrency), + 'purchase_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::PURCHASE_ORDER)->first()), + 'deliver_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::DELIVER_ORDER)->first()), + 'payment_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::PAYMENT_ORDER)->first()), + 'supplier_order_document' => new DocumentResource($this->documents()->where('document_type', DocumentType::SUPPLIER_ORDER)->first()), 'status' => $this->status, 'created_at' => Carbon::parse($this->created_at)->format('d-m-Y'), $this->mergeWhen($this->relationLoaded('transactions'), [ diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index 6f893c9a..4de14945 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -29,7 +29,7 @@ class CompanyResource extends JsonResource 'business_type' => (int) $this->business_type, 'status' => (int) $this->status, 'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())), - 'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->first())), + 'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->where('billing', true)->first())), 'employee' => new UserResource($this->employees->first()), 'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()), 'bookings' => BookingResource::collection($this->whenLoaded('bookings', $this->bookings()->orderBy('id', 'DESC')->get(), [])), diff --git a/app/Models/Booking.php b/app/Models/Booking.php index e719abc5..3beacb25 100644 --- a/app/Models/Booking.php +++ b/app/Models/Booking.php @@ -2,11 +2,13 @@ namespace App\Models; +use App\Classes\General\Interfaces\Documentable; use App\Classes\ValueObjects\Constants\RoleTypes; use App\Scopes\CustomerBookingsScope; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\SoftDeletes; @@ -22,7 +24,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property \App\Models\Currency convertible_currency_id * @property \App\Models\Currency conversion_currency_id */ -class Booking extends AbstractModel +class Booking extends AbstractModel implements Documentable { use SoftDeletes; @@ -78,6 +80,14 @@ class Booking extends AbstractModel return $this->BelongsTo(Currency::class, 'conversion_currency_id'); } + /** + * @return MorphMany + */ + public function documents(): MorphMany + { + return $this->MorphMany(Document::class, 'owner'); + } + /** * @return HasMany */ diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 51597ba2..d77eda88 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -52,4 +52,12 @@ class Transaction extends AbstractModel implements Documentable return $this->HasMany(TransactionDetail::class, 'transaction_id', 'id'); } + public function convert_original_amount() + { + if($this->booking()->first()->fix_currency_id !== 1) { + $currency_rate = $this->currency()->first()->rates()->where('payment_method_type', $this->payment_method)->first(); + return number_format($this->original_amount / $currency_rate->selling, 2); + } + return $this->original_amount; + } } diff --git a/app/Models/TransactionDetail.php b/app/Models/TransactionDetail.php index 49494327..8e0a1613 100644 --- a/app/Models/TransactionDetail.php +++ b/app/Models/TransactionDetail.php @@ -2,16 +2,36 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsTo; class TransactionDetail extends AbstractModel { protected $table = 'transaction_detail'; - public function transaction(): HasOne + /** + * @return BelongsTo + */ + public function transaction(): BelongsTo { - return $this->hasOne(Transaction::class, 'transaction_id', 'id'); + return $this->BelongsTo( Transaction::class, 'transaction_id', 'id'); } + public function convert_original_price() + { + if($this->transaction()->first()->booking()->first()->fix_currency_id !== 1) { + $currency_rate = $this->transaction()->first()->currency()->first()->rates()->where('payment_method_type', $this->transaction()->first()->payment_method)->first(); + return number_format($this->price / $currency_rate->selling, 2); + } + return $this->price; + } + + public function convert_original_amount() + { + if($this->transaction()->first()->booking()->first()->fix_currency_id !== 1) { + $currency_rate = $this->transaction()->first()->currency()->first()->rates()->where('payment_method_type', $this->transaction()->first()->payment_method)->first(); + return number_format($this->amount / $currency_rate->selling, 2); + } + return $this->amount; + } } diff --git a/resources/assets/vue/components/address/elements/AddressListComponent.vue b/resources/assets/vue/components/address/elements/AddressListComponent.vue new file mode 100644 index 00000000..792a84b7 --- /dev/null +++ b/resources/assets/vue/components/address/elements/AddressListComponent.vue @@ -0,0 +1,196 @@ + + + \ No newline at end of file diff --git a/resources/assets/vue/components/address/forms/AddressFormComponent.vue b/resources/assets/vue/components/address/forms/AddressFormComponent.vue index e3508e01..809165a1 100644 --- a/resources/assets/vue/components/address/forms/AddressFormComponent.vue +++ b/resources/assets/vue/components/address/forms/AddressFormComponent.vue @@ -54,7 +54,11 @@ id: { type: Number, required: true - } + }, + type: { + type: Number, + default: 1 + }, }, watch: { 'id': function() { @@ -85,8 +89,9 @@ submitForm(){ this.submit((this.route('api.address.create')), 'post', 'bookingDetailSection', true, true) }, - successHandler(){ - this.updateList() + successHandler(response){ + this.type !== 2 ? this.$emit('updateDefaultAddress', response.payload.data) : this.$emit('createdAddress', response.payload.data); + this.resetForm(); } } } diff --git a/resources/assets/vue/components/address/forms/SetDefaultBillingAddressComponent.vue b/resources/assets/vue/components/address/forms/SetDefaultBillingAddressComponent.vue new file mode 100644 index 00000000..6d5b457e --- /dev/null +++ b/resources/assets/vue/components/address/forms/SetDefaultBillingAddressComponent.vue @@ -0,0 +1,25 @@ + + \ No newline at end of file diff --git a/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue b/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue index a9327b71..428babac 100644 --- a/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue +++ b/resources/assets/vue/components/banks/forms/BankAccountFormComponent.vue @@ -159,6 +159,7 @@ successHandler(response){ this.type !== 2 ? this.closeModal() : this.$emit('createdBank', response.payload.data); this.formHandler(); + this.resetForm(); }, errorHandler(error){ this.formHandler(error.message); diff --git a/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue b/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue index 04eac563..92966dc5 100644 --- a/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue @@ -104,7 +104,7 @@
-
+
@@ -257,11 +257,14 @@ }, methods: { updateBank(bank){ - this.parameters.bankAccount = bank; - this.parameters.bankAccount.status = false; + this.selectBank(bank); this.recipientBanks.push(bank); this.createBank = false; }, + selectBank(bank){ + this.parameters.bankAccount = bank; + this.parameters.bankAccount.status = false; + }, }, mixins: [FormHandler] } diff --git a/resources/assets/vue/components/bookings/elements/PaymentVerificationComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentVerificationComponent.vue index 95c10674..b90ce975 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentVerificationComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentVerificationComponent.vue @@ -29,14 +29,16 @@
-
- - - +
+
+ + + +
diff --git a/resources/assets/vue/components/bookings/forms/CurrencyConverterComponent.vue b/resources/assets/vue/components/bookings/forms/CurrencyConverterComponent.vue index 485f73ed..8798dd89 100644 --- a/resources/assets/vue/components/bookings/forms/CurrencyConverterComponent.vue +++ b/resources/assets/vue/components/bookings/forms/CurrencyConverterComponent.vue @@ -275,7 +275,9 @@ this.isloading = false; }, errorHandler(error){ - this.$emit('newCalculation', {}); + this.$emit('newCalculation', { + calculation: -1 + }); this.error = error.message; this.loading = false; } diff --git a/resources/assets/vue/components/bookings/forms/PaymentVerificationFormComponent.vue b/resources/assets/vue/components/bookings/forms/PaymentVerificationFormComponent.vue index 958a6ce5..96453d88 100644 --- a/resources/assets/vue/components/bookings/forms/PaymentVerificationFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/PaymentVerificationFormComponent.vue @@ -9,6 +9,30 @@
Payment Verification
+ +
+
+
+ +
+
+
+
+
+
{{data.booking.service.configurations.bank_info.holder_name}}
+
+
+
+
+
{{data.booking.service.configurations.bank_info.bank_name}}: {{ data.booking.service.configurations.bank_info.account_no}}
+
+
+
+
+
diff --git a/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue b/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue index 0ed00850..cc4d85cd 100644 --- a/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue +++ b/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue @@ -1,5 +1,5 @@