Example #1
0
 def detallarProds(self):
   self.setCursor(QtGui.QCursor(3))
   vs=RVentas(self.parent,self.periodo)
   num=QtGui.QInputDialog.getInt(self, self.parent.tr("Limite de articulos"),self.parent.tr("Limite de articulos a mostrar:"))
   tabla=vs.detallarProdsVendidos(num[0])
   self.teResumen.setHtml(tabla)
   self.html=tabla
   self.stackReportes.setCurrentIndex(2)
   self.setCursor(QtGui.QCursor(0))	
Example #2
0
 def detallarProds(self):
   self.setCursor(QtGui.QCursor(3))
   vs=Ventas(self.parent,self.periodo)
   num=QtGui.QInputDialog.getInt(self, self.parent.tr("Limite de articulos"),self.parent.tr("Limite de articulos a mostrar:"))
   tabla=vs.detallarProdsVendidos(num[0])
   self.teEntradasDetalle.setHtml(tabla)
   self.detalle=tabla
   self.stack.setCurrentIndex(1)
   self.setCursor(QtGui.QCursor(0))
Example #3
0
    def resumir(self):
	vs=Ventas(self.parent,self.periodo)
	(lista,resumen)=vs.resumir(self.periodo,self.parent.caja)
	self.efectivo=resumen['efectivo']
	movimientos=libutil.listaHtml(lista,'Tabla de movimientos',['Concepto','Monto'],'#fff','#1162A7',14,anchos=[70,30])
	head="id_movimiento,usuarios.nombre,cajas.nombre,detalle,tipo, monto,fecha"
	lista=Movimiento(self.parent.conexion).buscar(head,self.periodo+" order by tipo")
	movs=libutil.listaHtml(lista,'Tabla de movimientos de efectivo',
	"#,Usuario,Caja,Detalle,Tipo, Monto,Fecha".split(','),'#fff','#1162A7',10,opc="110",anchos=[5,15,15,22,13,15,15])
	ventas=vs.detallarVentas(caja=self.parent.caja,color='#fff',fondo='#1162A7')
	#dns=vs.detalleNotas(periodo=self.periodo,caja=self.parent.caja)
	#ventas=libutil.listaHtml(dns,'Detalle de ventas',['Tipo','Estado','Valor'],'#fff','#1162A7',12,anchos=[40,30,30])
	tabla=libutil.listaHtml([[movimientos+ventas,movs]],color='#fff',fondo='#1162A7',opc="000",anchos=[40,60])
	self.resumen=tabla
	self.teResumen.setHtml(tabla)
Example #4
0
    def detallar(self):
      	self.setCursor(QtGui.QCursor(3))
	ventas=RVentas(self.parent,self.periodo)
	(lista,resumen)=ventas.resumir(self.periodo,self.caja)
	movimientos=libutil.listaHtml(lista,'Entradas y salidas',['Concepto','Monto'],'#fff','#1162A7',14,anchos=[70,30])
	tventas=ventas.detallarVentas(caja=self.caja)+"<br/>"
	tcajas=ventas.detallarCajas(caja=self.caja)
	tusuarios=ventas.detallarUsuarios(caja=self.caja)
	tdeptos=ventas.detallarDeptos(caja=self.caja)
	tprods=ventas.detallarProds(caja=self.caja)
	tabla2=libutil.listaHtml([[tventas+tusuarios+tcajas,movimientos+tdeptos]],titulo="Resumen de movimientos",color='#fff',fondo='#1162A7',opc="000",anchos=[50,50])
	self.html=tabla2+tprods
	self.teResumen.setHtml(tabla2+tprods)	
	self.stackReportes.setCurrentIndex(2)
	self.setCursor(QtGui.QCursor(0))
Example #5
0
    def detallarEntradas(self):
	self.setCursor(QtGui.QCursor(3))
	ventas=Ventas(self.parent,self.periodo)
	tventas=ventas.detallarVentas(caja=self.parent.caja)+"<br/>"
	tcajas=ventas.detallarCajas()
	tusuarios=ventas.detallarUsuarios()
	tdeptos=ventas.detallarDeptos()
	tprods=ventas.detallarProds()
	tabla2=libutil.listaHtml([[tventas+tusuarios+tcajas,tdeptos]],titulo="Resumen de movimientos",opc="000",anchos=[40,60])
	self.teEntradasDetalle.setText(tabla2+tprods)	
	self.detalle=tabla2+tprods
	self.stack.setCurrentIndex(1)
	self.setCursor(QtGui.QCursor(0))
