--Mover a pantalla de cobranza(PVCobranza.aspx). el inicio de turno y y ocultarlo en la pantalla de ventas, se activará en el proceso 371
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -16,11 +16,22 @@ Partial Class Ventas_PVCobranza
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property DineroCaja As Double
|
||||||
|
Get
|
||||||
|
Return If(IsNothing(ViewState("DineroCaja")), 0, ViewState("DineroCaja").ToString().ToDecimal())
|
||||||
|
End Get
|
||||||
|
Set(value As Double)
|
||||||
|
ViewState("DineroCaja") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
CveCorte = 0
|
CveCorte = 0
|
||||||
CargaFiltros()
|
CargaFiltros()
|
||||||
CargaCorteCaja()
|
If UsuarioActual.TienePermisoProceso(371) Then
|
||||||
|
CargaCorteCaja()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -59,6 +70,7 @@ Partial Class Ventas_PVCobranza
|
|||||||
DdlCuentaTarjetaDebito.DataBind()
|
DdlCuentaTarjetaDebito.DataBind()
|
||||||
DdlCuentaCheque.DataBind()
|
DdlCuentaCheque.DataBind()
|
||||||
DdlCuentaTransferencia.DataBind()
|
DdlCuentaTransferencia.DataBind()
|
||||||
|
|
||||||
TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
@@ -66,6 +78,9 @@ Partial Class Ventas_PVCobranza
|
|||||||
TxtImporteTransferencia.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteTransferencia.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
|
||||||
|
|
||||||
|
TxtEfectivoEnCaja.Attributes.Add("onKeyUp", "CalculaDiferencia();")
|
||||||
|
TxtEfectivoCajaBloqueo.Attributes.Add("onKeyUp", "CalculaDiferenciaBloqueo();")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaCorteCaja()
|
Private Sub CargaCorteCaja()
|
||||||
@@ -77,13 +92,96 @@ Partial Class Ventas_PVCobranza
|
|||||||
|
|
||||||
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||||
CveCorte = ObjPVenta.CveCorte
|
CveCorte = ObjPVenta.CveCorte
|
||||||
|
Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5)
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then
|
||||||
|
DebeCerrarCorte = True
|
||||||
|
LblMotivoBloqueo.Text = $"Existe un corte del día <b>{FechaICorte.ToString("dd/MM/yyyy")}</b>. Favor de cerrarlo para iniciar un nuevo corte."
|
||||||
|
Else
|
||||||
|
LblTurno.Text = ObjPVenta.FechaInicial.ToShortDateString
|
||||||
|
BtnIniciarTurno.Visible = False
|
||||||
|
LkbEstadodeCaja.Visible = True
|
||||||
|
LkbIngreso.Visible = True
|
||||||
|
LkbRetiro.Visible = True
|
||||||
|
UpTurno.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
UpTurno.Visible = False
|
||||||
|
'Ingresar un nuevo Turno
|
||||||
|
RegistraScript("window.onload = function MuestraCorteCaja() { document.getElementById(""C_btnShow"").click(); }")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjPVenta.Dispose()
|
ObjPVenta.Dispose()
|
||||||
|
|
||||||
|
If DebeCerrarCorte Then
|
||||||
|
CargaDatosCorte()
|
||||||
|
RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }")
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaDatosCorte()
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
Dim Total As Double
|
||||||
|
|
||||||
|
If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
|
||||||
|
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
Total = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble + ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble + ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
|
||||||
|
DineroCaja = Total
|
||||||
|
LblEfectivoEsperado.Text = Total.FormatoNumero(2)
|
||||||
|
LblEfectivoBloqueo.Text = Total.FormatoNumero(2)
|
||||||
|
|
||||||
|
Dim Dt As New DataTable
|
||||||
|
|
||||||
|
Dt.Columns.Add("Descripcion", GetType(String))
|
||||||
|
Dt.Columns.Add("Importe", GetType(Decimal))
|
||||||
|
|
||||||
|
Dim Dr1 As DataRow = Dt.NewRow
|
||||||
|
Dr1("Descripcion") = "Fondo de Caja"
|
||||||
|
Dr1("Importe") = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble
|
||||||
|
Dt.Rows.Add(Dr1)
|
||||||
|
|
||||||
|
Dim Dr2 As DataRow = Dt.NewRow
|
||||||
|
Dr2("Descripcion") = "Ventas en Efectivo"
|
||||||
|
Dr2("Importe") = ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble
|
||||||
|
Dt.Rows.Add(Dr2)
|
||||||
|
|
||||||
|
Dim Dr21 As DataRow = Dt.NewRow
|
||||||
|
Dr21("Descripcion") = "Devoluciones"
|
||||||
|
Dr21("Importe") = ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
|
||||||
|
Dt.Rows.Add(Dr21)
|
||||||
|
|
||||||
|
'Dim Dr3 = Dt.NewRow
|
||||||
|
'Dr3("Descripcion") = "Propinas"
|
||||||
|
'Dr3("Importe") = ObjPVenta.DtResultados(0)("Propina").ToString().ToDouble
|
||||||
|
'Dt.Rows.Add(Dr3)
|
||||||
|
|
||||||
|
Dim Dr4 As DataRow = Dt.NewRow
|
||||||
|
Dr4("Descripcion") = "Entradas"
|
||||||
|
Dr4("Importe") = ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble
|
||||||
|
Dt.Rows.Add(Dr4)
|
||||||
|
|
||||||
|
Dim Dr5 As DataRow = Dt.NewRow
|
||||||
|
Dr5("Descripcion") = "Salidas"
|
||||||
|
Dr5("Importe") = ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble
|
||||||
|
Dt.Rows.Add(Dr5)
|
||||||
|
|
||||||
|
Dim Dr6 As DataRow = Dt.NewRow
|
||||||
|
Dr6("Descripcion") = "Total"
|
||||||
|
Dr6("Importe") = Total
|
||||||
|
Dt.Rows.Add(Dr6)
|
||||||
|
|
||||||
|
GvDineroCaja.DataSource = Dt
|
||||||
|
GvDineroCaja.DataBind()
|
||||||
|
UpDineroCaja.Update()
|
||||||
|
UpTerminarCorte.Update()
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
|
||||||
|
End Sub
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
|
|
||||||
Dim ObjMovtos As New ClsMovimientos()
|
Dim ObjMovtos As New ClsMovimientos()
|
||||||
@@ -278,4 +376,126 @@ Partial Class Ventas_PVCobranza
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Protected Sub BtnCerrarCaja_Click(sender As Object, e As EventArgs)
|
||||||
|
RegistraScript("$('#DivEstadoCaja').modal('hide')")
|
||||||
|
RegistraScript("$('#DivTerminarCorte').modal()", "divterminarcorte")
|
||||||
|
End Sub
|
||||||
|
Protected Sub LkbIngreso_Click(sender As Object, e As EventArgs)
|
||||||
|
CargaIngresoEgreso(1)
|
||||||
|
End Sub
|
||||||
|
Public Sub CargaIngresoEgreso(Opcion As Integer)
|
||||||
|
RegistraScript("$('#DivIngresoEgreso').modal()")
|
||||||
|
If Opcion = 1 Then
|
||||||
|
LblTituloIE.Text = "Ingreso de Efectivo: "
|
||||||
|
HdnTipoMovimiento.Value = "1"
|
||||||
|
ElseIf Opcion = 0 Then
|
||||||
|
LblTituloIE.Text = "Retiro de Efectivo: "
|
||||||
|
HdnTipoMovimiento.Value = "0"
|
||||||
|
End If
|
||||||
|
UpIngresoEgreso.Update()
|
||||||
|
End Sub
|
||||||
|
Protected Sub LkbRetiro_Click(sender As Object, e As EventArgs)
|
||||||
|
CargaIngresoEgreso(0)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LkbEstadodeCaja_Click(sender As Object, e As EventArgs) Handles LkbEstadodeCaja.Click
|
||||||
|
CargaDatosCorte()
|
||||||
|
CargaVentasPago()
|
||||||
|
CargaEntradasSalidas()
|
||||||
|
RegistraScript("$('#DivEstadoCaja').modal()")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaVentasPago()
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
|
||||||
|
If ObjPVenta.GetVta_MetodosPago(CveCorte) Then
|
||||||
|
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||||
|
GvMetodosPago.DataSource = ObjPVenta.DtResultados
|
||||||
|
GvMetodosPago.DataBind()
|
||||||
|
UpMetodosPago.Update()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
End Sub
|
||||||
|
Private Sub CargaEntradasSalidas()
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
|
||||||
|
'Salida
|
||||||
|
If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 0) Then
|
||||||
|
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||||
|
GvEgresos.DataSource = ObjPVenta.DtResultados
|
||||||
|
GvEgresos.DataBind()
|
||||||
|
UpEgresos.Update()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Entrada
|
||||||
|
If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 1) Then
|
||||||
|
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||||
|
GvIngresos.DataSource = ObjPVenta.DtResultados
|
||||||
|
GvIngresos.DataBind()
|
||||||
|
UpIngresos.Update()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
End Sub
|
||||||
|
Private Sub BtnCerrarTurno_Click(sender As Object, e As EventArgs) Handles BtnCerrarTurno.Click
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
If TxtEfectivoEnCaja.Text.Trim <> "" Then
|
||||||
|
If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
|
||||||
|
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
|
||||||
|
Dim Liga As String = "document.location.href=""/Ventas/PVCobranza.aspx"";"
|
||||||
|
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
End Sub
|
||||||
|
Private Sub BtnCerrarBloqueo_Click(sender As Object, e As EventArgs) Handles BtnCerrarBloqueo.Click
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
If TxtEfectivoCajaBloqueo.Text.Trim <> "" Then
|
||||||
|
If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
|
||||||
|
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
|
||||||
|
Dim Liga As String = "document.location.href=""/Ventas/PVCobranza.aspx"";"
|
||||||
|
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("Debe especificar el efectivo en caja", TipoMensaje.MsgAdvertencia)
|
||||||
|
RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }")
|
||||||
|
End If
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
End Sub
|
||||||
|
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
|
||||||
|
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
|
||||||
|
CveCorte = ObjPVenta.CveCorte
|
||||||
|
LblTurno.Text = NowADS().ToShortDateString
|
||||||
|
UpTurno.Visible = True
|
||||||
|
LkbEstadodeCaja.Visible = True
|
||||||
|
LkbIngreso.Visible = True
|
||||||
|
LkbRetiro.Visible = True
|
||||||
|
BtnIniciarTurno.Visible = False
|
||||||
|
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
|
||||||
|
RegistraScript("$('#DivCorteDeCaja').hide();")
|
||||||
|
|
||||||
|
UpTurno.Update()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtnAceptarIE_Click(sender As Object, e As EventArgs) Handles BtnAceptarIE.Click
|
||||||
|
Dim ObjPVenta As New ClsPuntoVenta
|
||||||
|
If TxtCantidadIE.Text.ToEntero() > 0 Then
|
||||||
|
If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
|
||||||
|
TxtCantidadIE.Text = ""
|
||||||
|
TxtDescripcionIE.Text = ""
|
||||||
|
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
|
||||||
|
Alert("El movimiento se realizó correctamente")
|
||||||
|
UpIngresoEgreso.Update()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjPVenta.Dispose()
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user