mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
add reporting for download history import mapped invoice and receipt and with fix bug
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class GroupByImportedDate implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->groupby('imported_date');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ImportedDateFrom implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDate('imported_date', '>=', date('Y-m-d',strtotime($value)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ImportedDateTo implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDate('imported_date', '<=', date('Y-m-d',strtotime($value)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class StatementTransactionInvoiceReference implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('owners', function ($query) use ($value) {
|
||||
return $query->where('Invoice_reference', $value);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class StatementTransactionOwnerReference implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('owners', function ($query) use ($value) {
|
||||
return $query->where('owner_reference', $value);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class StatementTransactionReceiptReference implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('owners', function ($query) use ($value) {
|
||||
return $query->where('receipt_reference', $value);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounting\ControllersLogic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Http\Resources\TransactionMappingLogResource;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Accounting\Services\ListTransactionMappingLogs;
|
||||
|
||||
|
||||
class HistoryImportedTransactionMappedControllerLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Retrieved History Imported Invoices',
|
||||
'message' => 'You have successfully retrieved history imported invoices'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var ListTransactionMappingLogs */
|
||||
private $listTransactionMappingLogs;
|
||||
|
||||
/**
|
||||
* UpdateAnnouncementLogic constructor.
|
||||
* @param ListTransactionMappingLogs $listTransactionMappingLogs
|
||||
*/
|
||||
public function __construct(
|
||||
ListTransactionMappingLogs $listTransactionMappingLogs
|
||||
) {
|
||||
$this->listTransactionMappingLogs = $listTransactionMappingLogs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
$query = $this->listTransactionMappingLogs->execute($this->listTransactionMappingLogs->deserializeFilters($request->input('filters')));
|
||||
|
||||
return $this->collectionResponse(TransactionMappingLogResource::collection($query));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounting\Services;
|
||||
|
||||
use App\Models\TransactionMappingLog;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Classes\General\Eloquent\AbstractListRecord;
|
||||
|
||||
class ListTransactionMappingLogs extends AbstractListRecord
|
||||
{
|
||||
|
||||
/** @var TransactionMappingLog */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* ListsBankStatementDetails constructor.
|
||||
* @param TransactionMappingLog $repository
|
||||
*/
|
||||
public function __construct(TransactionMappingLog $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
public function getRepository(): Builder
|
||||
{
|
||||
return $this->repository->newQuery();
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,6 @@ class ExportsImportedInvoiceMappeds implements FromQuery, WithHeadings, WithHead
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
// dd($transaction);
|
||||
$this->count += 1;
|
||||
$data = $transaction->data;
|
||||
return [
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\TransactionMappingLog;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
|
||||
class ExportsImportedReceiptMappeds implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
private $dateTime;
|
||||
private $count;
|
||||
private $counter = 1;
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->dateTime = $request->input('date').' '.$request->input('time');
|
||||
$this->count = 0;
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Check',
|
||||
'Doc No',
|
||||
'Doc Date',
|
||||
'Debtor Code',
|
||||
'Company Name',
|
||||
'Description',
|
||||
'Payment Amount',
|
||||
'Created User',
|
||||
'Curr.',
|
||||
'To Home Rate',
|
||||
'Local Payment Amount',
|
||||
'Cancelled',
|
||||
'Mapped Status',
|
||||
'Mapped Reference No',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
return TransactionMappingLog::where('imported_date', $this->dateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Transaction $transaction
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
$this->count += 1;
|
||||
$data = $transaction->data;
|
||||
return [
|
||||
$this->count,
|
||||
Arr::get($data,'doc_no'),
|
||||
Arr::get($data,'doc_date'),
|
||||
Arr::get($data,'debtor_code'),
|
||||
Arr::get($data,'company_name'),
|
||||
Arr::get($data,'description'),
|
||||
Arr::get($data,'payment_amount'),
|
||||
Arr::get($data,'created_user'),
|
||||
Arr::get($data,'curr'),
|
||||
Arr::get($data,'to_home_rate'),
|
||||
Arr::get($data,'local_payment_amount'),
|
||||
Arr::get($data,'cancelled'),
|
||||
Arr::get($data,'2nd_doc_no'),
|
||||
Arr::get($data,'mapped_status'),
|
||||
Arr::get($data,'mapped_result_reference'),
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Accounting;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Classes\Modules\Accounting\ControllersLogic\HistoryImportedTransactionMappedControllerLogic;
|
||||
|
||||
class HistoryImportedTransactionMappedController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ApprovePaymentLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function getImported(Request $request, HistoryImportedTransactionMappedControllerLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ use Maatwebsite\Excel\Excel;
|
||||
use App\Classes\Modules\Exports\Services\ExportsImportedInvoiceMappeds;
|
||||
use App\Models\TransactionMappingLog;
|
||||
use App\Classes\Modules\Exports\Services\ExportsReceiptTransactions;
|
||||
use App\Classes\Modules\Exports\Services\ExportsImportedReceiptMappeds;
|
||||
|
||||
class ExportCustomersToExcelController
|
||||
{
|
||||
@@ -91,4 +92,10 @@ class ExportCustomersToExcelController
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function importedReceiptMapped(ExportsImportedReceiptMappeds $exportsImportedReceiptMappeds, Request $request) {
|
||||
$response = $exportsImportedReceiptMappeds->download($request->input('fileName').'.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,7 @@ class ImportStatementInvoiceController
|
||||
|
||||
TransactionMappingLog::create([
|
||||
'imported_date'=>$importDate,
|
||||
'type' => 'invoices',
|
||||
'data'=>$row,
|
||||
]);
|
||||
array_push($data, $row);
|
||||
|
||||
@@ -69,6 +69,7 @@ class ImportStatementReceiptsController
|
||||
|
||||
TransactionMappingLog::create([
|
||||
'imported_date'=>$importDate,
|
||||
'type' => 'receipts',
|
||||
'data'=>$row,
|
||||
]);
|
||||
array_push($data, $row);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TransactionMappingLogResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'imported_date' => $this->imported_date,
|
||||
'type' => $this->type
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TransactionMappingLog extends Model
|
||||
{
|
||||
protected $fillable = ['imported_by','data','imported_date'];
|
||||
protected $fillable = ['imported_by','data','imported_date','type'];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'array',
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddTypeToTransactionMappingLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('transaction_mapping_logs', function (Blueprint $table) {
|
||||
$table->string('type',50)->default('invoices')->after('imported_date');
|
||||
});
|
||||
|
||||
foreach (DB::table('transaction_mapping_logs')->get() as $key => $value) {
|
||||
$data = json_decode($value->data);
|
||||
DB::table('transaction_mapping_logs')->where('id',$value->id)->update([
|
||||
'type' => (isset($data->description) ? 'receipts' : 'invoices')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('transaction_mapping_logs', function (Blueprint $table) {
|
||||
$table->dropColumn('type');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div class="row m-b-10 parentContainer">
|
||||
<div class="col">
|
||||
<div class="row p-b-10 b-b b-grey">
|
||||
<div class="col-2">{{ item.imported_date }}</div>
|
||||
<div class="col-2">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none m-r-5" @click="downloadInvoiceMapped(item.imported_date)">
|
||||
Download Invoices Mapped
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
props: {
|
||||
stage: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
section:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
downloadInvoiceMapped(importedDate) {
|
||||
var arrDateTime = importedDate.split(" ");
|
||||
const fileName = 'InvoiceMapped';
|
||||
|
||||
window.open(this.route('importedInvoiceMapped.export')+'?date='+arrDateTime[0]+'&time='+arrDateTime[1]+'&fileName='+fileName, '_blank');
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div class="row m-b-10 parentContainer">
|
||||
<div class="col">
|
||||
<div class="row p-b-10 b-b b-grey">
|
||||
<div class="col-2">{{ item.imported_date }}</div>
|
||||
<div class="col-2">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none m-r-5" @click="downloadInvoiceMapped(item.imported_date)">
|
||||
Download Receipts Mapped
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
props: {
|
||||
stage: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
section:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
downloadInvoiceMapped(importedDate) {
|
||||
var arrDateTime = importedDate.split(" ");
|
||||
const fileName = 'ReceiptMapped';
|
||||
|
||||
window.open(this.route('importedReceiptMapped.export')+'?date='+arrDateTime[0]+'&time='+arrDateTime[1]+'&fileName='+fileName, '_blank');
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
+4
-8
@@ -98,21 +98,17 @@
|
||||
},
|
||||
methods: {
|
||||
appendComponentTitle() {
|
||||
this.componentTitle = this.section == 'importInvoiceMapping' ? 'Imported Invoices Mapped' : 'Imported Receipts Mapped';
|
||||
this.componentTitle = 'Imported Invoices Mapped';
|
||||
},
|
||||
appendComponentTableHeader() {
|
||||
if (this.section == 'importInvoiceMapping') {
|
||||
this.tableHeaders = ['No','Doc No','Date','Debtor Code','Debtor Name','Shipping Info','Net Total','Cancelled','Mapped Status','Mapped Reference No','Payment Received Date'];
|
||||
} else {
|
||||
this.tableHeaders = ['No','OR No','Date','Creditor Code','Creditor Name','Shipping Info','Net Total','Cancelled','Mapped Status','Mapped Reference No'];
|
||||
}
|
||||
this.tableHeaders = ['No','Doc No','Date','Debtor Code','Debtor Name','Shipping Info','Net Total','Cancelled','Mapped Status','Mapped Reference No','Payment Received Date'];
|
||||
},
|
||||
importInvoice(){
|
||||
this.isLoading = true;
|
||||
this.parameters = {
|
||||
files: this.files
|
||||
};
|
||||
this.submit(this.route('api.'+(this.section == 'importInvoiceMapping' ? 'import_invoices' : 'import_receipts')+'.upload'), 'post', this.section, true, false);
|
||||
this.submit(this.route('api.import_invoices.upload'), 'post', this.section, true, false);
|
||||
},
|
||||
|
||||
successHandler(response){
|
||||
@@ -128,7 +124,7 @@
|
||||
|
||||
downloadInvoiceMapped() {
|
||||
var arrDateTime = this.importedDate.split(" ");
|
||||
const fileName = this.section == 'importInvoiceMapping' ? 'InvoiceMapped' : 'ReceiptMapped';
|
||||
const fileName = 'importInvoiceMapping';
|
||||
|
||||
window.open(this.route('importedInvoiceMapped.export')+'?date='+arrDateTime[0]+'&time='+arrDateTime[1]+'&fileName='+fileName, '_blank');
|
||||
},
|
||||
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<div class="row h-100 parentContainer">
|
||||
<div class="col-12" style="min-height: 20px;">
|
||||
<loading-component style="height: 20px; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>{{ componentTitle }}</h3>
|
||||
<div class="row m-b-10 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
||||
<div class="col">
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none m-r-5" @click="downloadInvoiceMapped">
|
||||
Download Receipts Mapped
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body table-responsive p-0">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="item in tableHeaders">{{ item }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody v-show="!isLoading">
|
||||
<tr v-for="(item, index) in $store.getters.getListData(section)">
|
||||
<td>{{index+1}}</td>
|
||||
<td>{{item.check }}</td>
|
||||
<td>{{item.doc_no}}</td>
|
||||
<td>{{item.doc_date }}}</td>
|
||||
<td>{{item.debtor_code}}</td>
|
||||
<td>{{item.company_name}}</td>
|
||||
<td>{{item.description}}</td>
|
||||
<td>{{item.payment_amount}}</td>
|
||||
<td>{{item.created_user}}</td>
|
||||
<td>{{item.curr}}</td>
|
||||
<td>{{item.to_home_rate}}</td>
|
||||
<td>{{item.local_payment_amount}}</td>
|
||||
<td>{{item.cancelled}}</td>
|
||||
<td>{{item.mapped_status}}</td>
|
||||
<td>{{item.mapped_result_reference}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<pagination-component :section="section" class="mb-5" ref="pagination"></pagination-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
files: {
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
section:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
error: '',
|
||||
importedDate: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pendingQueue() {
|
||||
return this.$store.getters.isInCompleteQueue(this.section);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pendingQueue(inComplete, oldValue){
|
||||
if(inComplete){
|
||||
this.importInvoice();
|
||||
}
|
||||
},
|
||||
},
|
||||
created(){
|
||||
this.appendComponentTitle();
|
||||
this.appendComponentTableHeader();
|
||||
this.$store.dispatch('updateListQueue', {'name': this.section});
|
||||
},
|
||||
methods: {
|
||||
appendComponentTitle() {
|
||||
this.componentTitle = 'Imported Receipts Mapped';
|
||||
},
|
||||
appendComponentTableHeader() {
|
||||
this.tableHeaders = ['Check','Doc No','Doc Date','Debtor Code','Company Name','Description','Payment Amount','Created User','Curr.','To Home Rate','Local Payment Amount','Cancelled','Mapped Status','Mapped Reference No'];
|
||||
},
|
||||
importInvoice(){
|
||||
this.isLoading = true;
|
||||
this.parameters = {
|
||||
files: this.files
|
||||
};
|
||||
this.submit(this.route('api.import_receipts.upload'), 'post', this.section, true, false);
|
||||
},
|
||||
|
||||
successHandler(response){
|
||||
this.$store.dispatch('completeList', {'name': this.section, 'data': response.payload.data});
|
||||
this.importedDate = response.payload.importedDate;
|
||||
this.isLoading = false;
|
||||
},
|
||||
|
||||
errorHandler(error){
|
||||
this.isLoading = false;
|
||||
this.error = error.message;
|
||||
},
|
||||
|
||||
downloadInvoiceMapped() {
|
||||
var arrDateTime = this.importedDate.split(" ");
|
||||
const fileName = 'ReceiptMapped';
|
||||
|
||||
window.open(this.route('importedReceiptMapped.export')+'?date='+arrDateTime[0]+'&time='+arrDateTime[1]+'&fileName='+fileName, '_blank');
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
+215
-7
@@ -3,19 +3,74 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row justify-content-center align-items-center m-t-50 m-b-50" v-show="step === 0">
|
||||
<div class="col-5">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getReportFilter()">Mapped Report</div>
|
||||
<div class="justify-content-center align-items-center m-t-50 m-b-50" v-show="step === 0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getReportFilter()">Mapped Report</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getHistoryImportedInvReport()">History Imported Invoices Report</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getHistoryImportedRecReport()">History Imported Receipts Report</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="step == 1">
|
||||
<div class="row" v-if="step > 0 && report == 'mappedRecords'">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="justify-content-center align-items-center m-t-50 m-b-50">
|
||||
<div class="row mb-3">
|
||||
<div class="col-4">
|
||||
<validation-wrapper-component :validator="$v.parameters.owner_reference">
|
||||
<label class="text-primary">Reference</label>
|
||||
<input type="text" class="form-control" v-model="parameters.owner_reference">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<validation-wrapper-component :validator="$v.parameters.invoice_reference">
|
||||
<label class="text-primary">Invoice Reference</label>
|
||||
<input type="text" class="form-control" v-model="parameters.invoice_reference">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<validation-wrapper-component :validator="$v.parameters.receipt_reference">
|
||||
<label class="text-primary">Receipt Reference</label>
|
||||
<input type="text" class="form-control" v-model="parameters.receipt_reference">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component :validator="$v.parameters.startDate">
|
||||
<label class="all-caps">Start Date</label>
|
||||
<date-picker-component :parameters="parameters" v-model.lazy="parameters.startDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component :validator="$v.parameters.endDate">
|
||||
<label class="all-caps">End Date</label>
|
||||
<date-picker-component :parameters="parameters" v-model.lazy="parameters.endDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getReportFilter()">Mapped Report</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<div class="row p-t-10 p-b-10 b-b b-grey text-master-light">
|
||||
@@ -35,7 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<list-component ref="TransactionsMappedList" section="TransactionsMappedSection" :endpoint="route('api.accounting.bank.transaction')" :options="filter">
|
||||
<list-component :key="step" ref="TransactionsMappedList" section="TransactionsMappedSection" :endpoint="route('api.accounting.bank.transaction')" :options="filter">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<statement-transaction-mapped-component :data="data" :section="section"></statement-transaction-mapped-component>
|
||||
</template>
|
||||
@@ -44,22 +99,175 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- report for imported Invoices -->
|
||||
<div class="row" v-if="step > 0 && report == 'importedInv'">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="justify-content-center align-items-center m-t-50 m-b-50">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component :validator="$v.parameters.startDate">
|
||||
<label class="all-caps">Start Date</label>
|
||||
<date-picker-component :parameters="parameters" v-model.lazy="parameters.startDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component :validator="$v.parameters.endDate">
|
||||
<label class="all-caps">End Date</label>
|
||||
<date-picker-component :parameters="parameters" v-model.lazy="parameters.endDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getHistoryImportedInvReport()">History Imported Invoices Report</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<div class="row p-t-10 p-b-10 b-b b-grey text-master-light">
|
||||
<div class="col-2">Date</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<list-component :key="step" ref="HistoryImportedInvList" section="HistoryImportedInvSection" :endpoint="route('api.accounting.history.imported')" :options="filter">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<history-imported-invoices :data="data" :section="section"></history-imported-invoices>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- report for imported Receipts -->
|
||||
<div class="row" v-if="step > 0 && report == 'importedRec'">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="justify-content-center align-items-center m-t-50 m-b-50">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component :validator="$v.parameters.startDate">
|
||||
<label class="all-caps">Start Date</label>
|
||||
<date-picker-component :parameters="parameters" v-model.lazy="parameters.startDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component :validator="$v.parameters.endDate">
|
||||
<label class="all-caps">End Date</label>
|
||||
<date-picker-component :parameters="parameters" v-model.lazy="parameters.endDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row text-center">
|
||||
<div class="col b-a b-grey padding-20 m-r-15 pointer bg-complete text-white" @click="getHistoryImportedRecReport()">History Imported Receipts Report</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<div class="row p-t-10 p-b-10 b-b b-grey text-master-light">
|
||||
<div class="col-2">Date</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<list-component :key="step" ref="HistoryImportedRecList" section="HistoryImportedRecSection" :endpoint="route('api.accounting.history.imported')" :options="filter">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<history-imported-receipts :data="data" :section="section"></history-imported-receipts>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
parameters: {
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
owner_reference: '',
|
||||
invoice_reference: '',
|
||||
receipt_reference: ''
|
||||
},
|
||||
step: 0,
|
||||
filter: {},
|
||||
report: ''
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
startDate: {
|
||||
required
|
||||
},
|
||||
endDate: {
|
||||
required
|
||||
},
|
||||
owner_reference: {},
|
||||
invoice_reference: {},
|
||||
receipt_reference: {}
|
||||
},
|
||||
},
|
||||
created(){
|
||||
this.parameters.startDate = this.startDate();
|
||||
this.parameters.endDate = this.endDate();
|
||||
},
|
||||
methods: {
|
||||
startDate() {
|
||||
var date = new Date();
|
||||
return '01-'+(date.getMonth() + 1)+'-'+date.getFullYear();
|
||||
},
|
||||
endDate() {
|
||||
var date = new Date();
|
||||
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
||||
return lastDay.getDate()+'-'+(lastDay.getMonth() + 1)+'-'+lastDay.getFullYear();
|
||||
},
|
||||
getReportFilter() {
|
||||
this.filter = {min_amount: 0, is_mapped: true, statement_transaction_owner_type_in: [1, 2], statement_transaction_owner_status_in: [3], per_page: 100, order_by: {column: 'posting_date', DESC: true}};
|
||||
|
||||
this.step = 1
|
||||
this.filter = {...this.filter, ...{statement_transaction_posting_start: this.parameters.startDate}};
|
||||
this.filter = {...this.filter, ...{statement_transaction_posting_end:this.parameters.endDate}}
|
||||
|
||||
if (typeof this.parameters.owner_reference != 'undefined' && this.parameters.owner_reference != '') this.filter = {...this.filter, ...{statement_transaction_owner_reference: this.parameters.owner_reference}};
|
||||
|
||||
if (typeof this.parameters.invoice_reference != 'undefined' && this.parameters.invoice_reference != '') this.filter = {...this.filter, ...{statement_transaction_invoice_reference: this.parameters.invoice_reference}};
|
||||
|
||||
if (typeof this.parameters.receipt_reference != 'undefined' && this.parameters.receipt_reference != '') this.filter = {...this.filter, ...{statement_transaction_receipt_reference: this.parameters.receipt_reference}};
|
||||
|
||||
this.step = this.step + 1;
|
||||
this.report = 'mappedRecords';
|
||||
},
|
||||
getHistoryImportedRecReport() {
|
||||
this.filter = {
|
||||
imported_date_from: this.parameters.startDate,
|
||||
imported_date_to:this.parameters.endDate,
|
||||
group_by_imported_date:true,
|
||||
type:'receipts'
|
||||
};
|
||||
this.step = this.step + 1;
|
||||
this.report = 'importedRec';
|
||||
},
|
||||
getHistoryImportedInvReport() {
|
||||
this.filter = {
|
||||
imported_date_from: this.parameters.startDate,
|
||||
imported_date_to:this.parameters.endDate,
|
||||
group_by_imported_date:true,
|
||||
type:'invoices'
|
||||
};
|
||||
this.step = this.step + 1;
|
||||
this.report = 'importedInv';
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
+8
-7
@@ -168,7 +168,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="ModalImportInvoice">
|
||||
<imported-invoice-mapped-component section="importInvoiceMapping" v-if="mappedTrue" :files="files"></imported-invoice-mapped-component>
|
||||
<imported-invoice-mapped-component section="importInvoiceMapping" v-if="invMappedTrue" :files="files"></imported-invoice-mapped-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -196,7 +196,7 @@
|
||||
</file-input-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn btn-lg btn-primary m-t-20 requestModal" data-type="ModalImportInvoice" @click="importReceipts">Import Receipts</div>
|
||||
<div class="btn btn-lg btn-primary m-t-20 requestModal" data-type="ModalImportReceipt" @click="importReceipts">Import Receipts</div>
|
||||
<!-- todo-new: delete later --><br><div class="btn btn-lg btn-primary m-t-20" @click="exportStage++">Nest Step</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
@@ -206,8 +206,8 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="ModalImportInvoice">
|
||||
<imported-invoice-mapped-component section="importReceiptMapping" v-if="mappedTrue" :files="files"></imported-invoice-mapped-component>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="ModalImportReceipt">
|
||||
<imported-receipt-mapped-component section="importReceiptMapping" v-if="recMappedTrue" :files="files"></imported-receipt-mapped-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -245,7 +245,8 @@ export default {
|
||||
files: [],
|
||||
parameters: {},
|
||||
section: 'bankTransactionSection',
|
||||
mappedTrue: false,
|
||||
invMappedTrue: false,
|
||||
recMappedTrue: false,
|
||||
selectAll: false,
|
||||
}
|
||||
},
|
||||
@@ -265,10 +266,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
importInvoice(){
|
||||
this.mappedTrue = true;
|
||||
this.invMappedTrue = true;
|
||||
},
|
||||
importReceipts(){
|
||||
this.mappedTrue = true;
|
||||
this.recMappedTrue = true;
|
||||
},
|
||||
exportInvoiceToAutoCount(){
|
||||
const checkedStatementTransactions = this.getCheckedStatementOwners();
|
||||
|
||||
@@ -18,4 +18,7 @@ Route::group(['prefix' => 'accounting', 'as' => 'accounting.', 'namespace' => 'A
|
||||
Route::post('/owner/group-approve', 'GroupApproveStatementTransactionController@approve')->name('owner.groupApprove');
|
||||
Route::post('/{id}/owner/{status}', 'UpdateStatementTransactionStatusController@update')->where('status', 'approve|reject')->name('owner.status.update');
|
||||
});
|
||||
|
||||
Route::get('history/imported', 'HistoryImportedTransactionMappedController@getImported')->name('history.imported');
|
||||
|
||||
});
|
||||
|
||||
@@ -272,6 +272,7 @@ Route::get('/export/booking-transactions', 'Exports\ExportCustomersToExcelContro
|
||||
Route::get('/export/invoice-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@invoiceTransactions')->name('invoiceTransactions.export');
|
||||
Route::get('/export/receipt-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@receiptTransactions')->name('receiptTransactions.export');
|
||||
Route::get('/export/imported-invoice-mapped', 'Exports\ExportCustomersToExcelController@importedInvoiceMapped')->name('importedInvoiceMapped.export');
|
||||
Route::get('/export/imported-receipt-mapped', 'Exports\ExportCustomersToExcelController@importedReceiptMapped')->name('importedReceiptMapped.export');
|
||||
|
||||
Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) {
|
||||
$bookings = Booking::where(function($query){
|
||||
|
||||
Reference in New Issue
Block a user