Ejemplo n.º 1
0
 public function afterConfirm($data)
 {
     //lock table confirmed
     SalesOrder::where('id', $data->id)->lockForUpdate()->get();
     //lock table confirmed
     $dataItem = SalesOrderItem::where($this->key_detail, $data->id)->lockForUpdate()->get();
     $this->transferToLeasingreturn($data);
 }
Ejemplo n.º 2
0
 public function validationSO()
 {
     Validator::extend('so_before_confirm_destroy_update', function ($attribute, $value, $parameters, $validator) {
         $idSalesOrder = Request::get('id');
         //cek so harus punya status open
         $data = SalesOrder::where('sales_orders.id', $idSalesOrder)->where('sales_orders.status', 0)->count();
         if ($data <= 0) {
             return false;
         }
         return true;
     });
     Validator::extend('so_before_void', function ($attribute, $value, $parameters, $validator) {
         $idSalesOrder = Request::get('id');
         //cek so harus punya status confirm
         $data = SalesOrder::where('sales_orders.id', $idSalesOrder)->where('sales_orders.status', 1)->count();
         if ($data <= 0) {
             return false;
         }
         return true;
     });
 }