@php $basicInfo = $profitData->get('basicInfo', collect()); @endphp
團名: {{ $basicInfo->get('tourName', '---') }}
出團日期: {{ $basicInfo->get('departDate', '---') }}
本團人數: {{ $basicInfo->get('headCount', '---') }}
團號: {{ $basicInfo->get('tourCode', '---') }}
本團領隊: {{ $basicInfo->get('lead', '---') }}
訂單數量: {{ $basicInfo->get('tourNumber', '---') }}
業務: {{ $basicInfo->get('businessPerson', '---') }}
協力商: {{ $basicInfo->get('cooperator', '---') }}
@php $businessIncome = $profitData->get('businessIncome', collect()); $incomeTotalAmount = 0; @endphp

一、營業收入

@forelse ($businessIncome as $sectionKey => $section) @if ($section['amount'] != 0) @php $sectionItems = collect($section['items'] ?? []); $sectionAmount = $section['amount'] ?? 0; $incomeTotalAmount += $sectionAmount; @endphp @forelse ($sectionItems as $item) @empty @endforelse
{{ $section['name'] ?? '項目' }}
項目名稱 單價(NT$) 數量 小計
{{ $item['name'] ?? '---' }} $ {{ number_format($item['oneprice'] ?? 0, 0) }} {{ $item['count'] ?? 0 }} $ {{ number_format($item['amount'] ?? 0, 0) }}
暫無資料
小計 $ {{ number_format($sectionAmount, 0) }}
@endif @empty

暫無收入資料

@endforelse
收入總計 $ {{ number_format($incomeTotalAmount, 0) }}
@php $businessCost = $profitData->get('businessCost', collect()); $costTotalAmount = 0; @endphp

二、營業成本

@forelse ($businessCost as $sectionKey => $section) @if ($section['amount'] != 0) @php $sectionItems = collect($section['items'] ?? []); $sectionAmount = $section['amount'] ?? 0; $costTotalAmount += $sectionAmount; @endphp @forelse ($sectionItems as $item) @empty @endforelse
{{ $section['name'] ?? '項目' }}
項目名稱 單價(NT$) 數量 小計
{{ $item['name'] ?? '---' }} $ {{ number_format($item['oneprice'] ?? 0, 0) }} {{ $item['count'] ?? 0 }} $ {{ number_format($item['amount'] ?? 0, 0) }}
暫無資料
小計 $ {{ number_format($sectionAmount, 0) }}
@endif @empty

暫無成本資料

@endforelse
成本總計 $ {{ number_format($costTotalAmount, 0) }}
@php $otherCost = $profitData->get('otherCost', collect()); $otherCostTotalAmount = 0; @endphp @if ($otherCost->count() != 0)

三、營業外成本

@forelse ($otherCost as $sectionKey => $section) @if ($section['amount'] != 0) @php $sectionItems = collect($section['items'] ?? []); $sectionAmount = $section['amount'] ?? 0; $otherCostTotalAmount += $sectionAmount; @endphp @forelse ($sectionItems as $item) @empty @endforelse
{{ $section['name'] ?? '項目' }}
項目名稱 單價(NT$) 數量 小計
{{ $item['name'] ?? '---' }} $ {{ number_format($item['oneprice'] ?? 0, 0) }} {{ $item['count'] ?? 0 }} $ {{ number_format($item['amount'] ?? 0, 0) }}
暫無資料
小計 $ {{ number_format($sectionAmount, 0) }}
@endif @empty @endforelse @if ($otherCostTotalAmount != 0)
營業外成本總計 $ {{ number_format($otherCostTotalAmount, 0) }}
@endif @endif @php $profitAnalysis = $profitData->get('profitAnalysis', collect()); $totalIncome = $profitAnalysis->get('totalIncome', $incomeTotalAmount ?? 0); $totalCost = $profitAnalysis->get('totalCost', $costTotalAmount ?? 0); $grossProfit = $profitAnalysis->get('grossProfit', $totalIncome - $totalCost); $otherCostAmount = $profitAnalysis->get('otherCostAmount', $otherCostTotalAmount ?? 0); $netProfit = $profitAnalysis->get('netProfit', $grossProfit - $otherCostAmount); $profitMargin = $profitAnalysis->get('profitMargin', '0%'); $businessShare = $profitAnalysis->get('businessShare', 0); @endphp

四、損益計算

本團收款: $ {{ number_format($totalIncome, 0) }}
本團成本: $ {{ number_format($totalCost, 0) }}
本團毛利: $ {{ number_format($grossProfit, 0) }}
營業外收入: $ {{ 0}}
營業外成本: $ {{ number_format($otherCostAmount, 0) }}
本團利潤: $ {{ number_format($netProfit, 0) }}
分潤率: {{ $profitMargin }}
業務分潤金: {{ ($businessShare) }}