領収書宛名入力画面、領収書PDF修正
This commit is contained in:
parent
d37de8c61c
commit
22283f957b
@ -179,25 +179,24 @@ class ReceiptController extends Controller
|
|||||||
->where('management_id', $management_id)
|
->where('management_id', $management_id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
// 社員側の社判画像を参照するため、シンボリックリンクを作成 (company_image_path が存在する場合のみ)
|
||||||
|
if (!empty($inv_setting->company_image_path)) {
|
||||||
$krgmStoragePath = config('app.krgm_storage_path');
|
$krgmStoragePath = config('app.krgm_storage_path');
|
||||||
$linkPath = public_path('other-storage');
|
$linkPath = public_path('other-storage');
|
||||||
if (!file_exists($krgmStoragePath)) {
|
if (!file_exists($krgmStoragePath)) {
|
||||||
\Log::error('KRGM path not found: ' . $krgmStoragePath);
|
\Log::error("[ERROR] " . now()->format('Y-m-d H:i:s') . " 社判画像保存フォルダ発見不可: " . $krgmStoragePath . ", user_id=" . $user_id . ", contract_id=" . $contract_id);
|
||||||
abort(404, '画像パスが見つかりません。');
|
throw new \Exception();
|
||||||
}
|
}
|
||||||
if (!file_exists($linkPath)) {
|
if (!file_exists($linkPath)) {
|
||||||
$result = symlink($krgmStoragePath, $linkPath);
|
$result = symlink($krgmStoragePath, $linkPath);
|
||||||
\Log::info('Symlink result: ' . ($result ? 'success' : 'failed'));
|
\Log::info("[INFO] " . now()->format('Y-m-d H:i:s') . " 社判画像参照リンク作成。結果: " . ($result ? '成功' : '失敗') . ", user_id=" . $user_id . ", contract_id=" . $contract_id);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
\Log::error('Symlink failed');
|
\Log::error("[ERROR] " . now()->format('Y-m-d H:i:s') . " 社判画像参照リンク作成失敗。user_id=" . $user_id . ", contract_id=" . $contract_id);
|
||||||
abort(500, 'リンク作成失敗');
|
throw new \Exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!file_exists($linkPath)) {
|
|
||||||
symlink($krgmStoragePath, $linkPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ダウンロード回数をカウントアップ
|
// ダウンロード回数をカウントアップ
|
||||||
DB::table('inv_publish')
|
DB::table('inv_publish')
|
||||||
->where('contract_id', $contract_id)
|
->where('contract_id', $contract_id)
|
||||||
@ -244,7 +243,7 @@ class ReceiptController extends Controller
|
|||||||
->header('Content-Disposition', 'attachment; filename="receipt_' . $contract_id . '.pdf"');
|
->header('Content-Disposition', 'attachment; filename="receipt_' . $contract_id . '.pdf"');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// PDF生成エラーを記録
|
// PDF生成エラーを記録
|
||||||
\Log::error("[ERROR] " . now()->format('Y-m-d H:i:s') . " PDFダウンロードエラー: user_id=" . $user_id . ", contract_id=" . $contract_id . ", error=" . $e->getMessage());
|
\Log::error("[ERROR] " . now()->format('Y-m-d H:i:s') . " 領収書PDFダウンロードエラー: user_id=" . $user_id . ", contract_id=" . $contract_id . ", error=" . $e->getMessage());
|
||||||
abort(500, '領収書ダウンロードに失敗しました。');
|
abort(500, '領収書ダウンロードに失敗しました。');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,6 +123,16 @@ return [
|
|||||||
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| KRGM Storage Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value is the path to the KRGM storage directory for accessing images
|
||||||
|
| from the other project via symbolic link.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
'krgm_storage_path' => env('KRGM_STORAGE_PATH'),
|
'krgm_storage_path' => env('KRGM_STORAGE_PATH'),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@ -122,9 +122,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="company">
|
<div class="company">
|
||||||
<span style="font-size:20px; font-weight:bold;">{{ $inv_setting->t_name ?? '' }}</span><br>
|
<span style="font-size:20px; font-weight:bold;">{{ $inv_setting->t_name ?? '' }}</span><br>
|
||||||
{{ $inv_setting->zipcode ?? '' }}<br>
|
〒{{ $inv_setting->zipcode }}<br>
|
||||||
{{ $inv_setting->adrs ?? '' }}<br>
|
{{ $inv_setting->adrs }}
|
||||||
適格事業者番号:{{ $inv_setting->t_number ?? '' }}<br>
|
@if(!empty($inv_setting->bldg))
|
||||||
|
{{ $inv_setting->bldg }}
|
||||||
|
@endif
|
||||||
|
<br>適格事業者番号:{{ $inv_setting->t_number ?? '' }}<br>
|
||||||
@if(!empty($inv_setting->tel_num))
|
@if(!empty($inv_setting->tel_num))
|
||||||
TEL:{{ $inv_setting->tel_num}}<br>
|
TEL:{{ $inv_setting->tel_num}}<br>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user