mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - New reports (EXC2009: Sales Deposit pay by Wallet Deposit)
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
|
||||
|
||||
class ProcessSalesDepositByWalletPaymentEntryV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var array */
|
||||
private $details;
|
||||
|
||||
/**
|
||||
* ProcessSalesDepositByWalletPaymentEntryV2CommandJob constructor.
|
||||
* @param array $details
|
||||
*/
|
||||
public function __construct(array $details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Processing single record from 01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY] Import.');
|
||||
$start = new Carbon();
|
||||
|
||||
$docNo = $this->details['docno'] ?? null;
|
||||
$docDate = $this->details['docdate'] ?? null;
|
||||
$debtorCode = $this->details['debtorcode'] ?? null;
|
||||
$description = $this->details['description'] ?? null;
|
||||
$paymentMethod = $this->details['paymentmethod'] ?? null;
|
||||
$paymentAmt = $this->details['paymentamt'] ?? null;
|
||||
|
||||
Log::info("Processing Sales Deposit By Wallet [Payment Entry] Report:", [
|
||||
'DocNo' => $docNo,
|
||||
'DocDate' => $docDate,
|
||||
'DebtorCode' => $debtorCode,
|
||||
'Description' => $description,
|
||||
'PaymentMethod' => $paymentMethod,
|
||||
'PaymentAmt' => $paymentAmt,
|
||||
]);
|
||||
|
||||
$transaction = Transaction::where('bill_no', $description)->first();
|
||||
if($transaction){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_OFFICIAL_RECEIPT, $docNo);
|
||||
}
|
||||
// if($docDate){
|
||||
// $this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCDATE_OFFICIAL_RECEIPT, is_numeric($docDate) ? $this->convertDocDateToString($docDate) : $docDate);
|
||||
// }
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Processing single record from 01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY] Import. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
|
||||
|
||||
private function updateOrCreateKeyValuePair($booking, $key, $value)
|
||||
{
|
||||
$keyValuePairObject = new KeyValuePairObject($key, $value);
|
||||
$metadata = $booking->attributesKVP()->where('key', $key)->first();
|
||||
|
||||
if ($metadata) {
|
||||
(App()->make(UpdatesKeyValuePair::class))->execute($metadata, $keyValuePairObject);
|
||||
} else {
|
||||
(App()->make(CreatesKeyValuePair::class))->execute($booking, $keyValuePairObject);
|
||||
}
|
||||
}
|
||||
|
||||
private function convertDocDateToString($value, $format = 'm/d/Y') {
|
||||
if (is_numeric($value)) {
|
||||
return Carbon::instance(Date::excelToDateTimeObject($value))->format($format);
|
||||
}
|
||||
return Carbon::parse($value)->format($format);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
|
||||
class ProcessSalesDepositByWalletRefundEntryV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var array */
|
||||
private $details;
|
||||
|
||||
/**
|
||||
* ProcessSalesDepositByWalletRefundEntryV2CommandJob constructor.
|
||||
* @param array $details
|
||||
*/
|
||||
public function __construct(array $details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Processing single record from 01DRF - Sales Deposit by Wallet [AR REFUND ENTRY] Import.');
|
||||
$start = new Carbon();
|
||||
|
||||
$docNo = $this->details['docno'] ?? null;
|
||||
$debtorCode = $this->details['debtorcode'] ?? null;
|
||||
$docDate = $this->details['docdate'] ?? null;
|
||||
$description = $this->details['description'] ?? null;
|
||||
$deptNo = $this->details['deptno'] ?? null;
|
||||
$paymentMethod = $this->details['paymentmethod'] ?? null;
|
||||
$knockOffDocType = $this->details['knockoffdoctype'] ?? null;
|
||||
$knockOffDocNo = $this->details['knockoffdocno'] ?? null;
|
||||
$knockOffAmt = $this->details['knockoffamt'] ?? null;
|
||||
|
||||
Log::info("Processing Sales Deposit By Wallet [Refund Entry] Report:", [
|
||||
'DocNo' => $docNo,
|
||||
'DebtorCode' => $debtorCode,
|
||||
'DocDate' => $docDate,
|
||||
'Description' => $description,
|
||||
'DeptNo' => $deptNo,
|
||||
'PaymentMethod' => $paymentMethod,
|
||||
'KnockOffDocType' => $knockOffDocType,
|
||||
'KnockOffDocNo' => $knockOffDocNo,
|
||||
'KnockOffAmt' => $knockOffAmt,
|
||||
]);
|
||||
|
||||
$transaction = Transaction::where('bill_no', $description)->first();
|
||||
if($transaction){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_REFUND, $docNo);
|
||||
}
|
||||
// if($docDate){
|
||||
// $this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCDATE_REFUND, is_numeric($docDate) ? $this->convertDocDateToString($docDate) : $docDate);
|
||||
// }
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Processing single record from 01DRF - Sales Deposit by Wallet [AR REFUND ENTRY] Import. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
|
||||
|
||||
private function updateOrCreateKeyValuePair($booking, $key, $value)
|
||||
{
|
||||
$keyValuePairObject = new KeyValuePairObject($key, $value);
|
||||
$metadata = $booking->attributesKVP()->where('key', $key)->first();
|
||||
|
||||
if ($metadata) {
|
||||
(App()->make(UpdatesKeyValuePair::class))->execute($metadata, $keyValuePairObject);
|
||||
} else {
|
||||
(App()->make(CreatesKeyValuePair::class))->execute($booking, $keyValuePairObject);
|
||||
}
|
||||
}
|
||||
|
||||
private function convertDocDateToString($value, $format = 'm/d/Y') {
|
||||
if (is_numeric($value)) {
|
||||
return Carbon::instance(Date::excelToDateTimeObject($value))->format($format);
|
||||
}
|
||||
|
||||
return Carbon::parse($value)->format($format);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Wallet;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ExportsSalesDepositByWallet1PaymentEntry implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
protected $startDate;
|
||||
protected $endDate;
|
||||
|
||||
public function __construct($startDate = null, $endDate = null) {
|
||||
$this->startDate = $startDate ? Carbon::parse($startDate)->startOfDay() : Carbon::now()->subMonths(1);
|
||||
$this->endDate = $endDate ? Carbon::parse($endDate)->endOfDay() : Carbon::now();
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'DocNo',
|
||||
'DocDate',
|
||||
'DebtorCode',
|
||||
'Description',
|
||||
'DeptNo',
|
||||
'PaymentMethod',
|
||||
'PaymentAmt',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
$type = TransactionType::PAYMENT;
|
||||
$query = Transaction::query();
|
||||
$query->where('owner_type', Wallet::class);
|
||||
$query->where('type', $type);
|
||||
$query->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
$query->whereBetween('created_at', [$this->startDate, $this->endDate]);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Transaction $transaction
|
||||
* @return array
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
$formattedDocumentDate = Carbon::parse($transaction->created_at)->format('m/d/Y');
|
||||
$owner = $transaction->owner;
|
||||
$company = $owner->owner;
|
||||
return [
|
||||
'<<New>>', //DocNo
|
||||
$formattedDocumentDate, //DocDate
|
||||
$company ? $company->debtor : '', //DebtorCode
|
||||
$transaction->bill_no, //Description
|
||||
'C', //DeptNo
|
||||
'WALLET DEPOSIT - EXC', //PaymentMethod
|
||||
number_format($transaction->amount, 2), //PaymentAmt
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Wallet;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ExportsSalesDepositByWallet2RefundEntry implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
protected $startDate;
|
||||
protected $endDate;
|
||||
|
||||
public function __construct($startDate = null, $endDate = null) {
|
||||
$this->startDate = $startDate ? Carbon::parse($startDate)->startOfDay() : Carbon::now()->subMonths(1);
|
||||
$this->endDate = $endDate ? Carbon::parse($endDate)->endOfDay() : Carbon::now();
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'DocNo',
|
||||
'DebtorCode',
|
||||
'DocDate',
|
||||
'Description',
|
||||
'DeptNo',
|
||||
'PaymentMethod',
|
||||
'KnockOffDocType',
|
||||
'KnockOffDocNo',
|
||||
'KnockOffAmt',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
$type = TransactionType::PAYMENT;
|
||||
$query = Transaction::query();
|
||||
$query->where('owner_type', Wallet::class);
|
||||
$query->where('type', $type);
|
||||
$query->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
$query->whereBetween('created_at', [$this->startDate, $this->endDate]);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Transaction $transaction
|
||||
* @return array
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
$formattedDocumentDate = Carbon::parse($transaction->created_at)->format('m/d/Y');
|
||||
$owner = $transaction->owner;
|
||||
$company = $owner->owner;
|
||||
|
||||
$knockOffDocNo = '';
|
||||
$transactionKVP = $transaction->attributesKVP()->where('key', KVPKey::AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_OFFICIAL_RECEIPT)->first();
|
||||
if($transactionKVP){
|
||||
$knockOffDocNo = $transactionKVP->value;
|
||||
}
|
||||
|
||||
return [
|
||||
'<<New>>', //DocNo
|
||||
$company ? $company->debtor : '', //DebtorCode
|
||||
$formattedDocumentDate, //DocDate
|
||||
$transaction->bill_no, //Description
|
||||
'C', //DeptNo
|
||||
'DEPOSIT IN TRANSIT', //PaymentMethod
|
||||
'RP', //KnockOffDocType
|
||||
$knockOffDocNo, //KnockOffDocNo
|
||||
number_format($transaction->amount, 2), //KnockOffAmt
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Wallet;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ExportsSalesDepositByWallet3DepositEntry implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
protected $startDate;
|
||||
protected $endDate;
|
||||
|
||||
public function __construct($startDate = null, $endDate = null) {
|
||||
$this->startDate = $startDate ? Carbon::parse($startDate)->startOfDay() : Carbon::now()->subMonths(1);
|
||||
$this->endDate = $endDate ? Carbon::parse($endDate)->endOfDay() : Carbon::now();
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'DocNo',
|
||||
'DocDate',
|
||||
'DebtorCode',
|
||||
'Description',
|
||||
'DeptNo',
|
||||
'DepositPaymentMethod',
|
||||
'PaymentMethod',
|
||||
'PaymentAmt',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
$type = TransactionType::PAYMENT;
|
||||
$query = Transaction::query();
|
||||
$query->where('owner_type', Wallet::class);
|
||||
$query->where('type', $type);
|
||||
$query->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
|
||||
$query->whereBetween('created_at', [$this->startDate, $this->endDate]);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Transaction $transaction
|
||||
* @return array
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
$formattedDocumentDate = Carbon::parse($transaction->created_at)->format('m/d/Y');
|
||||
$owner = $transaction->owner;
|
||||
$company = $owner->owner;
|
||||
return [
|
||||
'<<New>>', //DocNo
|
||||
$formattedDocumentDate, //DocDate
|
||||
$company ? $company->debtor : '', //DebtorCode
|
||||
$transaction->bill_no, //Description
|
||||
'C', //DeptNo
|
||||
'SALES DEPOSIT - EXC', //DepositPaymentMethod
|
||||
'DEPOSIT IN TRANSIT', //PaymentMethod
|
||||
number_format($transaction->amount, 2), //PaymentAmt
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessPaymentReportV2CommandJob;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessSalesInvoiceReportV2CommandJob;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessCreditNoteReportV2CommandJob;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessSalesDepositByWalletPaymentEntryV2CommandJob;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessSalesDepositByWalletRefundEntryV2CommandJob;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class AutoCountDataImport implements ToCollection, WithHeadingRow, WithChunkReading
|
||||
@@ -48,6 +50,12 @@ class AutoCountDataImport implements ToCollection, WithHeadingRow, WithChunkRead
|
||||
else if ($this->reportType === 'Credit Note Report') {
|
||||
ProcessCreditNoteReportV2CommandJob::dispatch($row->toArray());
|
||||
}
|
||||
else if ($this->reportType === '01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY]') {
|
||||
ProcessSalesDepositByWalletPaymentEntryV2CommandJob::dispatch($row->toArray());
|
||||
}
|
||||
else if ($this->reportType === '01DRF - Sales Deposit by Wallet [AR REFUND ENTRY]') {
|
||||
ProcessSalesDepositByWalletRefundEntryV2CommandJob::dispatch($row->toArray());
|
||||
}
|
||||
else {
|
||||
throw new MalformedRequestException('Cannot process report type: ' . $this->reportType);
|
||||
}
|
||||
@@ -99,6 +107,28 @@ class AutoCountDataImport implements ToCollection, WithHeadingRow, WithChunkRead
|
||||
'einvoicevalidationlink'
|
||||
];
|
||||
|
||||
$salesDepositByWalletPaymentEntryReportHeader = [
|
||||
'docno',
|
||||
'docdate',
|
||||
'debtorcode',
|
||||
'description',
|
||||
'deptno',
|
||||
'paymentmethod',
|
||||
'paymentamt',
|
||||
];
|
||||
|
||||
$salesDepositByWalletRefundEntryReportHeader = [
|
||||
'docno',
|
||||
'debtorcode',
|
||||
'docdate',
|
||||
'description',
|
||||
'deptno',
|
||||
'paymentmethod',
|
||||
'knockoffdoctype',
|
||||
'knockoffdocno',
|
||||
'knockoffamt',
|
||||
];
|
||||
|
||||
if ($reportType === 'Sales Invoice Report' &&
|
||||
$header !== $salesInvoiceHeader &&
|
||||
$header !== [...$salesInvoiceHeader, $optionalColumn]) {
|
||||
@@ -113,5 +143,11 @@ class AutoCountDataImport implements ToCollection, WithHeadingRow, WithChunkRead
|
||||
elseif ($reportType === 'Credit Note Report' && $header !== $creditNoteReportHeader) {
|
||||
throw new MalformedRequestException('Uploaded Excel file format is incorrect. Column headers do not match expected format.');
|
||||
}
|
||||
elseif ($reportType === '01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY]' && $header !== $salesDepositByWalletPaymentEntryReportHeader) {
|
||||
throw new MalformedRequestException('Uploaded Excel file format is incorrect. Column headers do not match expected format.');
|
||||
}
|
||||
elseif ($reportType === '01DRF - Sales Deposit by Wallet [AR REFUND ENTRY]' && $header !== $salesDepositByWalletRefundEntryReportHeader) {
|
||||
throw new MalformedRequestException('Uploaded Excel file format is incorrect. Column headers do not match expected format.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class KVPKey
|
||||
public const AUTOCOUNT_DOCNO_OFFICIAL_RECEIPT = 'AUTOCOUNT_DOCNO_OR';
|
||||
|
||||
public const AUTOCOUNT_DOCDATE_INVOICE = 'AUTOCOUNT_DOCDATE_I';
|
||||
|
||||
|
||||
public const AUTOCOUNT_DOCNO_CREDIT_NOTE = 'AUTOCOUNT_DOCNO_CN';
|
||||
|
||||
public const AUTOCOUNT_EINVOICE_VALIDATION_LINK = 'AUTOCOUNT_EINVOICE_VALIDATION_LINK';
|
||||
@@ -24,4 +24,10 @@ class KVPKey
|
||||
|
||||
public const BOOKING_EINVOICE_ELIGIBLE = 'BOOKING_EINVOICE_ELIGIBLE';
|
||||
|
||||
public const AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_OFFICIAL_RECEIPT = 'AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_OR';
|
||||
|
||||
public const AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_REFUND = 'AUTOCOUNT_DOCNO_SALES_DEPOSIT_BY_WALLET_RF';
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ use App\Classes\Modules\Exports\Services\ExportsARCreditNoteReport;
|
||||
use App\Classes\Modules\Exports\Services\ExportsCompanies;
|
||||
use App\Classes\Modules\Exports\Services\ExportsReceivePaymentDepositEntryReport;
|
||||
use App\Classes\Modules\Exports\Services\ExportsReceivePaymentForBookingReport;
|
||||
use App\Classes\Modules\Exports\Services\ExportsSalesDepositByWallet1PaymentEntry;
|
||||
use App\Classes\Modules\Exports\Services\ExportsSalesDepositByWallet2RefundEntry;
|
||||
use App\Classes\Modules\Exports\Services\ExportsSalesDepositByWallet3DepositEntry;
|
||||
use App\Classes\Modules\Exports\Services\ExportsWalletTopUpDepositEntryReport;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -60,6 +63,24 @@ class ExportController
|
||||
return $this->handleExport($exporter, 'WALLET TOP UP REPORT [Wallet Deposit Received].xls');
|
||||
}
|
||||
|
||||
public function salesDepositByWalletPaymentEntry(Request $request){
|
||||
[$startDate, $endDate] = $this->getValidatedDates($request);
|
||||
$exporter = new ExportsSalesDepositByWallet1PaymentEntry($startDate, $endDate);
|
||||
return $this->handleExport($exporter, '01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY].xls');
|
||||
}
|
||||
|
||||
public function salesDepositByWalletRefundEntry(Request $request){
|
||||
[$startDate, $endDate] = $this->getValidatedDates($request);
|
||||
$exporter = new ExportsSalesDepositByWallet2RefundEntry($startDate, $endDate);
|
||||
return $this->handleExport($exporter, '01DRF - Sales Deposit by Wallet [AR REFUND ENTRY].xls');
|
||||
}
|
||||
|
||||
public function salesDepositByWalletDepositEntry(Request $request){
|
||||
[$startDate, $endDate] = $this->getValidatedDates($request);
|
||||
$exporter = new ExportsSalesDepositByWallet3DepositEntry($startDate, $endDate);
|
||||
return $this->handleExport($exporter, '01DD - Sales Deposit by Wallet [AR DEPOSIT ENTRY].xls');
|
||||
}
|
||||
|
||||
private function getValidatedDates(Request $request): array
|
||||
{
|
||||
$validated = $request->validate([
|
||||
|
||||
@@ -23,4 +23,9 @@ class ImportController extends Controller
|
||||
{
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
public function salesDeposit(Request $request, ImportExcelLogic $logic): JsonResponse
|
||||
{
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
3. 01D - Sales Deposit Received [AR DEPOSIT ENTRY] → Filters by Payment Date<br/>
|
||||
4. 01R - RECEIVE PAYMENT [AR RECEIVE PAYMENT] → Filters by Payment Date<br/>
|
||||
5. Credit Note Report → Filters by Credit Note Created Date<br/>
|
||||
6. WALLET TOP UP REPORT [Wallet Deposit Received] → Filters by Top Up Date<br/>
|
||||
6. 01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY] → Filters by Created Date<br/>
|
||||
7. 01DRF - Sales Deposit by Wallet [AR REFUND ENTRY] → Filters by Created Date<br/>
|
||||
8. 01DD - Sales Deposit by Wallet [AR DEPOSIT ENTRY] → Filters by Created Date<br/>
|
||||
</div>
|
||||
">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
@@ -47,7 +49,9 @@
|
||||
3. 01D - Sales Deposit Received [AR DEPOSIT ENTRY] → Filters by Payment Date<br/>
|
||||
4. 01R - RECEIVE PAYMENT [AR RECEIVE PAYMENT] → Filters by Payment Date<br/>
|
||||
5. Credit Note Report → Filters by Credit Note Created Date<br/>
|
||||
6. WALLET TOP UP REPORT [Wallet Deposit Received] → Filters by Top Up Date<br/>
|
||||
6. 01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY] → Filters by Created Date<br/>
|
||||
7. 01DRF - Sales Deposit by Wallet [AR REFUND ENTRY] → Filters by Created Date<br/>
|
||||
8. 01DD - Sales Deposit by Wallet [AR DEPOSIT ENTRY] → Filters by Created Date<br/>
|
||||
</div>
|
||||
">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
@@ -149,7 +153,9 @@ export default {
|
||||
allowedReportTypes: [
|
||||
'Sales Invoice Report',
|
||||
'01R - RECEIVE PAYMENT [AR RECEIVE PAYMENT]',
|
||||
'Credit Note Report'
|
||||
'Credit Note Report',
|
||||
'01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY]',
|
||||
'01DRF - Sales Deposit by Wallet [AR REFUND ENTRY]',
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -174,6 +180,8 @@ export default {
|
||||
'Sales Invoice Report': route('api.import.sales_invoices'),
|
||||
'01R - RECEIVE PAYMENT [AR RECEIVE PAYMENT]': route('api.import.official_receipt'),
|
||||
'Credit Note Report': route('api.import.credit_note'),
|
||||
'01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY]': route('api.import.sales_deposit'),
|
||||
'01DRF - Sales Deposit by Wallet [AR REFUND ENTRY]': route('api.import.sales_deposit'),
|
||||
};
|
||||
|
||||
return importRoutesMap[reportType] || '';
|
||||
@@ -188,7 +196,10 @@ export default {
|
||||
'01D - Sales Deposit Received [AR DEPOSIT ENTRY]',
|
||||
'01R - RECEIVE PAYMENT [AR RECEIVE PAYMENT]',
|
||||
'Credit Note Report',
|
||||
'WALLET TOP UP REPORT [Wallet Deposit Received]',
|
||||
//'WALLET TOP UP REPORT [Wallet Deposit Received]',
|
||||
'01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY]',
|
||||
'01DRF - Sales Deposit by Wallet [AR REFUND ENTRY]',
|
||||
'01DD - Sales Deposit by Wallet [AR DEPOSIT ENTRY]'
|
||||
];
|
||||
},
|
||||
handleExportClick(){
|
||||
@@ -204,7 +215,10 @@ export default {
|
||||
'01D - Sales Deposit Received [AR DEPOSIT ENTRY]': route('api.export.transactions.receive_payment_deposit_entry'),
|
||||
'01R - RECEIVE PAYMENT [AR RECEIVE PAYMENT]': route('api.export.transactions.receive_payment_for_booking'),
|
||||
'Credit Note Report': route('api.export.transactions.ar_credit_note'),
|
||||
'WALLET TOP UP REPORT [Wallet Deposit Received]': route('api.export.transactions.wallet_top_up_deposit_entry'),
|
||||
//'WALLET TOP UP REPORT [Wallet Deposit Received]': route('api.export.transactions.wallet_top_up_deposit_entry'),
|
||||
'01DRW - Sales Deposit by Wallet [AR PAYMENT ENTRY]': route('api.export.transactions.sales_deposit_by_wallet_payment_entry'),
|
||||
'01DRF - Sales Deposit by Wallet [AR REFUND ENTRY]': route('api.export.transactions.sales_deposit_by_wallet_refund_entry'),
|
||||
'01DD - Sales Deposit by Wallet [AR DEPOSIT ENTRY]': route('api.export.transactions.sales_deposit_by_wallet_deposit_entry'),
|
||||
};
|
||||
|
||||
let url = `${routesMap[reportType]}?startDate=${this.parameters.startDate}&endDate=${this.parameters.endDate}`;
|
||||
|
||||
+4
-1
@@ -18,11 +18,14 @@ Route::group(['prefix' => 'export', 'as' => 'export.', 'namespace' => 'Exports']
|
||||
Route::get('/receive-payment-deposit-entry', [ExportController::class, 'receivePaymentDepositEntry'])->name('receive_payment_deposit_entry');
|
||||
Route::get('/receive-payment-for-booking', [ExportController::class, 'receivePaymentDepositForBooking'])->name('receive_payment_for_booking');
|
||||
Route::get('/wallet-top-up-deposit-entry', [ExportController::class, 'walletTopUpDepositEntry'])->name('wallet_top_up_deposit_entry');
|
||||
Route::get('/sales-deposit-by-wallet-payment-entry', [ExportController::class, 'salesDepositByWalletPaymentEntry'])->name('sales_deposit_by_wallet_payment_entry');
|
||||
Route::get('/sales-deposit-by-wallet-refund-entry', [ExportController::class, 'salesDepositByWalletRefundEntry'])->name('sales_deposit_by_wallet_refund_entry');
|
||||
Route::get('/sales-deposit-by-wallet-deposit-entry', [ExportController::class, 'salesDepositByWalletDepositEntry'])->name('sales_deposit_by_wallet_deposit_entry');
|
||||
});
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'import', 'as' => 'import.', 'namespace' => 'Imports'], function () {
|
||||
Route::post('/import/sales-invoice', [ImportController::class, 'salesInvoices'])->name('sales_invoices');
|
||||
Route::post('/import/offical-receipt', [ImportController::class, 'officialReceipt'])->name('official_receipt');
|
||||
Route::post('/import/credit-note', [ImportController::class, 'creditNote'])->name('credit_note');
|
||||
Route::post('/import/sales-deposit', [ImportController::class, 'salesDeposit'])->name('sales_deposit');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user