Example #6
0
    def detallarEntradas(self):
        self.setCursor(QtGui.QCursor(3))

        # ventas={'realizadas':[],'cobradas':[],'facturas':[],'notas':[],'efectivo':[],'credito':[]}
        # self.cursor.execute("select count(id), ROUND(sum(total),2) from notas where "+self.periodo+" ")
        # row=self.cursor.fetchone()
        # ventas['realizadas']=row
        # self.cursor.execute("select count(id), ROUND(sum(total),2) from notas where "+self.periodo+"  and status>0 ")
        # row=self.cursor.fetchone()
        # ventas['cobradas']=row
        # self.cursor.execute("select count(id), ROUND(sum(total),2) from notas where "+self.periodo+"  and tipo=1 ")
        # row=self.cursor.fetchone()
        # ventas['facturas']=row
        # self.cursor.execute("select count(id), ROUND(sum(total),2) from notas where "+self.periodo+"  and tipo=0 ")
        # row=self.cursor.fetchone()
        # ventas['notas']=row
        # self.cursor.execute("select count(id), ROUND(sum(total),2) from notas where "+self.periodo+"  and status=1 ")
        # row=self.cursor.fetchone()
        # ventas['efectivo']=row
        # self.cursor.execute("select count(id), ROUND(sum(total),2) from notas where "+self.periodo+" and status=2 ")
        # row=self.cursor.fetchone()
        # ventas['credito']=row
        # tabla='<h2>Tabla general de ventas</h2>\
        # <table cellspacing="6px" width="100%%">\
        # <TR> <Th>Concepto</Th><TH>Cantidad</TH><th>Valor</th>	</TR>\
        # <tr> <TD>Ventas realizadas</TD>	<TD >%s		</TD>       <TD >		%s</TD>      </tr>\
        # <tr> <TD>Ventas cobradas</TD>	<TD >%s		</TD>       <TD	>		%s</TD>      </tr>\
        # <tr> <TD>En efectivo</TD>	<TD >%s		</TD>       <TD >		%s</TD>      </tr>\
        # <tr> <TD>En credito</TD>	<TD >%s		</TD>       <TD >		%s</TD>      </tr>\
        # </table>'%(ventas['realizadas'][0],ventas['realizadas'][1],ventas['cobradas'][0],ventas['cobradas'][1],ventas['efectivo'][0],ventas['efectivo'][1],ventas['credito'][0],ventas['credito'][1])
        # self.teDetalles.setText(tabla)
        # rows=""
        # self.cursor.execute("select nombre,count(N.id), ROUND(sum(total),2) from notas as N, usuarios as U where "+self.periodo+" and status=1 and N.usuario=U.id_usuario group by N.usuario;")
        # ventas=self.cursor.fetchall()

        # for v in ventas:
        # rows+='<tr> <TD>%s</TD>	<TD >%s	</TD>       <TD >	%s</TD>      </tr>'%v;
        # tabla+='<h2>Tabla de ventas por usuario</h2><table cellspacing="6px" width="100%%"><TR> <Th>Usuario</Th><TH>Num. ventas</TH><th>Cantidad cobrada</th></TR>%s</table>'%rows;
        # self.teDetalles.setText(tabla)
        ##TABLA DE VENTAS POR DEP
        # periodo=self.periodo.replace("fecha", "n.fecha")
        # self.cursor.execute("select DISTINCT d.nombre,count(n.id),ROUND(sum(v.total),2) from productos as p, notas as n, vendidos as v, familias as f, departamentos as d where "+periodo+"  and v.venta=n.id and p.ref=v.producto and f.id=p.familia  and d.id=f.departamento  group by d.id;")
        # ventas=self.cursor.fetchall()
        # rows=""
        # for v in ventas:
        # rows+='<tr> <TD>%s</TD>	<TD >%s	</TD>       <TD >	%s</TD>      </tr>'%v;
        # tabla+='<H2>Tabla de ventas por departamento</H2><table cellspacing="6px" width="100%%"><TR> <Th>Departamento</Th><TH>Num. ventas</TH><th>Cantidad cobrada</th></TR>%s</table>'%rows;
        ventas = Ventas(self.parent, self.periodo)
        tab = ventas.detallarVentas()
        tab += "<br/>%s" % ventas.detallarCajas()
        tabu = ventas.detallarUsuarios()
        tab += "<br/>%s" % ventas.detallarDeptos()
        tabu += "<br/>%s" % ventas.detallarProds()
        # tabla=tab
        tabla2 = libutil.listaHtml(
            [[tab, tabu]],
            "Detalle de ventas </span><br/><span>En el periodo del %s al %s <br/> "
            % (
                self.deDesde.date().toString("(dd 'de' MMM 'del' yyyy)"),
                self.deHasta.date().toString("(dd 'de' MMM 'del' yyyy)"),
            ),
            [[50, "Departamento"], [50, "Ventas realizadas"]],
            "#1A4F67",
            "#eee",
            14,
            "100",
            "#totaldeventas > tr.odd{ background:rgba(0,0,0,0); }",
        )
        # print tabu

        # tabla2+="<br/><img src='/tmp/grafica.png'/>"
        self.teEntradasDetalle.setText(tabla2)
        self.stack.setCurrentIndex(2)
        self.setCursor(QtGui.QCursor(0))
Example #7
0
    def resumir(self,fecha='CURDATE()'):
	rvs=RVentas(self.parent,fecha)
	(lista,resumen)=rvs.resumir("date(fecha)={0}".format(fecha),self.caja)
	self.efectivo=resumen['efectivo']
	tabla=libutil.listaHtml(lista,'Tabla de movimientos de dinero',['Concepto','Monto'],'#333','#E2E6E7',14,anchos=[70,30])
	return tabla
Example #8
0
    def parcial(self):
	vs=RVentas(self.parent,self.periodo)
	tabla=vs.detallarVentas(caja=self.caja)
	self.teDetalles.setText(tabla)