import java.util.ArrayList;
 
 
public class Main {
 
    public static void main
(String[] args
) {         //creo cliente
        Cliente cli1 = new Cliente("eugenio","Borras","monotributista",156);
        Domicilio domi1 = new Domicilio(1859,"25 de mayo");
        Localidad loc1 = new Localidad(1,"Ciudad");
        Pais pais =new Pais(1,"Argentia");
        //asociaciones cliente
        cli1.setRefDomicilio(domi1);
        domi1.setRefLocalidad(loc1);
        loc1.setRefPais(pais);
 
        //creo cliente2
        Cliente cli2 = new Cliente("Alvaro","Borras","monotributista",115);
        Domicilio domi2 = new Domicilio(1680,"Mitre");
        Localidad loc2 = new Localidad(1,"Ciudad");
        
        //asociaciones cliente2
        cli2.setRefDomicilio(domi2);
        domi2.setRefLocalidad(loc2);
        loc2.setRefPais(pais);
 
        //creo empleado
        Empleado empl = new Empleado("Alberto","Cortez","Informatica");
        Domicilio domi3 = new Domicilio(899,"Cobos");
        Localidad loc3 = new Localidad(7,"Dorrego");
        //asociaciones empleado
        empl.setRefDomicilio(domi3);
        domi3.setRefLocalidad(loc3);
        loc3.setRefPais(pais);
 
        //creo proveedor
 
        Proveedor prov = new Proveedor("Fernando","Castillo",55);
        Domicilio domi4 = new Domicilio(44,"Godoy Cruz");
        Localidad loc4 = new Localidad(1,"Ciudad");
 
        //asociaciones proveedor
        prov.setRefDomicilio(domi4);
        domi4.setRefLocalidad(loc4);
        loc4.setRefPais(pais);
 
        //creo articulos
 
        Articulo art1 = new Articulo(756,"RAM Kingston 1Gb",150);
        Articulo art2 = new Articulo(668,"Mouse Optico Genius",45);
        Articulo art3 = new Articulo(32,"Auriculares+Microfono Noga",63);
        Articulo art4 = new Articulo(12,"CD-RW",2.5);
 
 
        //creo factura
 
        Factura fact1 = new Factura(001, "A", "11/12/2009");
        Factura fact2 = new Factura(002, "B", "12/12/2009");
        
 
        //creo detalles
 
        Detalle detalle1 = new Detalle();
        detalle1.setRefArticulo(art1);
        detalle1.setCantidad(4);
        detalle1.setSubtotal(detalle1.calcSubtotal(art1.getPrecio(),detalle1.getCantidad()));
 
        Detalle detalle2 = new Detalle();
        detalle2.setRefArticulo(art2);
        detalle2.setCantidad(6);
        detalle2.setSubtotal(detalle2.calcSubtotal(art1.getPrecio(),detalle2.getCantidad()));
 
        Detalle detalle3 = new Detalle();
        detalle3.setRefArticulo(art3);
        detalle3.setCantidad(2);
        detalle3.setSubtotal(detalle3.calcSubtotal(art1.getPrecio(),detalle3.getCantidad()));
 
        //contenedores de los detalles
        deta1.add(detalle1);
        deta1.add(detalle3);
 
        deta2.add(detalle2);
        deta2.add(detalle3);
        //asoocio facura con empleado, cliente 1 y proveedor
        empl.setRefFactura(fact1);
        cli1.setRefFactura(fact1);
        prov.setRefFactura(fact1);
 
        //asoocio facura con empleado , cliente 2 y proveedor
        fact2.setRefPersona(empl);
        fact2.setRefPersona(cli2);
        fact1.setRefPersona(prov);
 
 
        System.
out.
println(" ---------------------------------------------------");         System.
out.
println("|ttFactura cliente 1                  |");         System.
out.
println(" ---------------------------------------------------");         System.
out.
println("|tTipo: "+cli1.
getRefFactura().
getTipo()+"ttNº: "+cli1.
getRefFactura().
getNro());         System.
out.
println("|tFecha: "+cli1.
getRefFactura().
getFecha());         System.
out.
println("|tEmpleado: "+empl.
getNombre()+" "+empl.
getApellido());         System.
out.
println("|tCliente: "+cli1.
getNombre()+" "+cli1.
getApellido());         
        
        for (Detalle deta : fact1.getRefDetalle()) {
            System.
out.
println("" + deta.
getRefArticulo().
getCodigo()+" "+deta.
getRefArticulo().
getDescripcion());         }
 
    }
 
}