This commit is contained in:
2024-06-17 22:11:57 -07:00
8 changed files with 176 additions and 393 deletions

View File

@@ -2002,6 +2002,14 @@
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
<tr align="left" >
<td>
<asp:Label runat="server" Font-Bold="true" ID="Label3">Sucursal:</asp:Label>
</td>
<td>
<asp:DropDownList ID="DdlSucursalCorte" runat="server" CssClass="form-control input-sm" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="170px"></asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="1">
<asp:Label runat="server" Text="Dinero En Caja:" Font-Bold="true" Width="120px" />
@@ -2012,7 +2020,7 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="REVCaja" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<tr runat="server" visible="false">
<td colspan="1">
<asp:Label runat="server" Text="Descripción:" Font-Bold="true" Width="120px" />
</td>

View File

@@ -2197,9 +2197,16 @@ Partial Class PV
End If
End Sub
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
If DdlSucursalCorte.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar una sucursal.", TipoMensaje.ToastAdventencia)
RegistraScript("window.onload = function MuestraCorteCaja() { document.getElementById(""C_btnShow"").click(); }")
Exit Sub
End If
Dim ObjPVenta As New ClsPuntoVenta
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, DdlSucursalCorte.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)
CveCorte = ObjPVenta.CveCorte
LblEstatusCaja.Text = NowADS().ToShortDateString
TrEstatusCaja.Visible = True
@@ -2998,8 +3005,14 @@ Partial Class PV
End Sub
Private Sub CargaDdlSubProyectos()
DdlSubProyectoDatos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ")
Dim dtt = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ")
DdlSubProyectoDatos.DataSource = dtt
DdlSubProyectoDatos.DataBind()
DdlSucursalCorte.DataSource = dtt
DdlSucursalCorte.DataBind()
DdlSucursalCorte.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSucursalCorte.SelectedValueExist(UsuarioActual.CveSubProyecto)
End Sub
Private Sub CargaVendedores()

View File

@@ -574,6 +574,14 @@
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
<tr align="left" >
<td>
<asp:Label runat="server" Font-Bold="true" ID="Label3">Sucursal:</asp:Label>
</td>
<td>
<asp:DropDownList ID="DdlSucursalCorte" runat="server" CssClass="form-control input-sm" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="170px"></asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="1">
<asp:Label runat="server" Text="Dinero En Caja:" Font-Bold="true" Width="120px" />

View File

@@ -79,8 +79,15 @@ Partial Class Ventas_PVCobranza
Private Sub CargaFiltros()
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataBind()
Dim dtt = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataSource = dtt
DdlSubProyecto.DataBind()
DdlSucursalCorte.DataSource = dtt.FiltraParametros("EsSucursal = True ")
DdlSucursalCorte.DataBind()
DdlSucursalCorte.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSucursalCorte.SelectedValueExist(UsuarioActual.CveSubProyecto)
txtFechaI.Text = Now.AddDays(-1).ToShortDateString
txtFechaF.Text = Now.ToShortDateString
@@ -584,6 +591,39 @@ Partial Class Ventas_PVCobranza
ObjFactura.DtRemisionesPS = DtRemisionesPS
ObjFactura.DtRemisiones = DtRemisiones
Dim DtPagos As DataTable = New DataTable("DtPagosFactura")
DtPagos.Columns.Add(New DataColumn("CveFormaPago", GetType(Integer)))
DtPagos.Columns.Add(New DataColumn("Importe", GetType(Decimal)))
If TxtImporteCredito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({4, TxtImporteCredito.Text.ToDecimal})
End If
If TxtImporteDebito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({18, TxtImporteDebito.Text.ToDecimal})
End If
If TxtImporteCheque.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({2, TxtImporteCheque.Text.ToDecimal})
End If
If TxtImporteTransferencia.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({3, TxtImporteTransferencia.Text.ToDecimal})
End If
If TxtImporteEfectivo.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({1, TxtImporteEfectivo.Text.ToDecimal})
End If
Dim PagoMaximo = DtPagos.MAX("Importe")
Dim CveFormaPago As Integer = DtPagos.FiltroPrimeroValor("CveFormaPago", $"Importe = {PagoMaximo}").ToEntero()
If CveFormaPago > 0 Then
ObjFactura.CveFormaPago33 = CveFormaPago
ObjFactura.CveMetodoPago33 = 1
End If
For Each Dr As DataRow In ObjFactura.DtRemisionesPS.Rows
ObjFactura.AgregarPS(Dr("CvePS").ToString().ToEntero(), Dr("Cantidad").ToString().ToDecimal(), Dr("PU").ToString().ToDecimal(), Dr("Descuento").ToString().ToDecimal, Dr("Obs").ToString(), CveUM:=Dr("CveUM").ToString().ToEntero(),
CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(),
@@ -794,9 +834,16 @@ Partial Class Ventas_PVCobranza
ObjPVenta.Dispose()
End Sub
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
If DdlSucursalCorte.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar una sucursal.", TipoMensaje.ToastAdventencia)
RegistraScript("window.onload = function MuestraCorteCaja() { document.getElementById(""C_btnShow"").click(); }")
Exit Sub
End If
Dim ObjPVenta As New ClsPuntoVenta
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, "", UsuarioActual.CveEmpresa)
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, "", DdlSucursalCorte.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)
CveCorte = ObjPVenta.CveCorte
LblTurno.Text = NowADS().ToShortDateString
UpTurno.Visible = True

