mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-29 20:51:09 -04:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			fix-logout
			...
			report-pdf
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0c821b8ae9 | |||
| bbddd88573 | 
| @ -2,24 +2,25 @@ | |||||||
|  |  | ||||||
| namespace Crater\Http\Controllers\V1\Admin\Report; | namespace Crater\Http\Controllers\V1\Admin\Report; | ||||||
|  |  | ||||||
|  | use PDF; | ||||||
| use Carbon\Carbon; | use Carbon\Carbon; | ||||||
| use Crater\Http\Controllers\Controller; |  | ||||||
| use Crater\Models\Company; | use Crater\Models\Company; | ||||||
| use Crater\Models\CompanySetting; | use Crater\Models\Currency; | ||||||
| use Crater\Models\Customer; | use Crater\Models\Customer; | ||||||
| use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||||
|  | use Crater\Models\CompanySetting; | ||||||
| use Illuminate\Support\Facades\App; | use Illuminate\Support\Facades\App; | ||||||
| use PDF; | use Crater\Http\Controllers\Controller; | ||||||
|  |  | ||||||
| class CustomerSalesReportController extends Controller | class CustomerSalesReportController extends Controller | ||||||
| { | { | ||||||
|     /** |     /** | ||||||
|     * Handle the incoming request. |      * Handle the incoming request. | ||||||
|     * |      * | ||||||
|     * @param  \Illuminate\Http\Request  $request |      * @param  \Illuminate\Http\Request  $request | ||||||
|     * @param  string  $hash |      * @param  string  $hash | ||||||
|     * @return \Illuminate\Http\JsonResponse |      * @return \Illuminate\Http\JsonResponse | ||||||
|     */ |      */ | ||||||
|     public function __invoke(Request $request, $hash) |     public function __invoke(Request $request, $hash) | ||||||
|     { |     { | ||||||
|         $company = Company::where('unique_hash', $hash)->first(); |         $company = Company::where('unique_hash', $hash)->first(); | ||||||
| @ -56,6 +57,7 @@ class CustomerSalesReportController extends Controller | |||||||
|         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); |         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); | ||||||
|         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); |         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); | ||||||
|         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); |         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); | ||||||
|  |         $currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id)); | ||||||
|  |  | ||||||
|         $colors = [ |         $colors = [ | ||||||
|             'primary_text_color', |             'primary_text_color', | ||||||
| @ -80,6 +82,7 @@ class CustomerSalesReportController extends Controller | |||||||
|             'company' => $company, |             'company' => $company, | ||||||
|             'from_date' => $from_date, |             'from_date' => $from_date, | ||||||
|             'to_date' => $to_date, |             'to_date' => $to_date, | ||||||
|  |             'currency' => $currency, | ||||||
|         ]); |         ]); | ||||||
|  |  | ||||||
|         $pdf = PDF::loadView('app.pdf.reports.sales-customers'); |         $pdf = PDF::loadView('app.pdf.reports.sales-customers'); | ||||||
|  | |||||||
| @ -2,24 +2,25 @@ | |||||||
|  |  | ||||||
| namespace Crater\Http\Controllers\V1\Admin\Report; | namespace Crater\Http\Controllers\V1\Admin\Report; | ||||||
|  |  | ||||||
| use Carbon\Carbon; |  | ||||||
| use Crater\Http\Controllers\Controller; |  | ||||||
| use Crater\Models\Company; |  | ||||||
| use Crater\Models\CompanySetting; |  | ||||||
| use Crater\Models\Expense; |  | ||||||
| use Illuminate\Http\Request; |  | ||||||
| use Illuminate\Support\Facades\App; |  | ||||||
| use PDF; | use PDF; | ||||||
|  | use Carbon\Carbon; | ||||||
|  | use Crater\Models\Company; | ||||||
|  | use Crater\Models\Expense; | ||||||
|  | use Crater\Models\Currency; | ||||||
|  | use Illuminate\Http\Request; | ||||||
|  | use Crater\Models\CompanySetting; | ||||||
|  | use Illuminate\Support\Facades\App; | ||||||
|  | use Crater\Http\Controllers\Controller; | ||||||
|  |  | ||||||
| class ExpensesReportController extends Controller | class ExpensesReportController extends Controller | ||||||
| { | { | ||||||
|     /** |     /** | ||||||
|     * Handle the incoming request. |      * Handle the incoming request. | ||||||
|     * |      * | ||||||
|     * @param  \Illuminate\Http\Request  $request |      * @param  \Illuminate\Http\Request  $request | ||||||
|     * @param  string  $hash |      * @param  string  $hash | ||||||
|     * @return \Illuminate\Http\JsonResponse |      * @return \Illuminate\Http\JsonResponse | ||||||
|     */ |      */ | ||||||
|     public function __invoke(Request $request, $hash) |     public function __invoke(Request $request, $hash) | ||||||
|     { |     { | ||||||
|         $company = Company::where('unique_hash', $hash)->first(); |         $company = Company::where('unique_hash', $hash)->first(); | ||||||
| @ -43,6 +44,7 @@ class ExpensesReportController extends Controller | |||||||
|         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); |         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); | ||||||
|         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); |         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); | ||||||
|         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); |         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); | ||||||
|  |         $currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id)); | ||||||
|  |  | ||||||
|         $colors = [ |         $colors = [ | ||||||
|             'primary_text_color', |             'primary_text_color', | ||||||
| @ -66,6 +68,7 @@ class ExpensesReportController extends Controller | |||||||
|             'company' => $company, |             'company' => $company, | ||||||
|             'from_date' => $from_date, |             'from_date' => $from_date, | ||||||
|             'to_date' => $to_date, |             'to_date' => $to_date, | ||||||
|  |             'currency' => $currency, | ||||||
|         ]); |         ]); | ||||||
|         $pdf = PDF::loadView('app.pdf.reports.expenses'); |         $pdf = PDF::loadView('app.pdf.reports.expenses'); | ||||||
|  |  | ||||||
|  | |||||||
| @ -2,24 +2,25 @@ | |||||||
|  |  | ||||||
| namespace Crater\Http\Controllers\V1\Admin\Report; | namespace Crater\Http\Controllers\V1\Admin\Report; | ||||||
|  |  | ||||||
| use Carbon\Carbon; |  | ||||||
| use Crater\Http\Controllers\Controller; |  | ||||||
| use Crater\Models\Company; |  | ||||||
| use Crater\Models\CompanySetting; |  | ||||||
| use Crater\Models\InvoiceItem; |  | ||||||
| use Illuminate\Http\Request; |  | ||||||
| use Illuminate\Support\Facades\App; |  | ||||||
| use PDF; | use PDF; | ||||||
|  | use Carbon\Carbon; | ||||||
|  | use Crater\Models\Company; | ||||||
|  | use Crater\Models\Currency; | ||||||
|  | use Illuminate\Http\Request; | ||||||
|  | use Crater\Models\InvoiceItem; | ||||||
|  | use Crater\Models\CompanySetting; | ||||||
|  | use Illuminate\Support\Facades\App; | ||||||
|  | use Crater\Http\Controllers\Controller; | ||||||
|  |  | ||||||
| class ItemSalesReportController extends Controller | class ItemSalesReportController extends Controller | ||||||
| { | { | ||||||
|     /** |     /** | ||||||
|     * Handle the incoming request. |      * Handle the incoming request. | ||||||
|     * |      * | ||||||
|     * @param  \Illuminate\Http\Request  $request |      * @param  \Illuminate\Http\Request  $request | ||||||
|     * @param  string  $hash |      * @param  string  $hash | ||||||
|     * @return \Illuminate\Http\JsonResponse |      * @return \Illuminate\Http\JsonResponse | ||||||
|     */ |      */ | ||||||
|     public function __invoke(Request $request, $hash) |     public function __invoke(Request $request, $hash) | ||||||
|     { |     { | ||||||
|         $company = Company::where('unique_hash', $hash)->first(); |         $company = Company::where('unique_hash', $hash)->first(); | ||||||
| @ -43,6 +44,7 @@ class ItemSalesReportController extends Controller | |||||||
|         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); |         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); | ||||||
|         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); |         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); | ||||||
|         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); |         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); | ||||||
|  |         $currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id)); | ||||||
|  |  | ||||||
|         $colors = [ |         $colors = [ | ||||||
|             'primary_text_color', |             'primary_text_color', | ||||||
| @ -66,6 +68,7 @@ class ItemSalesReportController extends Controller | |||||||
|             'company' => $company, |             'company' => $company, | ||||||
|             'from_date' => $from_date, |             'from_date' => $from_date, | ||||||
|             'to_date' => $to_date, |             'to_date' => $to_date, | ||||||
|  |             'currency' => $currency, | ||||||
|         ]); |         ]); | ||||||
|         $pdf = PDF::loadView('app.pdf.reports.sales-items'); |         $pdf = PDF::loadView('app.pdf.reports.sales-items'); | ||||||
|  |  | ||||||
|  | |||||||
| @ -2,25 +2,26 @@ | |||||||
|  |  | ||||||
| namespace Crater\Http\Controllers\V1\Admin\Report; | namespace Crater\Http\Controllers\V1\Admin\Report; | ||||||
|  |  | ||||||
|  | use PDF; | ||||||
| use Carbon\Carbon; | use Carbon\Carbon; | ||||||
| use Crater\Http\Controllers\Controller; |  | ||||||
| use Crater\Models\Company; | use Crater\Models\Company; | ||||||
| use Crater\Models\CompanySetting; |  | ||||||
| use Crater\Models\Expense; | use Crater\Models\Expense; | ||||||
| use Crater\Models\Payment; | use Crater\Models\Payment; | ||||||
|  | use Crater\Models\Currency; | ||||||
| use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||||
|  | use Crater\Models\CompanySetting; | ||||||
| use Illuminate\Support\Facades\App; | use Illuminate\Support\Facades\App; | ||||||
| use PDF; | use Crater\Http\Controllers\Controller; | ||||||
|  |  | ||||||
| class ProfitLossReportController extends Controller | class ProfitLossReportController extends Controller | ||||||
| { | { | ||||||
|     /** |     /** | ||||||
|     * Handle the incoming request. |      * Handle the incoming request. | ||||||
|     * |      * | ||||||
|     * @param  \Illuminate\Http\Request  $request |      * @param  \Illuminate\Http\Request  $request | ||||||
|     * @param  string  $hash |      * @param  string  $hash | ||||||
|     * @return \Illuminate\Http\JsonResponse |      * @return \Illuminate\Http\JsonResponse | ||||||
|     */ |      */ | ||||||
|     public function __invoke(Request $request, $hash) |     public function __invoke(Request $request, $hash) | ||||||
|     { |     { | ||||||
|         $company = Company::where('unique_hash', $hash)->first(); |         $company = Company::where('unique_hash', $hash)->first(); | ||||||
| @ -49,6 +50,8 @@ class ProfitLossReportController extends Controller | |||||||
|         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); |         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); | ||||||
|         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); |         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); | ||||||
|         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); |         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); | ||||||
|  |         $currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id)); | ||||||
|  |  | ||||||
|  |  | ||||||
|         $colors = [ |         $colors = [ | ||||||
|             'primary_text_color', |             'primary_text_color', | ||||||
| @ -74,6 +77,7 @@ class ProfitLossReportController extends Controller | |||||||
|             'company' => $company, |             'company' => $company, | ||||||
|             'from_date' => $from_date, |             'from_date' => $from_date, | ||||||
|             'to_date' => $to_date, |             'to_date' => $to_date, | ||||||
|  |             'currency' => $currency, | ||||||
|         ]); |         ]); | ||||||
|         $pdf = PDF::loadView('app.pdf.reports.profit-loss'); |         $pdf = PDF::loadView('app.pdf.reports.profit-loss'); | ||||||
|  |  | ||||||
|  | |||||||
| @ -2,24 +2,25 @@ | |||||||
|  |  | ||||||
| namespace Crater\Http\Controllers\V1\Admin\Report; | namespace Crater\Http\Controllers\V1\Admin\Report; | ||||||
|  |  | ||||||
| use Carbon\Carbon; |  | ||||||
| use Crater\Http\Controllers\Controller; |  | ||||||
| use Crater\Models\Company; |  | ||||||
| use Crater\Models\CompanySetting; |  | ||||||
| use Crater\Models\Tax; |  | ||||||
| use Illuminate\Http\Request; |  | ||||||
| use Illuminate\Support\Facades\App; |  | ||||||
| use PDF; | use PDF; | ||||||
|  | use Carbon\Carbon; | ||||||
|  | use Crater\Models\Tax; | ||||||
|  | use Crater\Models\Company; | ||||||
|  | use Crater\Models\Currency; | ||||||
|  | use Illuminate\Http\Request; | ||||||
|  | use Crater\Models\CompanySetting; | ||||||
|  | use Illuminate\Support\Facades\App; | ||||||
|  | use Crater\Http\Controllers\Controller; | ||||||
|  |  | ||||||
| class TaxSummaryReportController extends Controller | class TaxSummaryReportController extends Controller | ||||||
| { | { | ||||||
|     /** |     /** | ||||||
|     * Handle the incoming request. |      * Handle the incoming request. | ||||||
|     * |      * | ||||||
|     * @param  \Illuminate\Http\Request  $request |      * @param  \Illuminate\Http\Request  $request | ||||||
|     * @param  string  $hash |      * @param  string  $hash | ||||||
|     * @return \Illuminate\Http\JsonResponse |      * @return \Illuminate\Http\JsonResponse | ||||||
|     */ |      */ | ||||||
|     public function __invoke(Request $request, $hash) |     public function __invoke(Request $request, $hash) | ||||||
|     { |     { | ||||||
|         $company = Company::where('unique_hash', $hash)->first(); |         $company = Company::where('unique_hash', $hash)->first(); | ||||||
| @ -44,6 +45,8 @@ class TaxSummaryReportController extends Controller | |||||||
|         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); |         $dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id); | ||||||
|         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); |         $from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat); | ||||||
|         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); |         $to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat); | ||||||
|  |         $currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id)); | ||||||
|  |  | ||||||
|  |  | ||||||
|         $colors = [ |         $colors = [ | ||||||
|             'primary_text_color', |             'primary_text_color', | ||||||
| @ -68,6 +71,7 @@ class TaxSummaryReportController extends Controller | |||||||
|             'company' => $company, |             'company' => $company, | ||||||
|             'from_date' => $from_date, |             'from_date' => $from_date, | ||||||
|             'to_date' => $to_date, |             'to_date' => $to_date, | ||||||
|  |             'currency' => $currency, | ||||||
|         ]); |         ]); | ||||||
|  |  | ||||||
|         $pdf = PDF::loadView('app.pdf.reports.tax-summary'); |         $pdf = PDF::loadView('app.pdf.reports.tax-summary'); | ||||||
|  | |||||||
| @ -133,11 +133,10 @@ | |||||||
|             line-height: 21px; |             line-height: 21px; | ||||||
|             color: #5851D8; |             color: #5851D8; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     </style> |     </style> | ||||||
|  |  | ||||||
|     @if (App::isLocale('th')) |     @if (App::isLocale('th')) | ||||||
|         @include('app.pdf.locale.th') |     @include('app.pdf.locale.th') | ||||||
|     @endif |     @endif | ||||||
| </head> | </head> | ||||||
|  |  | ||||||
| @ -162,18 +161,18 @@ | |||||||
|         <div class="expenses-table-container"> |         <div class="expenses-table-container"> | ||||||
|             <table class="expenses-table"> |             <table class="expenses-table"> | ||||||
|                 @foreach ($expenseCategories as $expenseCategory) |                 @foreach ($expenseCategories as $expenseCategory) | ||||||
|                     <tr> |                 <tr> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="expense-title"> |                         <p class="expense-title"> | ||||||
|                                 {{ $expenseCategory->category->name }} |                             {{ $expenseCategory->category->name }} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="expense-amount"> |                         <p class="expense-amount"> | ||||||
|                                 {!! format_money_pdf($expenseCategory->total_amount) !!} |                             {!! format_money_pdf($expenseCategory->total_amount, $currency) !!} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                     </tr> |                 </tr> | ||||||
|                 @endforeach |                 @endforeach | ||||||
|             </table> |             </table> | ||||||
|         </div> |         </div> | ||||||
| @ -182,7 +181,7 @@ | |||||||
|     <table class="expense-total-table"> |     <table class="expense-total-table"> | ||||||
|         <tr> |         <tr> | ||||||
|             <td class="expense-total-cell"> |             <td class="expense-total-cell"> | ||||||
|                 <p class="expense-total">{!! format_money_pdf($totalExpense) !!}</p> |                 <p class="expense-total">{!! format_money_pdf($totalExpense, $currency) !!}</p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|     </table> |     </table> | ||||||
| @ -192,7 +191,7 @@ | |||||||
|                 <p class="report-footer-label">@lang('pdf_total_expenses_label')</p> |                 <p class="report-footer-label">@lang('pdf_total_expenses_label')</p> | ||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <p class="report-footer-value">{!! format_money_pdf($totalExpense) !!}</p> |                 <p class="report-footer-value">{!! format_money_pdf($totalExpense, $currency) !!}</p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|     </table> |     </table> | ||||||
|  | |||||||
| @ -158,11 +158,10 @@ | |||||||
|             line-height: 21px; |             line-height: 21px; | ||||||
|             color: #5851D8; |             color: #5851D8; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     </style> |     </style> | ||||||
|  |  | ||||||
|     @if (App::isLocale('th')) |     @if (App::isLocale('th')) | ||||||
|         @include('app.pdf.locale.th') |     @include('app.pdf.locale.th') | ||||||
|     @endif |     @endif | ||||||
| </head> | </head> | ||||||
|  |  | ||||||
| @ -190,7 +189,7 @@ | |||||||
|                     <p class="income-title">@lang("pdf_income_label")</p> |                     <p class="income-title">@lang("pdf_income_label")</p> | ||||||
|                 </td> |                 </td> | ||||||
|                 <td> |                 <td> | ||||||
|                     <p class="income-amount">{!! format_money_pdf($income) !!}</p> |                     <p class="income-amount">{!! format_money_pdf($income, $currency) !!}</p> | ||||||
|                 </td> |                 </td> | ||||||
|             </tr> |             </tr> | ||||||
|         </table> |         </table> | ||||||
| @ -198,18 +197,18 @@ | |||||||
|         <div class="expenses-table-container"> |         <div class="expenses-table-container"> | ||||||
|             <table class="expenses-table"> |             <table class="expenses-table"> | ||||||
|                 @foreach ($expenseCategories as $expenseCategory) |                 @foreach ($expenseCategories as $expenseCategory) | ||||||
|                     <tr> |                 <tr> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="expense-title"> |                         <p class="expense-title"> | ||||||
|                                 {{ $expenseCategory->category->name }} |                             {{ $expenseCategory->category->name }} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="expense-amount"> |                         <p class="expense-amount"> | ||||||
|                                 {!! format_money_pdf($expenseCategory->total_amount) !!} |                             {!! format_money_pdf($expenseCategory->total_amount, $currency) !!} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                     </tr> |                 </tr> | ||||||
|                 @endforeach |                 @endforeach | ||||||
|  |  | ||||||
|             </table> |             </table> | ||||||
| @ -219,7 +218,7 @@ | |||||||
|     <table class="expense-total-indicator-table"> |     <table class="expense-total-indicator-table"> | ||||||
|         <tr> |         <tr> | ||||||
|             <td class="expense-total-cell"> |             <td class="expense-total-cell"> | ||||||
|                 <p class="expense-total">{!! format_money_pdf($totalExpense) !!}</p> |                 <p class="expense-total">{!! format_money_pdf($totalExpense, $currency) !!}</p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|     </table> |     </table> | ||||||
| @ -229,7 +228,7 @@ | |||||||
|                 <p class="report-footer-label">@lang("pdf_net_profit_label")</p> |                 <p class="report-footer-label">@lang("pdf_net_profit_label")</p> | ||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <p class="report-footer-value">{!! format_money_pdf($income - $totalExpense) !!}</p> |                 <p class="report-footer-value">{!! format_money_pdf($income - $totalExpense, $currency) !!}</p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|     </table> |     </table> | ||||||
|  | |||||||
| @ -137,11 +137,10 @@ | |||||||
|         .text-center { |         .text-center { | ||||||
|             text-align: center; |             text-align: center; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     </style> |     </style> | ||||||
|  |  | ||||||
|     @if (App::isLocale('th')) |     @if (App::isLocale('th')) | ||||||
|         @include('app.pdf.locale.th') |     @include('app.pdf.locale.th') | ||||||
|     @endif |     @endif | ||||||
| </head> | </head> | ||||||
|  |  | ||||||
| @ -164,34 +163,34 @@ | |||||||
|         </table> |         </table> | ||||||
|  |  | ||||||
|         @foreach ($customers as $customer) |         @foreach ($customers as $customer) | ||||||
|             <p class="sales-customer-name">{{ $customer->name }}</p> |         <p class="sales-customer-name">{{ $customer->name }}</p> | ||||||
|             <div class="sales-table-container"> |         <div class="sales-table-container"> | ||||||
|                 <table class="sales-table"> |             <table class="sales-table"> | ||||||
|                     @foreach ($customer->invoices as $invoice) |                 @foreach ($customer->invoices as $invoice) | ||||||
|                         <tr> |  | ||||||
|                             <td> |  | ||||||
|                                 <p class="sales-information-text"> |  | ||||||
|                                     {{ $invoice->formattedInvoiceDate }} ({{ $invoice->invoice_number }}) |  | ||||||
|                                 </p> |  | ||||||
|                             </td> |  | ||||||
|                             <td> |  | ||||||
|                                 <p class="sales-amount"> |  | ||||||
|                                     {!! format_money_pdf($invoice->base_total) !!} |  | ||||||
|                                 </p> |  | ||||||
|                             </td> |  | ||||||
|                         </tr> |  | ||||||
|                     @endforeach |  | ||||||
|                 </table> |  | ||||||
|             </div> |  | ||||||
|             <table class="sales-total-indicator-table"> |  | ||||||
|                 <tr> |                 <tr> | ||||||
|                     <td class="sales-total-cell"> |                     <td> | ||||||
|                         <p class="sales-total-amount"> |                         <p class="sales-information-text"> | ||||||
|                             {!! format_money_pdf($customer->totalAmount) !!} |                             {{ $invoice->formattedInvoiceDate }} ({{ $invoice->invoice_number }}) | ||||||
|  |                         </p> | ||||||
|  |                     </td> | ||||||
|  |                     <td> | ||||||
|  |                         <p class="sales-amount"> | ||||||
|  |                             {!! format_money_pdf($invoice->base_total, $currency) !!} | ||||||
|                         </p> |                         </p> | ||||||
|                     </td> |                     </td> | ||||||
|                 </tr> |                 </tr> | ||||||
|  |                 @endforeach | ||||||
|             </table> |             </table> | ||||||
|  |         </div> | ||||||
|  |         <table class="sales-total-indicator-table"> | ||||||
|  |             <tr> | ||||||
|  |                 <td class="sales-total-cell"> | ||||||
|  |                     <p class="sales-total-amount"> | ||||||
|  |                         {!! format_money_pdf($customer->totalAmount, $currency) !!} | ||||||
|  |                     </p> | ||||||
|  |                 </td> | ||||||
|  |             </tr> | ||||||
|  |         </table> | ||||||
|         @endforeach |         @endforeach | ||||||
|     </div> |     </div> | ||||||
|  |  | ||||||
| @ -203,7 +202,7 @@ | |||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <p class="report-footer-value"> |                 <p class="report-footer-value"> | ||||||
|                     {!! format_money_pdf($totalAmount) !!} |                     {!! format_money_pdf($totalAmount, $currency) !!} | ||||||
|                 </p> |                 </p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|  | |||||||
| @ -137,11 +137,10 @@ | |||||||
|         .text-center { |         .text-center { | ||||||
|             text-align: center; |             text-align: center; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     </style> |     </style> | ||||||
|  |  | ||||||
|     @if (App::isLocale('th')) |     @if (App::isLocale('th')) | ||||||
|         @include('app.pdf.locale.th') |     @include('app.pdf.locale.th') | ||||||
|     @endif |     @endif | ||||||
| </head> | </head> | ||||||
|  |  | ||||||
| @ -165,29 +164,29 @@ | |||||||
|  |  | ||||||
|         <p class="sales-items-title">@lang('pdf_items_label')</p> |         <p class="sales-items-title">@lang('pdf_items_label')</p> | ||||||
|         @foreach ($items as $item) |         @foreach ($items as $item) | ||||||
|             <div class="items-table-container"> |         <div class="items-table-container"> | ||||||
|                 <table class="items-table"> |             <table class="items-table"> | ||||||
|                     <tr> |                 <tr> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="item-title"> |                         <p class="item-title"> | ||||||
|                                 {{ $item->name }} |                             {{ $item->name }} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="item-sales-amount"> |                         <p class="item-sales-amount"> | ||||||
|                                 {!! format_money_pdf($item->total_amount) !!} |                             {!! format_money_pdf($item->total_amount, $currency) !!} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                     </tr> |                 </tr> | ||||||
|                 </table> |             </table> | ||||||
|             </div> |         </div> | ||||||
|         @endforeach |         @endforeach | ||||||
|  |  | ||||||
|         <table class="sales-total-indicator-table"> |         <table class="sales-total-indicator-table"> | ||||||
|             <tr> |             <tr> | ||||||
|                 <td class="sales-total-cell"> |                 <td class="sales-total-cell"> | ||||||
|                     <p class="sales-total-amount"> |                     <p class="sales-total-amount"> | ||||||
|                         {!! format_money_pdf($totalAmount) !!} |                         {!! format_money_pdf($totalAmount, $currency) !!} | ||||||
|                     </p> |                     </p> | ||||||
|                 </td> |                 </td> | ||||||
|             </tr> |             </tr> | ||||||
| @ -202,7 +201,7 @@ | |||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <p class="report-footer-value"> |                 <p class="report-footer-value"> | ||||||
|                     {!! format_money_pdf($totalAmount) !!} |                     {!! format_money_pdf($totalAmount, $currency) !!} | ||||||
|                 </p> |                 </p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|  | |||||||
| @ -134,11 +134,10 @@ | |||||||
|             line-height: 21px; |             line-height: 21px; | ||||||
|             color: #5851D8; |             color: #5851D8; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     </style> |     </style> | ||||||
|  |  | ||||||
|     @if (App::isLocale('th')) |     @if (App::isLocale('th')) | ||||||
|         @include('app.pdf.locale.th') |     @include('app.pdf.locale.th') | ||||||
|     @endif |     @endif | ||||||
| </head> | </head> | ||||||
|  |  | ||||||
| @ -167,18 +166,18 @@ | |||||||
|         <div class="tax-table-container"> |         <div class="tax-table-container"> | ||||||
|             <table class="tax-table"> |             <table class="tax-table"> | ||||||
|                 @foreach ($taxTypes as $tax) |                 @foreach ($taxTypes as $tax) | ||||||
|                     <tr> |                 <tr> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="tax-title"> |                         <p class="tax-title"> | ||||||
|                                 {{ $tax->taxType->name }} |                             {{ $tax->taxType->name }} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                         <td> |                     <td> | ||||||
|                             <p class="tax-amount"> |                         <p class="tax-amount"> | ||||||
|                                 {!! format_money_pdf($tax->total_tax_amount) !!} |                             {!! format_money_pdf($tax->total_tax_amount, $currency) !!} | ||||||
|                             </p> |                         </p> | ||||||
|                         </td> |                     </td> | ||||||
|                     </tr> |                 </tr> | ||||||
|                 @endforeach |                 @endforeach | ||||||
|  |  | ||||||
|             </table> |             </table> | ||||||
| @ -189,7 +188,7 @@ | |||||||
|         <tr> |         <tr> | ||||||
|             <td class="tax-total-cell"> |             <td class="tax-total-cell"> | ||||||
|                 <p class="tax-total"> |                 <p class="tax-total"> | ||||||
|                     {!! format_money_pdf($totalTaxAmount) !!} |                     {!! format_money_pdf($totalTaxAmount, $currency) !!} | ||||||
|                 </p> |                 </p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
| @ -201,7 +200,7 @@ | |||||||
|             </td> |             </td> | ||||||
|             <td> |             <td> | ||||||
|                 <p class="report-footer-value"> |                 <p class="report-footer-value"> | ||||||
|                     {!! format_money_pdf($totalTaxAmount) !!} |                     {!! format_money_pdf($totalTaxAmount, $currency) !!} | ||||||
|                 </p> |                 </p> | ||||||
|             </td> |             </td> | ||||||
|         </tr> |         </tr> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	