public function getDelete($id)
 {
     $accountNames = NameOfAccount::find($id);
     $accountNames->delete();
     Session::flash('message', 'Account Name  has been Successfully Deleted.');
     return Redirect::to('accountnames/index');
 }
 public function getDelete($id)
 {
     $transfer = BalanceTransfer::find($id);
     $accountsFrom = NameOfAccount::find($transfer->from_account_name_id);
     $accountsFrom->opening_balance = $accountsFrom->opening_balance + $transfer->amount;
     $accountsTo = NameOfAccount::find($transfer->to_account_name_id);
     $accountsTo->opening_balance = $accountsTo->opening_balance - $transfer->amount;
     $accountsTo->save();
     $accountsFrom->save();
     $transfer->delete();
     Session::flash('message', 'Balance Transfer has been Successfully Deleted.');
     return Redirect::to('balancetransfers/index');
 }
 public function getComplete3($id)
 {
     $register2 = Transaction::find($id);
     $register2->cheque_status = 1;
     if ($register2->payment_method == "Check") {
         if ($register2->cheque_date == '') {
             $register2->cheque_date = date("m/d/Y", time());
         }
         $accountPayment = NameOfAccount::find($register2->account_name_id);
         $accountPayment->opening_balance = $accountPayment->opening_balance - $register2->amount;
         $accountPayment->save();
     }
     $register2->save();
     return Redirect::to('dashboard');
 }
Ejemplo n.º 4
0
 public function getAccountbalance($account_id)
 {
     $accountBalance = NameOfAccount::find($account_id);
     echo "<p3 style='color: blue;font-size: 150%'>Your Current Balance {$accountBalance->opening_balance}</p3>";
 }
@extends('baseLayout')
@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('assets/plugins/select2/select2_metro.css') }}" />
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('assets/plugins/bootstrap-datepicker/css/datepicker.css') }}" />
@stop
@section('content')
    <div class="row">
        <div class="col-md-12">
         <?php 
$account = \App\NameOfAccount::find($account_id);
$accountCat = \App\AccountCategory::find($account->account_category_id);
?>
        <center>
            <h3 class="page-title">
             Accounts Report  for <span style="color: black"> {{$account->name}} ({{$accountCat->name}})</span>
            </h3>
            </center>
         </div>

    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="portlet box light-grey">

                <div class="portlet-title">
                    <?php 
