當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Self::getActionTrans方法代碼示例

本文整理匯總了PHP中Self::getActionTrans方法的典型用法代碼示例。如果您正苦於以下問題:PHP Self::getActionTrans方法的具體用法?PHP Self::getActionTrans怎麽用?PHP Self::getActionTrans使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Self的用法示例。


在下文中一共展示了Self::getActionTrans方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onClosing

 public static function onClosing()
 {
     $getLastOpen = Self::getLastOpen()->toArray();
     #$lastOpen['created_at']
     $lastOpen = $getLastOpen['created_at'];
     /**
      * Total de depositos
      * @var decimal
      */
     $deposites = Till::where('action', Self::getActionTrans('deposit'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $deposites = array_sum(array_column($deposites, 'cash'));
     /**
      * Total de Ventas
      * @var decimal
      */
     $cash_sales = Till::where('action', Self::getActionTrans('sale'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $cash_sales = array_sum(array_column($cash_sales, 'cash'));
     /**
      * Total de Ventas
      * @var decimal
      */
     $payable_sales = Till::where('action', Self::getActionTrans('sale'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $payable_sales = array_sum(array_column($payable_sales, 'payable'));
     /**
      * Total de Retiros
      * @var decimal
      */
     $withdrawals = Till::where('action', Self::getActionTrans('withdrawal'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $withdrawals = array_sum(array_column($withdrawals, 'cash'));
     $till = ['total_in_open_till' => $getLastOpen['till'], 'total_deposites' => $deposites, 'total_cash_sales' => $cash_sales, 'total_payable_sales' => $payable_sales, 'total_witdrawls' => $withdrawals, 'total_all_sales' => Calc::suma([$cash_sales, $payable_sales]), 'total_till' => Calc::resta([$cash_sales, $deposites, $getLastOpen['till']], [$withdrawals])];
     return (object) $till;
 }
開發者ID:awme,項目名稱:stocket,代碼行數:32,代碼來源:CashRegister.php

示例2: onClosing

 public static function onClosing()
 {
     $getLastOpen = Self::getLastOpen()->toArray();
     #$lastOpen['created_at']
     $lastOpen = $getLastOpen['created_at'];
     /**
      * Total de depositos
      * @var decimal
      */
     $deposites = Till::where('action', Self::getActionTrans('deposit'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $deposites = array_sum(array_column($deposites, 'total'));
     /**
      * Total de Ventas de Parking
      * @var decimal
      */
     $parking_sales = Till::where('action', Self::getActionTrans('sale'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $parking_sales = array_sum(array_column($parking_sales, 'total'));
     /**
      * Total de Abonoso pagos
      * @var decimal
      */
     $total_subs = Till::where('action', Self::getActionTrans('sale_subs'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $total_subs = array_sum(array_column($total_subs, 'total'));
     /**
      * Total de Retiros
      * @var decimal
      */
     $withdrawals = Till::where('action', Self::getActionTrans('withdrawal'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $withdrawals = array_sum(array_column($withdrawals, 'total'));
     $till = ['total_deposites' => $deposites, 'total_parking_sales' => $parking_sales, 'total_subscription' => $total_subs, 'total_witdrawls' => $withdrawals, 'total_all_sales' => Calc::suma([$parking_sales, $total_subs]), 'total_income' => Calc::suma([$parking_sales, $total_subs, $deposites])];
     $till['total_in_till'] = Calc::resta([$till['total_income']], [$withdrawals]);
     # lo que queda en caja con la suma total menos los depositos.
     return (object) $till;
 }
開發者ID:AWME,項目名稱:Parking,代碼行數:34,代碼來源:CashRegister.php


注:本文中的Self::getActionTrans方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。