View File

@@ -4932,6 +4932,15 @@
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
<tr align="left" >
<td>
<asp:Label runat="server" Font-Bold="true" ID="Label3">Sucursal:</asp:Label>
</td>
<td>
<asp:DropDownList ID="DdlSucursalCorte" runat="server" CssClass="form-control input-sm" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="170px"></asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="1">
<asp:Label runat="server" Text="Dinero En Caja:" Font-Bold="true" Width="120px" />
@@ -4942,7 +4951,7 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="REVCaja" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<tr runat="server" visible="false">
<td colspan="1">
<asp:Label runat="server" Text="Descripción:" Font-Bold="true" Width="120px" />
</td>
@@ -8930,7 +8939,7 @@
</div>
<%-- MODAL PS ADICIONALES --%>
<div id="DivSimilares" class="modal ADS fade" role="dialog" style="z-index:9999;">
<div id="DivSimilares" class="modal ADS fade" role="dialog" style="z-index: 9999;">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpSimilares" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>

View File

@@ -3808,9 +3808,16 @@ Partial Class Ventas
End If
End Sub
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
If DdlSucursalCorte.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar una sucursal.", TipoMensaje.ToastAdventencia)
RegistraScript("window.onload = function MuestraCorteCaja() { document.getElementById(""C_btnShow"").click(); }")
Exit Sub
End If
Dim ObjPVenta As New ClsPuntoVenta
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, 1, UsuarioActual.CveEmpresa)
ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, DdlSucursalCorte.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)
CveCorte = ObjPVenta.CveCorte
LblEstatusCaja.Text = NowADS().ToShortDateString
TrEstatusCaja.Visible = True
@@ -6750,6 +6757,11 @@ Partial Class Ventas
Me.PermiteCredito = ObjCliente.PermiteCredito
LnkAgregarCliente.Visible = False
'SI EL CLIENTE ES DIFERENTE DEL PREDETERMINADO Y PERMITE CREDITO, REGRESAR EL METODO DE PAGO A CREDITO
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(714).ToEntero() > 0 AndAlso CveCliente <> UsuarioActual.Empresa.Funcionalidad(714).ToEntero() AndAlso RBLPago.SelectedValue = "2" AndAlso Me.PermiteCredito Then
RBLPago.SelectedValue = "1"
End If
If UsuarioActual.Empresa.Funcionalidad(714) <> "" Then 'cuando inicia cargado con el cliente. publico general
LnkAgregarCliente.Visible = True
End If
@@ -8299,6 +8311,11 @@ Partial Class Ventas
DdlSubProyectoFiltroAF.DataBind()
DdlSubProyectoFiltroAF.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSucursalCorte.DataSource = dtt.FiltraParametros("EsSucursal = True ")
DdlSucursalCorte.DataBind()
DdlSucursalCorte.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSucursalCorte.SelectedValueExist(UsuarioActual.CveSubProyecto)
dtt.Dispose()
End Sub
Private Sub CargaClasificaciones()
@@ -10719,6 +10736,8 @@ Partial Class Ventas
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot", "DPe", "PeC", "PA")) Then
ObjVentas.Commit()
BtnEmitirImprimir.Visible = False
ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
@@ -13177,6 +13196,12 @@ Partial Class Ventas
End If
End If
'SI ES DEVOLUCION DIRECTA, SIN RELACION A UNA FACTURA
'If UsuarioActual.CveEmpresa.Contiene(1, 192) AndAlso DdlTipoComprobante.SelectedValue = "Dev" AndAlso CveVentaDevolucion <= 0 AndAlso Timbre.CFDIRelacionados.UUID.Count = 0 Then
' Timbre.CFDIRelacionados.TipoRelacion = ""
' Timbre.CFDIRelacionados.TipoRelacionTexto = ""
'End If
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
If Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
@@ -13809,22 +13834,20 @@ Partial Class Ventas
End If
'VALIDA ENTREGA POR ADELANTADO
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then 'If UsuarioActual.CveEmpresa.Contiene(4, 72, 80, 119) Then
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
If CveAlmacenTraspasoDestino <= 0 And factura.TipoDocto = "Rem" Then
CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero()
End If
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
If CveAlmacenTraspasoDestino <= 0 And factura.TipoDocto = "Rem" Then
CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero()
End If
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
If CveAlmacenTraspasoDestino <= 0 And factura.TipoDocto = "Rem" Then
ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
End If
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
If CveAlmacenTraspasoDestino <= 0 And factura.TipoDocto = "Rem" Then
ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
If factura.TipoDocto = "RNC" And CveVentaDevolucion > 0 Then
CveAlmacenTraspasoOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero()
CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero()
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
If factura.TipoDocto = "RNC" And CveVentaDevolucion > 0 Then
CveAlmacenTraspasoOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero()
CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero()
End If
End If
@@ -16274,7 +16297,7 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Rem") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
If UsuarioActual.CveEmpresa <> 189 AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Rem") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim DebeGenerarMovimiento As Boolean = TmpDTDetalle.COUNT("CvePS", "CveTipoPS = 2") > 0
@@ -20249,6 +20272,12 @@ Partial Class Ventas
'Puede Hacer Devolución
If Not UsuarioActual.TienePermisoProceso(264) Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Dev"))
Else
'If UsuarioActual.CveEmpresa.Contiene(1, 192) Then
' If DdlTipoComprobante.Items.FindByValue("Dev") Is Nothing Then
' DdlTipoComprobante.Items.Add(New ListItem("Devolución", "Dev"))
' End If
'End If
End If
'Puede facturar
@@ -38370,7 +38399,18 @@ Partial Class Ventas
End Sub
Private Sub RecalculaPrecios()
If TmpDT IsNot Nothing AndAlso (CveVenta <= 0 OrElse EsCreaApartirDe OrElse ModalidadEdicion) Then
Dim PuedeRecalcular As Boolean = False
If CveVenta <= 0 OrElse EsCreaApartirDe OrElse (ModalidadEdicion AndAlso Not DdlTipoComprobante.SelectedValue = "Cot") Then
PuedeRecalcular = True
End If
'SI ES FACTURACION DE COTIZACION, NO PERMITIR CAMBIAR LISTA DE PRECIO
If DtCotizacionesPS IsNot Nothing AndAlso DtCotizacionesPS.Rows.Count > 0 Then
PuedeRecalcular = False
End If
If TmpDT IsNot Nothing AndAlso PuedeRecalcular Then
For Each Row As DataRow In TmpDT.Rows
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
Dim CveClasificacion As Integer = Row("CveClasificacion").ToString().ToEntero