public bool asignarCreditoFactura(DO_Factura factura, int idCredito) { DAO_Factura daoFactura = new DAO_Factura(); daoFactura.agregarAlCredito(idCredito, factura); return(true); }
public int obtenerTotalVentasCreditoDiaEspecifico(String diaInicio, String diaFinal) { try { DAO_Factura daoFactura = new DAO_Factura(); return(daoFactura.obtenerTotalVentasCreditoDiaEspecifico(diaInicio, diaFinal)); }catch { return(0); } }
public int obtenerAbonosCredito(String diaInicio, String diaFinal) { try { DAO_Factura daoFactura = new DAO_Factura(); return(daoFactura.obtenerAbonosCredito(diaInicio, diaFinal)); } catch { return(0); } }
public bool abonarFactura(DO_Factura factura, double abono) { DAO_Factura daoFactura = new DAO_Factura(); DAO_Credito daoCredito = new DAO_Credito(); if (daoFactura.actualizarSaldoFactura(factura, abono) && daoCredito.registrarAbono(factura.credito, abono)) { return(true); } else { return(false); } }
public double calcularMonto(int idCredito) { List <DO_Factura> listaFacturas = new List <DO_Factura>(); DAO_Factura daoFactura = new DAO_Factura(); listaFacturas = daoFactura.obtenerFacturasCredito(idCredito); double monto = 0; foreach (DO_Factura factura in listaFacturas) { monto += factura.saldo; } return(monto); }
public bool guardarFactura(DO_Factura factura) { //calcularTotal(factura); DAO_Factura daoFactura = new DAO_Factura(); factura.codigoFactura = daoFactura.guardarFactura(factura); if (factura.codigoFactura > 0) { foreach (DO_ProductoEnFactura productoEnFactura in factura.listaProducto) { DAO_Producto daoProducto = new DAO_Producto(); if (!daoProducto.AgregarProductoAFactura(factura.codigoFactura, factura.fecha, productoEnFactura)) { return(false); } } return(true); } else { return(false); } }
public bool modificarEstadoFactura(int codigoFactura, String estado) { DAO_Factura daoFactura = new DAO_Factura(); return(daoFactura.modificarEstadoFactura(codigoFactura, estado)); }
public bool actualizarPlantillaFactura(DO_PlantillaFactura plantillaFactura) { DAO_Factura daoFactura = new DAO_Factura(); return(daoFactura.actualizarPlantillaFactura(plantillaFactura)); }
public int ingresarPlantillaFactura(DO_PlantillaFactura plantillaFactura) { DAO_Factura daoFactura = new DAO_Factura(); return(daoFactura.ingresarPlantillaFactura(plantillaFactura)); }
public DO_PlantillaFactura obtenerPlantillaFactura() { DAO_Factura daoFactura = new DAO_Factura(); return(daoFactura.obtenerUltimaPlantilla()); }