Compare commits
No commits in common. "fefd052a8eaa350691c1f66343efb115aad705e9" and "b66c2fe19db40e0ccad3b14b1bd8beb265968e93" have entirely different histories.
fefd052a8e
...
b66c2fe19d
2 changed files with 13 additions and 13 deletions
|
@ -86,7 +86,7 @@ class GrupoDeCompra extends Model
|
|||
}
|
||||
|
||||
public function calcularCantidadBDT() {
|
||||
return ceil($this->totalPedidosSinBonos() / 500);
|
||||
return ceil(($this->totalPedidosSinBonos()+1) / 500);
|
||||
}
|
||||
|
||||
public function totalBonosBarriales() {
|
||||
|
|
|
@ -18,17 +18,6 @@ class Subpedido extends Model
|
|||
return $this->belongsToMany('App\Producto')->withPivot(["cantidad","total"]);
|
||||
}
|
||||
|
||||
//Bonos del MPS, Sororo, etc. NO devuelve bonos de transporte
|
||||
private function bonos()
|
||||
{
|
||||
return $this->productos()->where('bono',1);
|
||||
}
|
||||
|
||||
public function productosSinBonos()
|
||||
{
|
||||
return $this->productos()->where('bono',false);
|
||||
}
|
||||
|
||||
public function grupoDeCompra()
|
||||
{
|
||||
return $this->belongsTo('App\GrupoDeCompra');
|
||||
|
@ -40,6 +29,17 @@ class Subpedido extends Model
|
|||
return $filtros->aplicar($query);
|
||||
}
|
||||
|
||||
//Bonos del MPS, Sororo, etc. NO devuelve bonos de transporte
|
||||
private function bonos()
|
||||
{
|
||||
return $this->productos()->where('bono',1);
|
||||
}
|
||||
|
||||
public function productosSinBonos()
|
||||
{
|
||||
return $this->productos()->where('bono',false);
|
||||
}
|
||||
|
||||
//Subtotal de dinero de productos del pedido, sin bonos ni transporte
|
||||
public function totalSinBonos()
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ class Subpedido extends Model
|
|||
//Cantidad de bonos de transporte
|
||||
public function cantidadBDT()
|
||||
{
|
||||
return ceil($this->totalSinBonos() / 500);
|
||||
return ceil(($this->totalSinBonos()+1) / 500);
|
||||
}
|
||||
|
||||
//Subtotal de dinero de bonos de transporte
|
||||
|
|
Loading…
Add table
Reference in a new issue