本文整理汇总了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;
}
示例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;
}