{!! Form::open(['url' => action([\App\Http\Controllers\TransactionPaymentController::class, 'postPayContactDue']), 'method' => 'post', 'id' => 'pay_contact_due_form', 'files' => true ]) !!} {!! Form::hidden("contact_id", $contact_details->contact_id); !!} {!! Form::hidden("due_payment_type", $due_payment_type); !!}
@lang( 'purchase.add_payment' )
@if($due_payment_type == 'purchase')
@lang('purchase.supplier'): {{ $contact_details->name }}
@lang('business.business'): {{ $contact_details->supplier_business_name }}

@lang('report.total_purchase'): {{ $contact_details->total_purchase }}
@lang('contact.total_paid'): {{ $contact_details->total_paid }}
@lang('contact.total_purchase_due'): {{ $contact_details->total_purchase - $contact_details->total_paid }}
@if(!empty($contact_details->opening_balance) || $contact_details->opening_balance != '0.00') @lang('app.opening_balance'): {{ $contact_details->opening_balance }}
@lang('app.opening_balance_due'): {{ $ob_due }} @endif
@elseif($due_payment_type == 'purchase_return')
@lang('purchase.supplier'): {{ $contact_details->name }}
@lang('business.business'): {{ $contact_details->supplier_business_name }}

@lang('app.total_purchase_return'): {{ $contact_details->total_purchase_return }}
@lang('app.total_purchase_return_paid'): {{ $contact_details->total_return_paid }}
@lang('app.total_purchase_return_due'): {{ $contact_details->total_purchase_return - $contact_details->total_return_paid }}
@elseif(in_array($due_payment_type, ['sell']))
@lang('sale.customer_name'): {{ $contact_details->name }}


@lang('report.total_sell'): {{ $contact_details->total_invoice }}
@lang('contact.total_paid'): {{ $contact_details->total_paid }}
@lang('contact.total_sale_due'): {{ $contact_details->total_invoice - $contact_details->total_paid }}
@if(!empty($contact_details->opening_balance) || $contact_details->opening_balance != '0.00') @lang('app.opening_balance'): {{ $contact_details->opening_balance }}
@lang('app.opening_balance_due'): {{ $ob_due }} @endif
@elseif(in_array($due_payment_type, ['sell_return']))
@lang('sale.customer_name'): {{ $contact_details->name }}


@lang('app.total_sell_return'): {{ $contact_details->total_sell_return }}
@lang('app.total_sell_return_paid'): {{ $contact_details->total_return_paid }}
@lang('app.total_sell_return_due'): {{ $contact_details->total_sell_return - $contact_details->total_return_paid }}
@endif
@if(config('constants.show_payment_type_on_contact_pay') && ($due_payment_type == 'purchase' || $due_payment_type == 'sell')) @php $reverse_payment_types = []; if($due_payment_type == 'purchase') { $reverse_payment_types = [ 0 => __('app.pay_to_supplier'), 1 => __('app.receive_from_supplier') ]; } else if($due_payment_type == 'sell') { $reverse_payment_types = [ 0 => __('app.receive_from_customer'), 1 => __('app.pay_to_customer') ]; } @endphp
{!! Form::label("is_reverse" , __('app.payment_type') . ':') !!} {!! Form::select("is_reverse", $reverse_payment_types, 0, ['class' => 'form-control select2', 'style' => 'width:100%;']); !!}
@endif @include('transaction_payment.partials.payment_row')
{!! Form::close() !!}