PS. No. is found empty! Please create in Account Settings.
private function SetItemAccountTransaction($objItem, $arrResult, $key, $attributes, $type) {
$amount = ($type=='LINE')?$attributes['line_total'][$key]:$arrResult['tax_total'];
if($type=='VAT') {
$vatrow = $this->getVatAccounts((isset($attributes['department_id']))?$attributes['department_id']:null);
if($vatrow) {
$dr_acnt_id = $vatrow->collection_account;
}
} else {
$dr_acnt_id = $attributes['account_id'][$key];
}
DB::table('account_transaction')
->insert([ 'voucher_type' => 'PS',
'voucher_type_id' => $this->purchase_split->id,
'account_master_id' => $dr_acnt_id,
'transaction_type' => 'Dr',
'amount' => $amount,
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'created_by' => Auth::User()->id,
'description' => $attributes['item_description'][$key],
'reference' => $attributes['voucher_no'],
'invoice_date' => ($attributes['voucher_date']=='')?date('Y-m-d'):date('Y-m-d', strtotime($attributes['voucher_date'])),
'reference_from' => $attributes['reference_no'],
'fc_amount' => (isset($attributes['is_fc']))?($amount/$attributes['currency_rate']):$amount,
'is_fc' => isset($attributes['is_fc'])?1:0,
'department_id' => (isset($attributes['department_id']))?$attributes['department_id']:'',
'job_id' => $attributes['jobid'][$key]
]);
return true;
}
@extends('layouts/default')
{{-- Page title --}}
@section('title')
@parent
@stop
{{-- page level styles --}}
@section('header_styles')
@stop
{{-- Page content --}}
@section('content')
Purchase Split
{{ Session::get('message') }}
{{ Session::get('error') }}
PS. No. is found empty! Please create in Account Settings.