diff --git a/app/Classes/General/Eloquent/Filters/HasVouchersAll.php b/app/Classes/General/Eloquent/Filters/HasVouchersAll.php deleted file mode 100644 index d2ff7a2e..00000000 --- a/app/Classes/General/Eloquent/Filters/HasVouchersAll.php +++ /dev/null @@ -1,44 +0,0 @@ -type, RoleTypes::ADMIN_ROLES)){ - // $userId = $value !== 1 ? $value : Auth::user()->id; - $userId = $value; - return $builder->where('user_id', $userId) - ->where(function ($query) { - $query->whereHas('reward', function ($subquery) { - $subquery->where('is_active', true); - }) - ->orWhereDoesntHave('reward'); - }) - ->whereDoesntHave('voucher.redemptions.transaction.booking.company.employees', function ($query) use ($userId) { - $query->where('user_id', $userId); - }); - } - else{ - return $builder->where('user_id', Auth::user()->id) - ->where(function ($query) { - $query->whereHas('reward', function ($subquery) { - $subquery->where('is_active', true); - }) - ->orWhereDoesntHave('reward'); - }) - ->whereDoesntHave('voucher.redemptions.transaction.owner'); - } - } -} diff --git a/app/Classes/Modules/Accounting/ControllersLogic/ImportAmbankStatementLogic.php b/app/Classes/Modules/Accounting/ControllersLogic/ImportAmbankStatementLogic.php index e5d7adf0..afaddf92 100644 --- a/app/Classes/Modules/Accounting/ControllersLogic/ImportAmbankStatementLogic.php +++ b/app/Classes/Modules/Accounting/ControllersLogic/ImportAmbankStatementLogic.php @@ -24,10 +24,11 @@ class ImportAmbankStatementLogic extends AbstractControllerLogic /** * @return array */ - protected function notification():array { + protected function notification(): array + { return [ 'title' => 'Import Ambank Statement Transactions Details', - 'message' => 'You have successfully updated the Ambank Statement Transactions Details' + 'message' => 'You have successfully imported the Ambank Statement Transactions Details' ]; } @@ -37,178 +38,147 @@ class ImportAmbankStatementLogic extends AbstractControllerLogic * @return JsonResponse * @throws MalformedRequestException */ - public function logic(Request $request) : JsonResponse + public function logic(Request $request): JsonResponse { + $requiredHeaders = ['Date', 'Time', 'Description', 'Recipient Reference', 'Other Payment Details', 'Transfer Type', 'Inward Amount', 'Outward Amount', 'Balance']; $object = new DocumentObject('', $request->input('files'), '', ApprovalStatus::APPROVED, 'imports'); - foreach ($object->getFiles() as $file){ + foreach ($object->getFiles() as $file) { $collection = Excel::toCollection(null, json_decode($file)->file_info->original->file, null, null, true); - $statementDetailRows = $collection->first()->slice(0,13); + // check whether the csv is format we expect for + foreach ($collection as $sheet_no => $sheet) { + $header_mapping_result = []; + foreach ($sheet as $row_no => $row) { + if ($row[0] !== $requiredHeaders[0]) { + continue; + } - $dateInfoKey = $this->findInfoIndexFromExcelCollection($statementDetailRows, "STATEMENT DATE"); - $statementDateRange = trim(explode(':', $this->extractInfoFromExcelCollection($statementDetailRows[$dateInfoKey])[0])[1]); - $dateFrom = trim(explode('-', $statementDateRange)[0]); - $dateTo = trim(explode('-', $statementDateRange)[1]); - $dateFrom = carbon::createFromFormat('d/m/Y', $dateFrom); - $dateTo = carbon::createFromFormat('d/m/Y', $dateTo); - $dateTo = carbon::parse($dateTo); - $totalDebitKey = $this->findInfoIndexFromExcelCollection($statementDetailRows, "TOTAL DEBIT"); - $totalDebit = $this->extractInfoFromExcelCollection($statementDetailRows[$totalDebitKey])[1]; - $totalCreditKey = $this->findInfoIndexFromExcelCollection($statementDetailRows, "TOTAL CREDIT"); - $totalCredit = $this->extractInfoFromExcelCollection($statementDetailRows[$totalCreditKey])[1]; - $totalTransactions = $totalDebit + $totalCredit; - $beginBalanceKey = $this->findInfoIndexFromExcelCollection($statementDetailRows, "OPENING BALANCE"); - $beginBalance = ((float) str_replace(',', '', $this->extractInfoFromExcelCollection($statementDetailRows[$beginBalanceKey])[1])); - $endBalanceKey = $this->findInfoIndexFromExcelCollection($statementDetailRows, "CLOSING BALANCE"); - $endBalance = ((float) str_replace(',', '', $this->extractInfoFromExcelCollection($statementDetailRows[$endBalanceKey])[1])); + foreach ($requiredHeaders as $col_no => $header) { + if ($row[$col_no] !== $header) { + $header_mapping_result[$col_no] = false; + } else { + $header_mapping_result[$col_no] = true; + } + } + + if (count($header_mapping_result) === 9) { + break; + } + } + + if (count($header_mapping_result) === 0 || in_array(false, $header_mapping_result)) { + throw new MalformedRequestException("Sheet {$sheet_no} format is not correct"); + } + } + + $data_start_from = $sheet->search(function ($row, $key) { + return $row[0] === 'Date'; + }) + 1; + $data_end_at = $sheet->keys()->last(); + $descending = true; + + for ($i = $data_end_at; $i > 0; $i--) { + $parse_date = Carbon::createFromFormat('d/m/Y', $sheet[$i][0]); + if ($parse_date && $parse_date->format('d/m/Y') === $sheet[$i][0]) { + $data_end_at = $i; + break; + } + } + + if (Carbon::createFromFormat('d/m/Y', $sheet[$data_start_from][0]) > Carbon::createFromFormat('d/m/Y', $sheet[$data_end_at][0])) { + $descending = true; + } else { + $descending = false; + } + + $date_from = Carbon::createFromFormat('d/m/Y', $sheet[$descending ? $data_end_at : $data_start_from][0])->format('Y-m-d'); + $date_to = Carbon::createFromFormat('d/m/Y', $sheet[$descending ? $data_start_from : $data_end_at][0])->format('Y-m-d'); + $total_rows = abs($data_end_at - $data_start_from) + 1; + $begin_balance = floatval($sheet[$descending ? $data_end_at : $data_start_from][8]); + $end_balance = floatval($sheet[$descending ? $data_start_from : $data_end_at][8]); + $total_debit = 0; + $total_credit = 0; $account = StatementAccount::where('number', 8881040198515)->first(); if (!$account) { - throw new Exception("Statement Account for CIEF LITE not found."); + throw new Exception("Statement Account for AMBANK not found."); } - $statement = AccountStatement::whereDate('date_from', $dateFrom) - ->whereDate('date_to', $dateTo) - ->where('total_amount', $totalTransactions) - ->where('begin_balance', $beginBalance) - ->where('end_balance', $endBalance) + $statement = AccountStatement::whereDate('date_from', $date_from) + ->whereDate('date_to', $date_to) + ->where('total_rows', $total_rows) + ->where('begin_balance', $begin_balance) + ->where('end_balance', $end_balance) ->first(); - if(!$statement){ + if (!$statement) { $statement = new AccountStatement([ - 'date_from' => $dateFrom, - 'date_to' => $dateTo, - 'total_amount' => $totalTransactions, - 'begin_balance' => $beginBalance, - 'end_balance' => $endBalance, + 'statement_account_id' => $account->id, + 'date_from' => $date_from, + 'date_to' => $date_to, + 'total_rows' => $total_rows, + 'begin_balance' => $begin_balance, + 'end_balance' => $end_balance, ]); + $statement->save(); } - $account->statements()->save($statement); - - $collection->map(function ($sheet, $key) use ($statement) { - if ($key === 0) { - $headerColumnKey = $this->findInfoIndexFromExcelCollection($sheet->slice(11), "DATE"); - $dateColumnKey = $this->findInfoIndexFromExcelCollection($sheet->slice(11)[$headerColumnKey], "DATE"); - $descriptionColumnKey = $this->findInfoIndexFromExcelCollection($sheet->slice(11)[$headerColumnKey], "TRANSACTION"); - $debitColumnKey = $this->findInfoIndexFromExcelCollection($sheet->slice(11)[$headerColumnKey], "DEBIT"); - $creditColumnKey = $this->findInfoIndexFromExcelCollection($sheet->slice(11)[$headerColumnKey], "CREDIT"); - $balanceColumnKey = $this->findInfoIndexFromExcelCollection($sheet->slice(11)[$headerColumnKey], "BALANCE"); - } else { - if (strpos($sheet->first()->first(), "DATE") === false) { - return; - } - $headerColumnKey = $this->findInfoIndexFromExcelCollection($sheet, "DATE"); - $dateColumnKey = $this->findInfoIndexFromExcelCollection($sheet[$headerColumnKey], "DATE"); - $descriptionColumnKey = $this->findInfoIndexFromExcelCollection($sheet[$headerColumnKey], "TRANSACTION"); - $debitColumnKey = $this->findInfoIndexFromExcelCollection($sheet[$headerColumnKey], "DEBIT"); - $creditColumnKey = $this->findInfoIndexFromExcelCollection($sheet[$headerColumnKey], "CREDIT"); - $balanceColumnKey = $this->findInfoIndexFromExcelCollection($sheet[$headerColumnKey], "BALANCE"); - } - - $sheet->slice($headerColumnKey + 1)->map(function ($row, $index) use ( - $statement, - $sheet, - $dateColumnKey, - $descriptionColumnKey, - $debitColumnKey, - $creditColumnKey, - $balanceColumnKey, - $key) - { - // if date or balance is null or empty, skip the row - if (!$row[$dateColumnKey] || !$row[$balanceColumnKey]) { - return; + foreach ($collection as $sheet_no => $sheet) { + foreach ($sheet as $row_no => $row) { + if ($row_no < $data_start_from || $row_no > $data_end_at) { + continue; } - $postingDate = carbon::createFromFormat('dM', trim($row[$dateColumnKey])); + $posting_date = Carbon::createFromFormat('d/m/Y', $row[0])->format('Y-m-d'); + $posting_time = Carbon::parse($row[1])->format('H:i:s'); + $transaction_description = trim($row[2]); + $transaction_description_2 = trim($row[3]); + $transaction_description_3 = trim($row[4]); + $transaction_description_4 = trim($row[5]); + $inward_amount = floatval(trim($row[6])); + $outward_amount = floatval(trim($row[7])); + $amount = $inward_amount == 0 ? $outward_amount : $inward_amount; - $description = trim($row[$descriptionColumnKey]); - - $nextRow = $sheet[$index + 1]; - - if (!$nextRow[$dateColumnKey] && $nextRow[$descriptionColumnKey]) { - $nextRowInfoArr = $this->extractInfoFromExcelCollection($nextRow); - foreach ($nextRowInfoArr as $col) { - if ($col) { - $description .= ' '. $col; - } - } + if ($inward_amount == 0) { + $total_debit += 1; + } else { + $total_credit += 1; } - $descriptionArr = explode(',', $description); + $balance = floatval(trim($row[8])); - $transactionDescription = array_key_exists(0, $descriptionArr) ? trim($descriptionArr[0]) : ""; - $description2 = array_key_exists(1, $descriptionArr) ? trim($descriptionArr[1]) : ""; - $description3 = array_key_exists(2, $descriptionArr) ? trim($descriptionArr[2]) : ""; - $description4 = array_key_exists(3, $descriptionArr) ? trim($descriptionArr[3]) : ""; - $description5 = array_key_exists(4, $descriptionArr) ? trim($descriptionArr[4]) : ""; - - if (count($descriptionArr) > 5) { - for ($i = 5; $i < count($descriptionArr); $i++) { - $description5 = array_key_exists($i, $descriptionArr) ? $description5 . " " . trim($descriptionArr[$i]) : $description5; - } - } - - $amount = $row[$creditColumnKey] ? ((float) str_replace(',', '', trim($row[$creditColumnKey]))) : (-((float) str_replace(',', '', $row[$debitColumnKey]))); - $endBalance = ((float) str_replace(',', '', $row[$balanceColumnKey])); - $transaction = new StatementTransaction([ - 'posting_date' => $postingDate, - 'transaction_description' => $transactionDescription, - 'transaction_description_2' => $description2, - 'transaction_description_3' => $description3, - 'transaction_description_4' => $description4, - 'transaction_description_5' => $description5, - 'amount' => $amount, - 'end_balance' => $endBalance, - ]); - - // Check if the transaction already exists for this statement - $existingTransaction = StatementTransaction::whereDate('posting_date', $postingDate) + // Check if the transaction already exists for any statement + $existingTransaction = StatementTransaction::where('posting_date', ($posting_date . ' ' . $posting_time)) ->where('amount', $amount) - ->where('transaction_description', $transactionDescription) - ->whereRaw("CAST(REPLACE(end_balance,',','') AS DECIMAL(15,2)) = ?",[$endBalance]) + ->where('transaction_description', $transaction_description) + ->whereRaw("CAST(REPLACE(end_balance,',','') AS DECIMAL(15,2)) = ?", [$balance]) ->first(); - - if (!$existingTransaction) { - $statement->transactions()->save($transaction); - } - return $transaction; - }); - }); + if (!$existingTransaction) { + $transaction = new StatementTransaction([ + 'account_statement_id' => $statement->id, + 'posting_date' => $posting_date . ' ' . $posting_time, + 'transaction_description' => $transaction_description, + 'transaction_description_2' => $transaction_description_2, + 'transaction_description_3' => $transaction_description_3, + 'transaction_description_4' => $transaction_description_4, + 'amount' => $amount, + 'end_balance' => $balance, + ]); + + $transaction->save(); + } + } + + $statement->total_amount = $total_debit ?: $total_credit; + $statement->save(); + } } return $this->response([]); } - - private function findInfoIndexFromExcelCollection($collection, $keyword) - { - foreach ($collection as $key => $row) { - if ($row instanceof Collection) { - $infoArr = $this->extractInfoFromExcelCollection($row); - foreach ($infoArr as $info) { - if (str_contains(strtolower($info), strtolower($keyword))) { - return $key; - } - } - } else { - if (str_contains(strtolower($row), strtolower($keyword))) { - return $key; - } - } - - } - } - - // return an array with information of the row start from 0 index - private function extractInfoFromExcelCollection($collection) - { - return array_values(array_filter($collection->toArray())); - } - } diff --git a/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php index 1359c99e..bc20fd78 100644 --- a/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php +++ b/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php @@ -183,16 +183,6 @@ class CreateCustomerLogic extends AbstractControllerLogic $this->generateEmailVerificationAttemptProcessor->execute($user); } - $this->newCustomerToVoucherifyProcessor->execute($company->id, $user, true); - - $voucher = $this->createVoucherProcessor->execute($user, Vouchers::WELCOME_50_PERCENT_OFF); - if($voucher){ - $voucherCount = $user->rewards->where('voucher_id', $voucher->id)->count(); - if($voucherCount === 0){ - $this->createsUserReward->execute(null, $user, $voucher->id); - } - } - $shippingCompanyModuleId = null; if ($request->input('shipping_company_module_id')) { $shippingCompanyModuleId = $request->input('shipping_company_module_id'); @@ -206,6 +196,16 @@ class CreateCustomerLogic extends AbstractControllerLogic $this->connectCompanyToShippingCompanyModule->execute($company->id, $shippingCompanyModuleId); } + $this->newCustomerToVoucherifyProcessor->execute($company->id, $user, true); + + $voucher = $this->createVoucherProcessor->execute($user, Vouchers::WELCOME_50_PERCENT_OFF); + if($voucher){ + $voucherCount = $user->rewards->where('voucher_id', $voucher->id)->count(); + if($voucherCount === 0){ + $this->createsUserReward->execute(null, $user, $voucher->id); + } + } + return $this->response($this->authenticationProcessor->execute($request, false)); } diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index e6bf4f1c..5534b6a0 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -113,32 +113,33 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $service_charges_to_refund = $transaction->service_charge; } else { $refundAmount = bcdiv($request->input('amount'), $transaction->currency_rate, 7); - - $bookingAmountBeforeCurrentRefund = $booking->fix_amount - $refundInPending; - - $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); - - $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; - - $voucherCode = null; - $redemptionId = null; - - if ($transaction->voucherRedemption) { - // $voucherCode = $transaction->voucherRedemption->voucher->code; - $redemptionId = $transaction->voucherRedemption->redemption_id; - } - - $conversionObjectBeforeCurrentRefund = new CurrencyConversionObject($bookingAmountBeforeCurrentRefund, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); - - $conversionObjectAfterRefund = new CurrencyConversionObject($isFullyRefund ? $request->input('amount') : $bookingAmountAfterRefunded, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); - - $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); - - $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); - - $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); } + $bookingAmountBeforeCurrentRefund = $booking->fix_amount - $refundInPending; + + $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); + + $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; + + $voucherCode = null; + $redemptionId = null; + + if ($transaction->voucherRedemption) { + // $voucherCode = $transaction->voucherRedemption->voucher->code; + $redemptionId = $transaction->voucherRedemption->redemption_id; + } + + $conversionObjectBeforeCurrentRefund = new CurrencyConversionObject($bookingAmountBeforeCurrentRefund, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); + + $conversionObjectAfterRefund = new CurrencyConversionObject($isFullyRefund ? $request->input('amount') : $bookingAmountAfterRefunded, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); + + $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); + + $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); + + $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); + + // refund service charges if booking is not E2E $refundTotal = $refundAmount; @@ -186,4 +187,4 @@ class CreateBookingRefundLogic extends AbstractControllerLogic } -} \ No newline at end of file +} diff --git a/app/Http/Resources/PaymentTransactionResource.php b/app/Http/Resources/PaymentTransactionResource.php index 73748800..a3de86c6 100644 --- a/app/Http/Resources/PaymentTransactionResource.php +++ b/app/Http/Resources/PaymentTransactionResource.php @@ -20,6 +20,7 @@ class PaymentTransactionResource extends JsonResource public function toArray($request) { $current_running_balance = $request['running_balance']; + $booking = null; //cief todo: 66 $bank = null; //Check if Transaction of type PAYMENT has an override for recipient bank - starts diff --git a/app/Models/Remark.php b/app/Models/Remark.php index f2de3a5c..271b4d4b 100644 --- a/app/Models/Remark.php +++ b/app/Models/Remark.php @@ -12,6 +12,14 @@ class Remark extends AbstractModel protected $table = 'remarks'; + protected $fillable = [ + 'owner_id', + 'owner_type', + 'commenter_id', + 'content', + 'type' + ]; + public function owner(): morphTo { return $this->morphTo(); diff --git a/app/Models/WorkflowTimestamp.php b/app/Models/WorkflowTimestamp.php new file mode 100644 index 00000000..5cc6a17d --- /dev/null +++ b/app/Models/WorkflowTimestamp.php @@ -0,0 +1,49 @@ + 'datetime', + ]; + + /** + * Get the user that owns the workflow timestamp. + */ + public function user() + { + return $this->belongsTo(User::class, 'userId'); + } +} diff --git a/database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php b/database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php new file mode 100644 index 00000000..203c58bd --- /dev/null +++ b/database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php @@ -0,0 +1,36 @@ +id(); + $table->string('current_node'); + $table->string('next_node'); + $table->integer('seconds'); + $table->unsignedBigInteger('user_id'); + $table->string('session_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('workflow_timestamps'); + } +} diff --git a/database/migrations/2024_08_24_183417_update_voucher_campaigns_table.php b/database/migrations/2024_08_24_183417_update_voucher_campaigns_table.php new file mode 100644 index 00000000..c24f918f --- /dev/null +++ b/database/migrations/2024_08_24_183417_update_voucher_campaigns_table.php @@ -0,0 +1,59 @@ +where('id', 1)->update(['campaign_id' => 'camp_snxv2JQlh5v9LEDBbIBOnibD']); + DB::table('voucher_campaigns')->where('id', 2)->update(['campaign_id' => 'camp_lEM7WhLHFlhcRKRR0C4bXH0F']); + DB::table('voucher_campaigns')->where('id', 3)->update(['campaign_id' => 'camp_JP9qBGBYEinVjzAE1vjynMe0']); + + $voucherCampaignIds = [1, 2, 3]; + foreach ($voucherCampaignIds as $id) { + $campaignId = DB::table('voucher_campaigns')->where('id', $id)->value('campaign_id'); + $ownerId = DB::table('voucher_campaigns')->where('id', $id)->value('id'); + $upperCampaignId = strtoupper($campaignId); + + $keysToUpdate = DB::table('key_value_pairs') + ->where('key', 'like', '%_TOTAL%') + ->where('owner_type', 'App\Models\VoucherCampaign') + ->where('owner_id', (int) $ownerId) + ->get(); + + foreach ($keysToUpdate as $entry) { + $parts = explode('_', $entry->key); + $lastTwoParts = array_slice($parts, -2); // Get the last two elements + $newKey = "{$upperCampaignId}_" . implode('_', $lastTwoParts); + + DB::table('key_value_pairs') + ->where('id', $entry->id) + ->update(['key' => $newKey]); + } + } + } + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (env('APP_ENV') !== 'production') { + DB::table('voucher_campaigns')->where('id', 1)->update(['campaign_id' => 'camp_0pXJ11fNxzLjNNVIJ1DCeTW1']); + DB::table('voucher_campaigns')->where('id', 2)->update(['campaign_id' => 'camp_pkLMhccKn0r74L61Fc36wYum']); + DB::table('voucher_campaigns')->where('id', 3)->update(['campaign_id' => 'camp_ZK6VwLHI9Ij8lBz5kAxcVy15']); + } + } +} diff --git a/resources/assets/vue/components/accounting/forms/ImportStatementFormComponent.vue b/resources/assets/vue/components/accounting/forms/ImportStatementFormComponent.vue index f4aa76a2..723abb9f 100644 --- a/resources/assets/vue/components/accounting/forms/ImportStatementFormComponent.vue +++ b/resources/assets/vue/components/accounting/forms/ImportStatementFormComponent.vue @@ -70,7 +70,10 @@ export default { } else if (this.statementType.includes('LITE')) { this.submit(this.route('api.accounting.statement.import.cief.lite'), 'post', this.section, true, false) } - } + }, + errorHandler(error){ + this.formHandler(error.message); + }, }, mixins: [formHandler] } diff --git a/resources/assets/vue/components/accounts/elements/VouchersNavigationBarComponent.vue b/resources/assets/vue/components/accounts/elements/VouchersNavigationBarComponent.vue index 60947cb9..ed2d8a93 100644 --- a/resources/assets/vue/components/accounts/elements/VouchersNavigationBarComponent.vue +++ b/resources/assets/vue/components/accounts/elements/VouchersNavigationBarComponent.vue @@ -16,7 +16,7 @@ } }, created(){ - this.submit(this.route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all': true, order_by:{ column:'id', DESC:true }} ), 'get', 'voucherNavigationSection', false, false); + this.submit(this.route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_user': true, order_by:{ column:'id', DESC:true }} ), 'get', 'voucherNavigationSection', false, false); }, methods: { successHandler(response){ diff --git a/resources/assets/vue/components/general/elements/VouchersSummaryAdminComponent.vue b/resources/assets/vue/components/general/elements/VouchersSummaryAdminComponent.vue index dc4a2a54..9a3987e6 100644 --- a/resources/assets/vue/components/general/elements/VouchersSummaryAdminComponent.vue +++ b/resources/assets/vue/components/general/elements/VouchersSummaryAdminComponent.vue @@ -30,7 +30,7 @@ } }, created(){ - this.submit(this.route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all': this.company.employee.id, order_by:{ column:'id', DESC:true }} ), 'get', this.section, false, false); + this.submit(this.route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_user': this.company.employee.id, order_by:{ column:'id', DESC:true }} ), 'get', this.section, false, false); }, methods: { successHandler(response){ diff --git a/resources/assets/vue/components/general/forms/FileUploadComponent.vue b/resources/assets/vue/components/general/forms/FileUploadComponent.vue index 15594912..5f591744 100644 --- a/resources/assets/vue/components/general/forms/FileUploadComponent.vue +++ b/resources/assets/vue/components/general/forms/FileUploadComponent.vue @@ -81,7 +81,7 @@ url: '#', autoQueue: false, processQueue: false, - acceptedFiles: 'image/*, application/*', + acceptedFiles: 'image/*, application/*, text/csv', uploadMultiple: true, clickable: '.select-btn', previewTemplate: '
+ ORDER Marking:+ |
+
+ {{ externalApiResponse.data.booking_marking + }}+ |
+
+ 1688 LOGIN ID/EMAIL/PHONE: ++ |
+
+ {{ externalApiResponse.data.account_no }}+ |
+
+ 1688 LOGIN PASSWORD: ++ |
+
+ {{ externalApiResponse.data.holder_name }}+ |
+
+ ALIPAY 6-DIGIT PAYMENT PIN: ++ |
+
+ {{ externalApiResponse.data.pin }}+ |
+