$date01 = explode('/', $date1);
$month1 = $date01[0];
$day1 = $date01[1];
$year1 = $date01[2];
$date001 = $day1 . '/' . $month1 . '/' . $year1;
 public function postSaveReceiveAll()
 {
     $transactionId = 0;
     $ruless = array('party_id' => 'required', 'branch_id' => 'required', 'account_category_id' => 'required', 'account_name_id' => 'required', 'payment_method' => 'required', 'amount' => 'required');
     $validate = Validator::make(Input::all(), $ruless);
     if ($validate->fails()) {
         var_dump($validate);
         die;
         return Redirect::to('sales/index/')->withErrors($validate);
     } else {
         //$this->setReceiveSalePaymentAll();
         //return Redirect::to('sales/index');
         //$salesreturn = new SalesReturn();
         //$this->setSalesReturnData($salesreturn);
         //automatically reduce sales payment starts
         $return_amount = Input::get('amount');
         $remaining_amount = $return_amount;
         //var_dump($remaining_amount);
         $partyId = Input::get('party_id');
         if ($remaining_amount > 0) {
             $invoiceId = PurchaseInvoice::where('party_id', '=', $partyId)->get();
             foreach ($invoiceId as $invid) {
                 $detailsPrice = 0;
                 $paid = 0;
                 $saleDetails = PurchaseInvoiceDetail::where('detail_invoice_id', '=', $invid->invoice_id)->get();
                 $transactions = Transaction::where('invoice_id', '=', $invid->invoice_id)->where('payment_method', '=', 'Check')->where('type', '=', 'Payment')->where('cheque_status', '=', 1)->get();
                 foreach ($saleDetails as $saleDetail) {
                     $detailsPrice = $detailsPrice + $saleDetail->price * $saleDetail->quantity;
                 }
                 foreach ($transactions as $transaction) {
                     $paid = $paid + $transaction->amount;
                 }
                 $transactions2 = Transaction::where('invoice_id', '=', $invid->invoice_id)->where('type', '=', 'Payment')->where('payment_method', '!=', 'Check')->get();
                 foreach ($transactions2 as $transaction) {
                     $paid = $paid + $transaction->amount;
                 }
                 $difference = $detailsPrice - $paid;
                 //echo $difference; die();
                 if ($difference > 0) {
                     //echo 'greater than 0 difference';
                     if ($remaining_amount <= $difference) {
                         if ($remaining_amount > 0) {
                             $sale = PurchaseInvoice::find($invid->id);
                             if ($remaining_amount < $difference) {
                                 $sale->status = "Partial";
                             } elseif ($remaining_amount == $difference) {
                                 $sale->status = "Completed";
                             }
                             $transaction = new Transaction();
                             $transaction->invoice_id = $invid->invoice_id;
                             $transaction->amount = $remaining_amount;
                             $transaction->type = 'Payment';
                             $transaction->payment_method = Input::get('payment_method');
                             $transaction->account_category_id = Input::get('account_category_id');
                             $transaction->remarks = Input::get('remarks');
                             $transaction->account_name_id = Input::get('account_name_id');
                             $transaction->user_id = Session::get('user_id');
                             $transaction->cheque_no = Input::get('cheque_no');
                             $branch = PurchaseInvoiceDetail::where('detail_invoice_id', '=', $invid->invoice_id)->first();
                             $transaction->branch_id = $branch->branch_id;
                             $transaction->cheque_date = Input::get('cheque_date');
                             $transaction->cheque_bank = Input::get('cheque_bank');
                             if ($transaction->payment_method != "Check") {
                                 $accountPayment = NameOfAccount::find(Input::get('account_name_id'));
                                 $accountPayment->opening_balance = $accountPayment->opening_balance - $remaining_amount;
                                 $accountPayment->save();
                             }
                             $transaction->save();
                             $transactionId = $transaction->id;
                             $remaining_amount = 0;
                         }
                     } elseif ($remaining_amount > $difference) {
                         if ($remaining_amount > 0) {
                             $sale = PurchaseInvoice::find($invid->id);
                             $sale->status = "Completed";
                             $toBePaid = $remaining_amount - $difference;
                             $transaction = new Transaction();
                             $transaction->invoice_id = $invid->invoice_id;
                             $transaction->amount = $difference;
                             $transaction->type = 'Payment';
                             $transaction->payment_method = Input::get('payment_method');
                             $transaction->account_category_id = Input::get('account_category_id');
                             $transaction->remarks = Input::get('remarks');
                             $transaction->account_name_id = Input::get('account_name_id');
                             $transaction->user_id = Session::get('user_id');
                             $transaction->cheque_no = Input::get('cheque_no');
                             $branch = PurchaseInvoiceDetail::where('detail_invoice_id', '=', $invid->invoice_id)->first();
                             $transaction->branch_id = $branch->branch_id;
                             $transaction->cheque_date = Input::get('cheque_date');
                             $transaction->cheque_bank = Input::get('cheque_bank');
                             if ($transaction->payment_method != "Check") {
                                 $accountPayment = NameOfAccount::find(Input::get('account_name_id'));
                                 $accountPayment->opening_balance = $accountPayment->opening_balance - $difference;
                                 $accountPayment->save();
                             }
                             $transaction->save();
                             $transactionId = $transaction->id;
                             $remaining_amount = $toBePaid;
                         }
                     }
                     $sale->save();
                 }
             }
         }
         /*if($remaining_amount>0)
           {
               echo "How come its possible! Consult with DEVELOPERS!!!";
           }*/
         //automatically reduce sales payment ends
         return Redirect::to('purchases/voucher/' . $transactionId);
     }
 }
                            <th>Invoice No</th>
                            <th>Account Name</th>
                            <th>Payment Method</th>
                            <th>Remarks</th>
                            <th style="text-align: right;">Amount</th>

                        </tr>
                        </thead>
                        <tbody>
                        <?php 
$totalSale = 0;
?>

                        @foreach($results as $result )
                            <?php 
$accounts = \App\NameOfAccount::find($result->account_name_id);
$accountCategory = \App\AccountCategory::find($result->account_category_id);
$party = \App\Party::find($result->party);
?>

                            <tr class="odd gradeX">
                                <td>{{\App\Transaction::convertDate($result->date)}}</td>
                                <td>{{$party->name}}</td>
                                <td><a target="_blank" href="{{URL::to('sales?invoice_id='.$result->invoice)}}">{{$result->invoice}}</a></td>
                                <td>{{$accounts->name }}{{' ( '.$accountCategory->name.' )'}}</td>
                                <td>{{$result->payment_method}}
                                    @if($result->cheque_no)
                                        {{' ( '.$result->cheque_no.' )'}}
                                    @endif
                                </td>
                                <td>{{$result->remarks}}</td>
Ejemplo n.º 8
0
<?php

$account = \App\NameOfAccount::find($transaction->account_name_id);
?>
@extends('baseLayout')
@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('assets/plugins/select2/select2_metro.css') }}"/>

