Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public function cuentaCorriente()
  2. {
  3. return $this->hasOne('SisInventarioCuentaCorriente', 'idpersona', 'idpersona');
  4. }
  5.  
  6. public function pagoCorriente()
  7. {
  8. return $this->hasMany('SisInventarioPagoCorriente', 'idcuenta_corriente', 'idcuenta_corriente');
  9. }
  10.  
  11. $cuentaProveedor = Persona::with('cuentaCorriente.pagoCorriente')->where('cliente_proveedor','proveedor')->get();
  12.  
  13. {{$cuentaProveedor->cuentaCorriente->pagoCorriente->sum('monto')}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement