@@ -107,14 +108,23 @@ export default {
openForm: false,
};
},
- mounted() {
+ mounted() {
+
+
+
+ // this.$store.dispatch("getCategorias");
+ //this.$store.dispatch("getMetodos");
this.newCompra.fecha = this.$store.state.fecha;
- this.$store.dispatch("getCategorias");
- this.$store.dispatch("getMetodos");
this.categorias = this.$store.state.categorias;
this.metodos_pago = this.$store.state.metodos_de_pago;
+
this.getCompras();
+
+
+
+
},
+
methods: {
cell(row, column, cellValue, index) {
@@ -203,9 +213,10 @@ export default {
this.newCompra.categoria = "";
this.isUpdate = false;
},
- getIcon(name) {
- const found = this.$store.state.categorias.find((ic) => ic.name === name);
- console.log(found);
+ getIcon(row, column, cellValue, index) {
+ const found = this.$store.state.categorias.filter((ic) => ic.name === cellValue)[0];
+ //console.log(found);
+ return `
${cellValue}`
},
formatMoneda(dato) {
diff --git a/APP/pages/ingresos.vue b/APP/pages/ingresos.vue
index 48882de..f71d235 100644
--- a/APP/pages/ingresos.vue
+++ b/APP/pages/ingresos.vue
@@ -1,17 +1,258 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/APP/pages/presupuesto.vue b/APP/pages/presupuesto.vue
index 6012f67..ecc099d 100644
--- a/APP/pages/presupuesto.vue
+++ b/APP/pages/presupuesto.vue
@@ -1,14 +1,177 @@
- Presupuesto
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Guardar
+
+
+
+
+
+
+
+
+
+ Ingresos: {{formatMoneda(totalIngresos)}}
+
+
+ Egreso: {{formatMoneda(totalEgresos)}}
+
+
+ Total: {{formatMoneda(total)}}
+
+
+
+
+
\ No newline at end of file
diff --git a/APP/static/favicdon.ico b/APP/static/favicdon.ico
new file mode 100644
index 0000000..3632d0c
Binary files /dev/null and b/APP/static/favicdon.ico differ
diff --git a/APP/static/favicon.ico b/APP/static/favicon.ico
index 3632d0c..a5ad53d 100644
Binary files a/APP/static/favicon.ico and b/APP/static/favicon.ico differ
diff --git a/APP/static/favicon.png b/APP/static/favicon.png
index 7d8b7d0..986dd5d 100644
Binary files a/APP/static/favicon.png and b/APP/static/favicon.png differ
diff --git a/APP/static/icon.png b/APP/static/icon.png
deleted file mode 100644
index 7d8b7d0..0000000
Binary files a/APP/static/icon.png and /dev/null differ
diff --git a/APP/static/img/apple-icon.png b/APP/static/img/apple-icon.png
old mode 100755
new mode 100644
index 0577a33..986dd5d
Binary files a/APP/static/img/apple-icon.png and b/APP/static/img/apple-icon.png differ
diff --git a/APP/static/img/apple-icone.png b/APP/static/img/apple-icone.png
new file mode 100755
index 0000000..0577a33
Binary files /dev/null and b/APP/static/img/apple-icone.png differ
diff --git a/APP/store/index.js b/APP/store/index.js
index 9bf7e20..f99843f 100644
--- a/APP/store/index.js
+++ b/APP/store/index.js
@@ -62,7 +62,6 @@ export const actions = {
this.$axios.get("/categoria", axiosHeader)
.then(res => {
-
this.commit("setCategorias", res.data.data);
@@ -91,4 +90,5 @@ export const actions = {
-}
\ No newline at end of file
+}
+
diff --git a/index.js b/index.js
index 5e18514..ccb6a47 100644
--- a/index.js
+++ b/index.js
@@ -26,6 +26,7 @@ app.use(cors());
//Rutas
app.use('/api',require('./routes/users'));
app.use('/api',require('./routes/compras'))
+app.use('/api',require('./routes/ingresos'))
app.use('/api',require('./routes/categorias'))
app.use('/api',require('./routes/metodos_pago'))
app.disable('x-powered-by');
diff --git a/routes/ingresos.js b/routes/ingresos.js
new file mode 100644
index 0000000..f828757
--- /dev/null
+++ b/routes/ingresos.js
@@ -0,0 +1,73 @@
+const router = require("express").Router();
+const Ingreso = require("../models/ingresos");
+const { checkAuth } = require("../middlewares/authentication");
+
+
+router.get("/ingreso", checkAuth, async (req, res) => {
+ var Ingresos;
+ Ingresos = await Ingreso.find({ user: req.userData._id }).sort({
+ fecha: "desc",
+ });
+
+ return res.send(
+ {
+ status:"ok",
+ data:Ingresos
+ }
+ )
+ });
+
+ router.post("/ingreso", checkAuth, async (req, res) => {
+ const { fecha, detalle, valor} = req.body;
+ const newIngreso = new Ingreso({
+ fecha,
+ detalle,
+ valor
+ });
+
+ console.log(newIngreso)
+ newIngreso.user = req.userData._id;
+ await newIngreso.save();
+
+ res.json({
+ status:"OK"
+ })
+
+
+ });
+
+
+ router.put("/ingreso", checkAuth, async (req, res) => {
+ const { _id, fecha, detalle, valor } = req.body;
+ const Ingreso_edit = await Ingreso.findOne({ _id: _id });
+ await Ingreso_edit.updateOne({ fecha, detalle, valor});
+
+
+ res.json({
+ status:"OK"
+ })
+
+
+ });
+
+
+
+ router.delete("/ingreso", checkAuth, async (req, res) => {
+
+ try{
+ const userId = req.userData._id;
+ const id = req.query.id;
+
+ const resultado = await Ingreso.deleteOne({user:userId,_id:id});
+
+ return res.json({status:"ok",data: resultado})
+
+ }
+ catch(error){
+ console.log(error);
+ return res.status(500).json({status:"fail",error:error})
+ }
+ });
+
+
+ module.exports = router;
\ No newline at end of file