@stop
@section('content')
    <div class="row">

        <div class="col-xs-2 invoice-block" style="margin-left: 880px;">
            <a class="btn btn-sm blue hidden-print" onclick="javascript:window.print();">Print <i class="fa fa-print"></i></a>
        </div>
    </div>
    <div class="invoice">
        <div class="row invoice-logo">
            <div class="col-xs-12 invoice-logo-space">
                <?php 
$sale22 = \App\SAleDetail::where('invoice_id', '=', $transaction->invoice_id)->first();
?>
                @if($sale22->branch_id == 1)
                    <img src="../../assets/img/pad/cemon-vc.jpg" style="width: 100%;"  alt="" />
                @elseif($sale22->branch_id == 2)
                    <img src="../../assets/img/pad/fst-vc.jpg" style="width: 100%;"  alt="" />
                @elseif($sale22->branch_id == 3)
                    <img src="../../assets/img/pad/cemon-vc.jpg" style="width: 100%;"  alt="" />
                @elseif($sale22->branch_id == 4)
                    <img src="../../assets/img/pad/cemon-vc.jpg" style="width: 100%;"  alt="" />
                @elseif($sale22->branch_id == 5)
Ejemplo n.º 9
0
$count = 0;
$count2 = 0;
?>
                            @foreach($accountBalanceTransfers as $result )
                                <?php 
$reports = new \App\Report();
$results2 = $reports->getBalanceTransferForFromAccount($result->fromAccount);
$fromAccount = \App\NameOfAccount::find($result->fromAccount);
?>

                                @foreach($results2 as $result2 )
                                    <?php 
$reports = new \App\Report();
$results3 = $reports->getBalanceTransferForToAccount($result->fromAccount, $result2->toAccount);
$remainingAmount = $result2->fromAmount - $results3[0]->toAmount;
$toAccount = \App\NameOfAccount::find($result2->toAccount);
?>
                                    @if($remainingAmount > 0)
                                        <?php 
for ($i = 0; $i < $count; $i++) {
    $from = $values[$i]["from"];
    $to = $values[$i]["to"];
    //var_dump($from." ".$to);
    if ($from == $fromAccount->name && $to == $toAccount->name) {
        $count2 = 1;
    }
}
?>
                                        @if($count2==0)
                                        <tr>
                                            <td>{{$slNo}}</td>
Ejemplo n.º 10
0
 public function getAccounts()
 {
     $accounts = NameOfAccount::all();
     return $accounts;
 }
Ejemplo n.º 11
0
 public function postAccountsresult()
 {
     $date1 = Input::get('from_date');
     $date2 = Input::get('to_date');
     $account_id = Input::get('account_id');
     $report = new Report();
     $results = $report->getAccountsReportData($date1, $date2, $account_id);
     $currentBalance = NameOfAccount::find($account_id);
     $balanceIn = $report->getBalanceIn($date1, $date2, $account_id);
     $balanceOut = $report->getBalanceOut($date1, $date2, $account_id);
     $totalBalanceOut = $report->getTotalBalanceOut($account_id);
     $totalBalanceIn = $report->getTotalBalanceIn($account_id);
     return view('Reports.accountsReportResult', compact('results'))->with('account_id', $account_id)->with('totalBalanceIn', $totalBalanceIn)->with('totalBalanceOut', $totalBalanceOut)->with('balanceIn', $balanceIn)->with('currentBalance', $currentBalance)->with('balanceOut', $balanceOut)->with('date1', $date1)->with('date2', $date2);
 }
Ejemplo n.º 12
0
                        <th>Created By</th>
                        <th>Action</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
$sl = 1;
?>
                    @foreach($balanceTransfers as $transfer )
                        <?php 
$branch1 = \App\Branch::find($transfer->from_branch_id);
$branch2 = \App\Branch::find($transfer->to_branch_id);
$category1 = \App\AccountCategory::find($transfer->from_account_category_id);
$category2 = \App\AccountCategory::find($transfer->to_account_category_id);
$account1 = \App\NameOfAccount::find($transfer->from_account_name_id);
$account2 = \App\NameOfAccount::find($transfer->to_account_name_id);
$user = \App\User::find($transfer->user_id);
?>
                    <tr class="odd gradeX">
                        <td><?php 
echo $sl;
?>
</td>
                        <td>{{$branch1->name}}</td>
                        <td>{{$category1->name}}</td>
                        <td>{{$account1->name}}</td>
                        <td>{{$branch2->name}}</td>
                        <td>{{$category2->name}}</td>
                        <td>{{$account2->name}}</td>
                        <td>{{$transfer->amount}}</td>
                        <td>{{$transfer->remarks}}</td>