Exemplo n.º 1
0
 public function tobepaid()
 {
     $amount = $this->amount - $this->amount_released;
     return $tobepaid = in_session_currency($this->currency, $amount, 3);
 }
Exemplo n.º 2
0
 public function session_currency_amount()
 {
     $amount = in_session_currency($this->currency, $this->amount, 3, $this->exchange_rate);
     return currency_symbol(Session::get('currency')) . ' ' . $amount;
 }
Exemplo n.º 3
0
 public function processed_amount()
 {
     $amount = $this->amount - $this->txnfee;
     $currency = $this->currency;
     switch ($this->source_type) {
         case '1':
             $amount = $this->proposal->deposit;
             $currency = $this->proposal->currency;
             break;
         case '2':
             $amount = $this->invoice->amount;
             $currency = $this->invoice->currency;
             break;
         case '3':
             $amount = $this->userdeposit->amount_requested;
             $currency = $this->userdeposit->currency;
             break;
         case '4':
             $amount = $this->membership->paid_amount;
             $currency = $this->membership->currency;
             break;
         case '5':
             // todo need to change in future 24-march-2015
             $currency = $currency;
             $amount = $amount;
             break;
         case '6':
             $transaction = Transaction::where('source_type', '=', '11')->where('source_id', '=', $this->source_id)->first();
             $amount = $transaction->amount;
             $currency = $transaction->currency;
             break;
         case '7':
             $amount = $this->propurchased->amount;
             $currency = $this->propurchased->currency;
             break;
         case '10':
             $amount = $this->userpayment->amount;
             $currency = $this->userpayment->currency;
             break;
         case '13':
             $amount = $this->proposal->deposit;
             $currency = $this->proposal->currency;
             break;
         default:
             $currency = $currency;
             $amount = $amount;
             break;
     }
     return in_session_currency($currency, $amount);
 }
Exemplo n.º 4
0
function order_difference($request, $conv_currency = 'INR')
{
    $order_diff = in_session_currency($request['currency'], round($request['amount'], 2)) - in_session_currency($request['currency'], round($request['wallet_balance'], 2), '2');
    if ($conv_currency == 'USD') {
        return $order_diff;
    } else {
        $order_diff = convert_currency(Session::get('currency'), 'INR', $order_diff, 3);
        return $order_diff;
    }
}