Ejemplo n.º 1
0
 public function close()
 {
     $Sale = Sale::find($this->saleId);
     $Sale->status = 'closed';
     $Sale->save();
     $Till = new Till();
     $Till->action = 'sale';
     $Till->op_id = $this->saleId;
     $Till->seller = BackendAuth::getUser()->first_name;
     if ($Sale->payment == trans('awme.stocket::lang.invoice.cash')) {
         $Till->cash = $Sale->total;
     } else {
         $Till->payable = $Sale->total;
     }
     $Till->save();
 }
Ejemplo n.º 2
0
 public function close($summary = null)
 {
     $Till = new Till();
     $Till->action = $summary ? 'summary' : 'closing_till';
     $Till->seller = BackendAuth::getUser()->first_name;
     $Till->cash = $this->onClosing()->total_cash_sales;
     $Till->payable = $this->onClosing()->total_payable_sales;
     $Till->total = $this->onClosing()->total_all_sales;
     $Till->till = $this->onClosing()->total_till;
     $Till->save();
 }
Ejemplo n.º 3
0
 /**
  * borra la venta correspondiente de la caja
  * @return [type] [description]
  */
 public function beforeDelete()
 {
     Till::where('action', trans('awme.stocket::lang.tills.sale'))->where('op_id', $this->id)->delete();
 }