Revert "Cambio en cuenta de bonos de transporte"
This reverts commit 43b0b04859.
			
			
This commit is contained in:
		
							parent
							
								
									ab7e44fd85
								
							
						
					
					
						commit
						fefd052a8e
					
				
					 1 changed files with 12 additions and 12 deletions
				
			
		|  | @ -18,17 +18,6 @@ class Subpedido extends Model | ||||||
|     return $this->belongsToMany('App\Producto')->withPivot(["cantidad","total"]); |     return $this->belongsToMany('App\Producto')->withPivot(["cantidad","total"]); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   public function grupoDeCompra() |  | ||||||
|   { |  | ||||||
|     return $this->belongsTo('App\GrupoDeCompra'); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   //Permite que se apliquen los filtros al hacer una request (por ejemplo, de búsqueda)
 |  | ||||||
|   public function scopeFiltrar($query, FiltroDeSubpedido $filtros) |  | ||||||
|   { |  | ||||||
|       return $filtros->aplicar($query); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   //Bonos del MPS, Sororo, etc. NO devuelve bonos de transporte
 |   //Bonos del MPS, Sororo, etc. NO devuelve bonos de transporte
 | ||||||
|   private function bonos() |   private function bonos() | ||||||
|   { |   { | ||||||
|  | @ -40,6 +29,17 @@ class Subpedido extends Model | ||||||
|     return $this->productos()->where('bono',false); |     return $this->productos()->where('bono',false); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   public function grupoDeCompra() | ||||||
|  |   { | ||||||
|  |     return $this->belongsTo('App\GrupoDeCompra'); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   //Permite que se apliquen los filtros al hacer una request (por ejemplo, de búsqueda)
 | ||||||
|  |   public function scopeFiltrar($query, FiltroDeSubpedido $filtros) | ||||||
|  |   { | ||||||
|  |       return $filtros->aplicar($query); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   //Subtotal de dinero de productos del pedido, sin bonos ni transporte
 |   //Subtotal de dinero de productos del pedido, sin bonos ni transporte
 | ||||||
|   public function totalSinBonos() |   public function totalSinBonos() | ||||||
|   { |   { | ||||||
|  | @ -49,7 +49,7 @@ class Subpedido extends Model | ||||||
|   //Cantidad de bonos de transporte
 |   //Cantidad de bonos de transporte
 | ||||||
|   public function cantidadBDT() |   public function cantidadBDT() | ||||||
|   { |   { | ||||||
|     return ceil(($this->totalSinBonos()+1) / 500); |     return ceil($this->totalSinBonos() / 500); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   //Subtotal de dinero de bonos de transporte
 |   //Subtotal de dinero de bonos de transporte
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 nathalie
						nathalie