Compare commits
4 Commits
291e791114
...
staging
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50e60eb587 | ||
|
|
9373325399 | ||
|
|
ea23401473 | ||
|
|
5d0dbfcf21 |
@@ -31,7 +31,11 @@ ini_set('max_execution_time', 300000);
|
||||
->get();
|
||||
|
||||
$branch = Branch::find(Auth::user()->branch_id);
|
||||
$multiBranch = session('MULTI_BRANCH') ?? false;
|
||||
|
||||
$multiBranch = false;
|
||||
if(Auth::user()->hasRole(['administrator','sentra_operasi'])){
|
||||
$multiBranch = session('MULTI_BRANCH') ?? false;
|
||||
}
|
||||
|
||||
return view('webstatement::statements.index', compact('branches', 'branch', 'multiBranch'));
|
||||
}
|
||||
@@ -168,7 +172,11 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
try {
|
||||
$disk = Storage::disk('sftpStatement');
|
||||
$filePath = "{$statement->period_from}/{$statement->branch_code}/{$statement->account_number}_{$statement->period_from}.pdf";
|
||||
|
||||
// Convert period format from YYYYMM to YYYYMMDD.YYYYMMDD for folder path
|
||||
$periodPath = formatPeriodForFolder($statement->period_from);
|
||||
|
||||
$filePath = "{$periodPath}/PRINT/{$statement->branch_code}/{$statement->account_number}.1.pdf";
|
||||
|
||||
// Log untuk debugging
|
||||
Log::info('Checking SFTP file path', [
|
||||
@@ -186,7 +194,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
for ($period = clone $periodFrom; $period->lte($periodTo); $period->addMonth()) {
|
||||
$periodFormatted = $period->format('Ym');
|
||||
$periodPath = $periodFormatted . "/{$statement->branch_code}/{$statement->account_number}_{$periodFormatted}.pdf";
|
||||
$periodFolderPath = formatPeriodForFolder($periodFormatted);
|
||||
$periodPath = $periodFolderPath . "/{$statement->branch_code}/{$statement->account_number}_{$periodFormatted}.pdf";
|
||||
|
||||
if ($disk->exists($periodPath)) {
|
||||
$availablePeriods[] = $periodFormatted;
|
||||
@@ -316,7 +325,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
// Generate or fetch the statement file
|
||||
$disk = Storage::disk('sftpStatement');
|
||||
$filePath = "{$statement->period_from}/{$statement->branch_code}/{$statement->account_number}_{$statement->period_from}.pdf";
|
||||
$periodPath = formatPeriodForFolder($statement->period_from);
|
||||
$filePath = "{$periodPath}/{$statement->branch_code}/{$statement->account_number}_{$statement->period_from}.pdf";
|
||||
|
||||
if ($statement->is_period_range && $statement->period_to) {
|
||||
// Log: Memulai proses download period range
|
||||
@@ -339,7 +349,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
for ($period = clone $periodFrom; $period->lte($periodTo); $period->addMonth()) {
|
||||
$periodFormatted = $period->format('Ym');
|
||||
$periodPath = $periodFormatted . "/{$statement->branch_code}/{$statement->account_number}_{$periodFormatted}.pdf";
|
||||
$periodFolderPath = formatPeriodForFolder($periodFormatted);
|
||||
$periodPath = $periodFolderPath . "/{$statement->branch_code}/{$statement->account_number}_{$periodFormatted}.pdf";
|
||||
|
||||
if ($disk->exists($periodPath)) {
|
||||
$availablePeriods[] = $periodFormatted;
|
||||
@@ -383,7 +394,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
// Add each available statement to the zip
|
||||
foreach ($availablePeriods as $period) {
|
||||
$periodFilePath = "{$period}/{$statement->branch_code}/{$statement->account_number}_{$period}.pdf";
|
||||
$periodFolderPath = formatPeriodForFolder($period);
|
||||
$periodFilePath = "{$periodFolderPath}/{$statement->branch_code}/{$statement->account_number}_{$period}.pdf";
|
||||
$localFilePath = storage_path("app/temp/{$statement->account_number}_{$period}.pdf");
|
||||
|
||||
try {
|
||||
@@ -512,7 +524,7 @@ ini_set('max_execution_time', 300000);
|
||||
$query = PrintStatementLog::query();
|
||||
$query->whereNotNull('user_id');
|
||||
|
||||
if (!Auth::user()->role === 'administrator') {
|
||||
if (!Auth::user()->hasRole(['administrator','sentra_operasi'])) {
|
||||
$query->where(function($q) {
|
||||
$q->where('user_id', Auth::id())
|
||||
->orWhere('branch_code', Auth::user()->branch->code);
|
||||
@@ -668,7 +680,8 @@ ini_set('max_execution_time', 300000);
|
||||
$localDisk = Storage::disk('local');
|
||||
$sftpDisk = Storage::disk('sftpStatement');
|
||||
|
||||
$filePath = "{$statement->period_from}/{$statement->branch_code}/{$statement->account_number}_{$statement->period_from}.pdf";
|
||||
$periodPath = formatPeriodForFolder($statement->period_from);
|
||||
$filePath = "{$periodPath}/{$statement->branch_code}/{$statement->account_number}_{$statement->period_from}.pdf";
|
||||
|
||||
/**
|
||||
* Fungsi helper untuk mendapatkan file dari disk dengan prioritas local
|
||||
@@ -718,7 +731,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
for ($period = clone $periodFrom; $period->lte($periodTo); $period->addMonth()) {
|
||||
$periodFormatted = $period->format('Ym');
|
||||
$periodPath = "{$periodFormatted}/{$statement->branch_code}/{$statement->account_number}_{$periodFormatted}.pdf";
|
||||
$periodFolderPath = formatPeriodForFolder($periodFormatted);
|
||||
$periodPath = "{$periodFolderPath}/{$statement->branch_code}/{$statement->account_number}_{$periodFormatted}.pdf";
|
||||
|
||||
$fileInfo = $getFileFromDisk($periodPath);
|
||||
|
||||
@@ -906,6 +920,7 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
$norek = $statement->account_number;
|
||||
$period = $statement->period_from;
|
||||
$endPeriod = $statement->period_to ?? $period;
|
||||
$format='pdf';
|
||||
|
||||
// Generate nama file PDF
|
||||
@@ -977,20 +992,21 @@ ini_set('max_execution_time', 300000);
|
||||
Log::info('Statement data prepared successfully', [
|
||||
'account_number' => $norek,
|
||||
'period' => $period,
|
||||
'endPeriod' => $endPeriod ?? $period,
|
||||
'saldo_period' => $saldoPeriod,
|
||||
'saldo_awal' => $saldoAwalBulan->actual_balance ?? 0,
|
||||
'entries_count' => $stmtEntries->count()
|
||||
]);
|
||||
|
||||
$periodDates = calculatePeriodDates($period);
|
||||
$periodDates = formatPeriodForFolder($period);
|
||||
|
||||
// Jika format adalah PDF, generate PDF
|
||||
if ($format === 'pdf') {
|
||||
return $this->generateStatementPdf($norek, $period, $stmtEntries, $account, $customer, $headerTableBg, $branch, $saldoAwalBulan, $statement->id, $tempPath, $filename);
|
||||
return $this->generateStatementPdf($norek, $period, $endPeriod, $stmtEntries, $account, $customer, $headerTableBg, $branch, $saldoAwalBulan, $statement->id, $tempPath, $filename);
|
||||
}
|
||||
|
||||
// Default return HTML view
|
||||
return view('webstatement::statements.stmt', compact('stmtEntries', 'account', 'customer', 'headerTableBg', 'branch', 'period', 'saldoAwalBulan'));
|
||||
return view('webstatement::statements.stmt', compact('stmtEntries', 'account', 'customer', 'headerTableBg', 'branch', 'period', 'saldoAwalBulan', 'endPeriod'));
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
@@ -1028,7 +1044,7 @@ ini_set('max_execution_time', 300000);
|
||||
* @param object $saldoAwalBulan Data saldo awal
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected function generateStatementPdf($norek, $period, $stmtEntries, $account, $customer, $headerTableBg, $branch, $saldoAwalBulan, $statementId, $tempPath, $filename)
|
||||
protected function generateStatementPdf($norek, $period, $endPeriod, $stmtEntries, $account, $customer, $headerTableBg, $branch, $saldoAwalBulan, $statementId, $tempPath, $filename)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
@@ -1036,6 +1052,7 @@ ini_set('max_execution_time', 300000);
|
||||
Log::info('Starting PDF generation with storage', [
|
||||
'account_number' => $norek,
|
||||
'period' => $period,
|
||||
'endPeriod' => $endPeriod ?? $period,
|
||||
'user_id' => Auth::id()
|
||||
]);
|
||||
|
||||
@@ -1047,10 +1064,12 @@ ini_set('max_execution_time', 300000);
|
||||
'headerTableBg',
|
||||
'branch',
|
||||
'period',
|
||||
'endPeriod',
|
||||
'saldoAwalBulan'
|
||||
))->render();
|
||||
// Tentukan path storage
|
||||
$storagePath = "statements/{$period}/{$norek}";
|
||||
// Tentukan path storage dengan format folder baru
|
||||
$periodPath = formatPeriodForFolder($period);
|
||||
$storagePath = "statements/{$periodPath}/{$norek}";
|
||||
$fullStoragePath = "{$storagePath}/{$filename}";
|
||||
|
||||
// Generate PDF menggunakan Browsershot dan simpan langsung ke storage
|
||||
@@ -1226,7 +1245,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
$account = Account::where('account_number',$norek)->first();
|
||||
|
||||
$storagePath = "statements/{$period}/{$account->branch_code}/{$filename}";
|
||||
$periodPath = formatPeriodForFolder($period);
|
||||
$storagePath = "statements/{$periodPath}/{$account->branch_code}/{$filename}";
|
||||
|
||||
// Cek apakah file ada di storage
|
||||
if (!Storage::disk('local')->exists($storagePath)) {
|
||||
@@ -1285,7 +1305,8 @@ ini_set('max_execution_time', 300000);
|
||||
$filename = $this->generatePdfFileName($norek, $period);
|
||||
}
|
||||
|
||||
$storagePath = "statements/{$period}/{$norek}/{$filename}";
|
||||
$periodPath = formatPeriodForFolder($period);
|
||||
$storagePath = "statements/{$periodPath}/{$norek}/{$filename}";
|
||||
|
||||
if (Storage::disk('local')->exists($storagePath)) {
|
||||
$deleted = Storage::disk('local')->delete($storagePath);
|
||||
@@ -1519,6 +1540,8 @@ ini_set('max_execution_time', 300000);
|
||||
|
||||
$accountNumber = $statement->account_number;
|
||||
$period = $statement->period_from ?? date('Ym');
|
||||
$endPeriod = $statement->period_to ?? $period;
|
||||
|
||||
$balance = AccountBalance::where('account_number', $accountNumber)
|
||||
->when($period === '202505', function($query) {
|
||||
return $query->where('period', '>=', '20250512')
|
||||
@@ -1542,7 +1565,7 @@ ini_set('max_execution_time', 300000);
|
||||
}
|
||||
|
||||
// Dispatch the job
|
||||
$job = ExportStatementPeriodJob::dispatch($statement->id, $accountNumber, $period, $balance, $clientName);
|
||||
$job = ExportStatementPeriodJob::dispatch($statement->id, $accountNumber, $period, $endPeriod, $balance, $clientName);
|
||||
|
||||
Log::info("Statement export job dispatched successfully", [
|
||||
'job_id' => $job->job_id ?? null,
|
||||
@@ -1602,8 +1625,9 @@ ini_set('max_execution_time', 300000);
|
||||
], 404);
|
||||
}
|
||||
|
||||
// Find ZIP file
|
||||
$zipFiles = Storage::disk('local')->files("statements/{$statement->period_from}/multi_account/{$statementId}");
|
||||
// Find ZIP file dengan format folder baru
|
||||
$periodPath = formatPeriodForFolder($statement->period_from);
|
||||
$zipFiles = Storage::disk('local')->files("statements/{$periodPath}/multi_account/{$statementId}");
|
||||
|
||||
$zipFile = null;
|
||||
foreach ($zipFiles as $file) {
|
||||
|
||||
@@ -20,10 +20,8 @@ class WebstatementController extends Controller
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(string $queueName='default')
|
||||
{
|
||||
$queueName = $request->get('queue_name', 'default');
|
||||
|
||||
Log::info('Starting statement export process', [
|
||||
'queue_name' => $queueName
|
||||
]);
|
||||
@@ -142,7 +140,10 @@ class WebstatementController extends Controller
|
||||
],
|
||||
"MONETA"=> [
|
||||
"1085667890"
|
||||
]
|
||||
],
|
||||
"SILOT" => [
|
||||
"1083972676"
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class PrintStatementRequest extends FormRequest
|
||||
// Hanya cek duplikasi jika account_number ada
|
||||
if (!empty($this->input('account_number'))) {
|
||||
$query = Statement::where('account_number', $this->input('account_number'))
|
||||
->where('authorization_status', '!=', 'rejected')
|
||||
//->where('authorization_status', '!=', 'rejected')
|
||||
->where(function($query) {
|
||||
$query->where('is_available', true)
|
||||
->orWhere('is_generated', true);
|
||||
@@ -84,7 +84,7 @@ class PrintStatementRequest extends FormRequest
|
||||
}
|
||||
|
||||
if ($query->exists()) {
|
||||
$fail('A statement request with this account number and period already exists.');
|
||||
//$fail('A statement request with this account number and period already exists.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,8 +361,8 @@
|
||||
{
|
||||
// Determine the base path based on client
|
||||
$basePath = !empty($this->client)
|
||||
? "statements/{$this->client}"
|
||||
: "statements";
|
||||
? "partners/{$this->client}"
|
||||
: "partners";
|
||||
|
||||
$accountPath = "{$basePath}/{$this->account_number}";
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
|
||||
protected $account_number;
|
||||
protected $period; // Format: YYYYMM (e.g., 202505)
|
||||
protected $endPeriod; // Format: YYYYMM (e.g., 202505)
|
||||
protected $saldo;
|
||||
protected $disk;
|
||||
protected $client;
|
||||
@@ -57,11 +58,12 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
* @param string $client
|
||||
* @param string $disk
|
||||
*/
|
||||
public function __construct(int $statementId, string $account_number, string $period, string $saldo, string $client = '', string $disk = 'local', bool $toCsv = true)
|
||||
public function __construct(int $statementId, string $account_number, string $period, string $endPeriod, string $saldo, string $client = '', string $disk = 'local', bool $toCsv = true)
|
||||
{
|
||||
$this->statementId = $statementId;
|
||||
$this->account_number = $account_number;
|
||||
$this->period = $period;
|
||||
$this->endPeriod = $endPeriod;
|
||||
$this->saldo = $saldo;
|
||||
$this->disk = $disk;
|
||||
$this->client = $client;
|
||||
@@ -69,13 +71,13 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
$this->toCsv = $toCsv;
|
||||
|
||||
// Calculate start and end dates based on period
|
||||
$this->calculatePeriodDates();
|
||||
$this->formatPeriodForFolder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate start and end dates for the given period
|
||||
*/
|
||||
private function calculatePeriodDates(): void
|
||||
private function formatPeriodForFolder(): void
|
||||
{
|
||||
$year = substr($this->period, 0, 4);
|
||||
$month = substr($this->period, 4, 2);
|
||||
@@ -90,6 +92,13 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
|
||||
// End date is always the last day of the month
|
||||
$this->endDate = Carbon::createFromDate($year, $month, 1)->endOfMonth()->endOfDay();
|
||||
|
||||
// If endPeriod is provided, use it instead of endDate
|
||||
if($this->endPeriod){
|
||||
$year = substr($this->endPeriod, 0, 4);
|
||||
$month = substr($this->endPeriod, 4, 2);
|
||||
$this->endDate = Carbon::createFromDate($year, $month, 1)->endOfMonth()->endOfDay();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,19 +211,23 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
|
||||
foreach ($entries as $item) {
|
||||
$globalSequence++;
|
||||
$runningBalance += (float) $item->amount_lcy;
|
||||
|
||||
$transactionDate = $this->formatTransactionDate($item);
|
||||
$actualDate = $this->formatActualDate($item);
|
||||
|
||||
$amount = $item->amount_fcy;
|
||||
if($item->currency=='IDR'){
|
||||
$amount = $item->amount_lcy;
|
||||
}
|
||||
$runningBalance += (float) $amount;
|
||||
|
||||
$processedData[] = [
|
||||
'account_number' => $this->account_number,
|
||||
'period' => $this->period,
|
||||
'sequence_no' => $globalSequence,
|
||||
'transaction_date' => $item->booking_date,
|
||||
'reference_number' => $item->trans_reference,
|
||||
'transaction_amount' => $item->amount_lcy,
|
||||
'transaction_type' => $item->amount_lcy < 0 ? 'D' : 'C',
|
||||
'transaction_amount' => $amount,
|
||||
'transaction_type' => $amount < 0 ? 'D' : 'C',
|
||||
'description' => $this->generateNarrative($item),
|
||||
'end_balance' => $runningBalance,
|
||||
'actual_date' => $actualDate,
|
||||
@@ -474,8 +487,9 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
// Generate filename
|
||||
$filename = "{$this->account_number}_{$this->period}.pdf";
|
||||
|
||||
// Tentukan path storage
|
||||
$storagePath = "statements/{$this->period}/{$account->branch_code}";
|
||||
// Tentukan path storage dengan format folder baru
|
||||
$periodPath = formatPeriodForFolder($this->period);
|
||||
$storagePath = "statements/{$periodPath}/{$account->branch_code}";
|
||||
$tempPath = storage_path("app/temp/{$filename}");
|
||||
$fullStoragePath = "{$storagePath}/{$filename}";
|
||||
|
||||
@@ -488,6 +502,7 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
Storage::makeDirectory($storagePath);
|
||||
|
||||
$period = $this->period;
|
||||
$endPeriod = $this->endPeriod;
|
||||
|
||||
// Render HTML view
|
||||
$html = view('webstatement::statements.stmt', compact(
|
||||
@@ -497,6 +512,7 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
'headerTableBg',
|
||||
'branch',
|
||||
'period',
|
||||
'endPeriod',
|
||||
'saldoAwalBulan'
|
||||
))->render();
|
||||
|
||||
@@ -612,7 +628,8 @@ class ExportStatementPeriodJob implements ShouldQueue
|
||||
// Determine the base path based on client
|
||||
$account = Account::where('account_number', $this->account_number)->first();
|
||||
|
||||
$storagePath = "statements/{$this->period}/{$account->branch_code}";
|
||||
$periodPath = formatPeriodForFolder($this->period);
|
||||
$storagePath = "statements/{$periodPath}/{$account->branch_code}";
|
||||
Storage::disk($this->disk)->makeDirectory($storagePath);
|
||||
|
||||
$filePath = "{$storagePath}/{$this->fileName}";
|
||||
|
||||
@@ -184,15 +184,13 @@
|
||||
->whereNotNull('currency')
|
||||
->where('currency', '!=', '')
|
||||
->whereIn('ctdesc', $cardTypes)
|
||||
->whereNotIn('product_code',['6002','6004','6042','6031']) // Hapus 6021 dari sini
|
||||
->whereNotIn('product_code',['6031','6021','6042']) // Hapus 6021 dari sini
|
||||
->where('branch','!=','ID0019999')
|
||||
// Filter khusus: Kecualikan product_code 6021 yang ctdesc nya gold
|
||||
->where(function($subQuery) {
|
||||
$subQuery->where('product_code', '!=', '6021')
|
||||
->orWhere(function($nestedQuery) {
|
||||
$nestedQuery->where('product_code', '6021')
|
||||
->where('ctdesc', '!=', 'GOLD');
|
||||
});
|
||||
->where(function($query) {
|
||||
$query->whereNot(function($q) {
|
||||
$q->where('product_code', '6004')
|
||||
->where('ctdesc', 'CLASSIC');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -203,8 +201,8 @@
|
||||
Log::info('Eligible ATM cards fetched successfully', [
|
||||
'total_cards' => $cards->count(),
|
||||
'periode' => $this->periode,
|
||||
'excluded_product_codes' => ['6002','6004','6042','6031'],
|
||||
'special_filter' => 'product_code 6021 dengan ctdesc gold dikecualikan'
|
||||
'excluded_product_codes' => ['6021','6042','6031'],
|
||||
'special_filter' => 'product_code 6004 dengan ctdesc classic dikecualikan'
|
||||
]);
|
||||
|
||||
return $cards;
|
||||
@@ -251,6 +249,8 @@
|
||||
: array
|
||||
{
|
||||
$today = date('Ymd');
|
||||
// Generate hash string unik 16 digit
|
||||
$uniqueHash = substr(hash('sha256', $card->crdno . $today . microtime(true) . uniqid()), 0, 16);
|
||||
|
||||
return [
|
||||
'',
|
||||
@@ -272,7 +272,8 @@
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'ACAT'
|
||||
'ACAT',
|
||||
$uniqueHash
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -170,12 +170,13 @@
|
||||
$mapping[$index] = $csvHeader;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Custom mapping untuk field yang berbeda nama
|
||||
$customMapping = [
|
||||
'co_code' => 'branch_code', // co_code di CSV menjadi branch_code di database
|
||||
'name_1' => 'name'
|
||||
];
|
||||
|
||||
|
||||
if (isset($customMapping[$csvHeader])) {
|
||||
$mapping[$index] = $customMapping[$csvHeader];
|
||||
} else {
|
||||
|
||||
@@ -231,6 +231,7 @@
|
||||
break;
|
||||
|
||||
case 'all_branches':
|
||||
$query->orderBy('branch_code', 'asc');
|
||||
// Tidak ada filter tambahan, ambil semua
|
||||
break;
|
||||
|
||||
@@ -238,6 +239,7 @@
|
||||
throw new InvalidArgumentException("Invalid request type: {$this->requestType}");
|
||||
}
|
||||
|
||||
$query->orderBy('account_number');
|
||||
$accounts = $query->get();
|
||||
|
||||
// Filter accounts yang memiliki email
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@section('content')
|
||||
<div class="grid grid-cols-8 gap-5">
|
||||
<div class="col-span-2 card">
|
||||
<div class="col-span-2 bg-gray-100 card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Request Print Stetement</h3>
|
||||
</div>
|
||||
@@ -71,10 +71,6 @@
|
||||
{{ in_array('BY.MAIL.TO.KTP.ADDR', old('stmt_sent_type', $statement->stmt_sent_type ?? [])) ? 'selected' : '' }}>
|
||||
BY MAIL TO KTP ADDR
|
||||
</option>
|
||||
<option value="NO.PRINT"
|
||||
{{ in_array('NO.PRINT', old('stmt_sent_type', $statement->stmt_sent_type ?? [])) ? 'selected' : '' }}>
|
||||
NO PRINT
|
||||
</option>
|
||||
<option value="PRINT"
|
||||
{{ in_array('PRINT', old('stmt_sent_type', $statement->stmt_sent_type ?? [])) ? 'selected' : '' }}>
|
||||
PRINT
|
||||
@@ -135,6 +131,7 @@
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
@if (auth()->user()->branch->code === '0988')
|
||||
<div class="form-group">
|
||||
<label class="form-label required" for="end_date">End Date</label>
|
||||
<input class="input @error('period_to') border-danger bg-danger-light @enderror" type="month"
|
||||
@@ -144,6 +141,7 @@
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-5 text-end">
|
||||
|
||||
@@ -288,8 +288,12 @@
|
||||
@php
|
||||
// Hitung tanggal periode berdasarkan $period
|
||||
$periodDates = calculatePeriodDates($period);
|
||||
|
||||
// Jika endPeriod ada, gunakan endPeriod sebagai batas akhir, jika tidak, gunakan period
|
||||
$endPeriodDate = $endPeriod ? calculatePeriodDates($endPeriod) : $periodDates;
|
||||
|
||||
$startDate = $periodDates['start'];
|
||||
$endDate = $periodDates['end'];
|
||||
$endDate = $endPeriodDate['end'] ?? $periodDates['end'];
|
||||
|
||||
// Log hasil perhitungan
|
||||
\Log::info('Period dates calculated', [
|
||||
@@ -366,13 +370,22 @@
|
||||
<div class="column">
|
||||
<p>{{ $branch->name }}</p>
|
||||
<p style="text-transform: capitalize">Kepada</p>
|
||||
<p>{{ $account->customer->name }}</p>
|
||||
<p>{{ $account->customer->address }}</p>
|
||||
<p>{{ $account->customer->district }}
|
||||
{{ ($account->customer->ktp_rt ?: $account->customer->home_rt) ? 'RT ' . ($account->customer->ktp_rt ?: $account->customer->home_rt) : '' }}
|
||||
{{ ($account->customer->ktp_rw ?: $account->customer->home_rw) ? 'RW ' . ($account->customer->ktp_rw ?: $account->customer->home_rw) : '' }}
|
||||
</p>
|
||||
<p>{{ trim($account->customer->city . ' ' . ($account->customer->province ? getProvinceCoreName($account->customer->province) . ' ' : '') . ($account->customer->postal_code ?? '')) }}
|
||||
<p>{{ $customer->name }}</p>
|
||||
@if ($account->stmt_sent_type == 'BY.MAIL.TO.DOM.ADDR')
|
||||
<p>{{ $customer->l_dom_street ?? $customer->address }}</p>
|
||||
<p>{{ $customer->district }}
|
||||
{{ ($customer->ktp_rt ?: $customer->home_rt) ? 'RT ' . ($customer->ktp_rt ?: $customer->home_rt) : '' }}
|
||||
{{ ($customer->ktp_rw ?: $customer->home_rw) ? 'RW ' . ($customer->ktp_rw ?: $customer->home_rw) : '' }}
|
||||
</p>
|
||||
<p>{{ trim($customer->city . ' ' . ($customer->province ? getProvinceCoreName($customer->province) . ' ' : '') . ($customer->postal_code ?? '')) }}
|
||||
@else
|
||||
<p>{{ $customer->address }}</p>
|
||||
<p>{{ $customer->district }}
|
||||
{{ ($customer->ktp_rt ?: $customer->home_rt) ? 'RT ' . ($customer->ktp_rt ?: $customer->home_rt) : '' }}
|
||||
{{ ($customer->ktp_rw ?: $customer->home_rw) ? 'RW ' . ($customer->ktp_rw ?: $customer->home_rw) : '' }}
|
||||
</p>
|
||||
<p>{{ trim($customer->city . ' ' . ($customer->province ? getProvinceCoreName($customer->province) . ' ' : '') . ($customer->postal_code ?? '')) }}
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-transform: capitalize;" class="column">
|
||||
@@ -408,7 +421,7 @@
|
||||
<td class="text-right"> </td>
|
||||
<td class="text-right"> </td>
|
||||
<td class="text-right">
|
||||
<strong>{{ number_format((float)$saldoAwalBulan->actual_balance, 2, ',', '.') }}</strong>
|
||||
<strong>{{ number_format((float) $saldoAwalBulan->actual_balance, 2, ',', '.') }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -443,10 +456,12 @@
|
||||
<td class="text-center">{{ substr($row->actual_date, 0, 10) }}</td>
|
||||
<td>{{ str_replace(['[', ']'], ' ', $narrativeLines[0] ?? '') }}</td>
|
||||
<td>{{ $row->reference_number }}</td>
|
||||
<td class="text-right">{{ $debit > 0 ? number_format((float)$debit, 2, ',', '.') : '' }}</td>
|
||||
<td class="text-right">{{ $kredit > 0 ? number_format((float)$kredit, 2, ',', '.') : '' }}
|
||||
<td class="text-right">
|
||||
{{ $debit > 0 ? number_format((float) $debit, 2, ',', '.') : '' }}</td>
|
||||
<td class="text-right">
|
||||
{{ $kredit > 0 ? number_format((float) $kredit, 2, ',', '.') : '' }}
|
||||
</td>
|
||||
<td class="text-right">{{ number_format((float)$saldo, 2, ',', '.') }}</td>
|
||||
<td class="text-right">{{ number_format((float) $saldo, 2, ',', '.') }}</td>
|
||||
</tr>
|
||||
@for ($i = 1; $i < count($narrativeLines); $i++)
|
||||
<tr class="narrative-line">
|
||||
|
||||
Reference in New Issue
Block a user