diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 262aed25e..336f2ff0b 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -798,6 +798,22 @@ Public Class ClsVentas Return Retorno End Function + Public Function UpdateIxCAnticipoAutorizado(CveIE As Integer, Autorizado As Boolean) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_IxCAnticipoAutorizadoUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus del anticipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasFechaVencimientoUpdate") diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 8dc66da28..0b3a38715 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -243,7 +243,7 @@ -
+
@@ -273,7 +273,7 @@
-
+
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 34dea6f3a..d0ab743c1 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -45,12 +45,15 @@ Partial Class Bancos_DepositosCaja 'HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={StrEncriptPrueba}" If UsuarioActual.CveEmpresa = 189 Then - If DdlTipoPago.Items.FindByValue("-1") IsNot Nothing Then - DdlTipoPago.Items.Remove(DdlTipoPago.Items.FindByValue("-1")) - End If + If DdlTipoPago.Items.FindByValue("-1") IsNot Nothing Then + DdlTipoPago.Items.Remove(DdlTipoPago.Items.FindByValue("-1")) End If - End If + DivDescuentocheck.Visible = False + DivIntercheck.Visible = False + End If + + End If End Sub Private Sub CargaCuentas() @@ -509,7 +512,7 @@ Partial Class Bancos_DepositosCaja FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, FechaI, FechaF) Then - Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem')") + Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") 'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") 'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index b91f6aae5..07edc6ac6 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -935,6 +935,39 @@ Partial Class Clientes If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then DivAseguradora.Visible = True + End If + + 'PROCESOS PARA OCULTAR OPCIONES + If TabAnticipos.Visible Then + TabAnticipos.Visible = Not UsuarioActual.TienePermisoProceso(391) + End If + + If TabComplementos.Visible Then + TabComplementos.Visible = Not UsuarioActual.TienePermisoProceso(392) + End If + + If TabOtros.Visible Then + TabOtros.Visible = Not UsuarioActual.TienePermisoProceso(393) + End If + + If TabUsuarios.Visible Then + TabUsuarios.Visible = Not UsuarioActual.TienePermisoProceso(394) + End If + + If TabContratos.Visible Then + TabContratos.Visible = Not UsuarioActual.TienePermisoProceso(395) + End If + + If TabSistema.Visible Then + TabSistema.Visible = Not UsuarioActual.TienePermisoProceso(396) + End If + + If TabDocumentacion.Visible Then + TabDocumentacion.Visible = Not UsuarioActual.TienePermisoProceso(397) + End If + + If TabRH.Visible Then + TabRH.Visible = Not UsuarioActual.TienePermisoProceso(398) End If End If @@ -1746,10 +1779,11 @@ Partial Class Clientes ElseIf UsuarioActual.Empresa.TipoContabilidad = 2 Then divCuentas.Visible = False divCuentasContp.Visible = True - End If - - - 'Ocultamos la mayoria de informacion si es no-frecuente + End If + + + + 'Ocultamos la mayoria de informacion si es no-frecuente If ObjClientes.TipoCliente = 2 Then If UsuarioActual.CveEmpresa <> 141 Then TabFiscalContable.Visible = False @@ -1769,7 +1803,8 @@ Partial Class Clientes 'DivPortletBitacora.Visible = False BtnEliminar.Visible = False - End If + End If + TxtCorreoEntregaCompras.Text = ObjClientes.DtResultados(0)("CorreoEntregaCompras").ToString() TxtCorreoEntregaAlmacen.Text = ObjClientes.DtResultados(0)("CorreoEntregaAlmacen").ToString() @@ -1803,11 +1838,11 @@ Partial Class Clientes TxtRepresentanteLegal.Text = ObjClientes.RepresentanteLegal End If + UpActivacionPortal.Update() UpModalPersonaFisica.Update() ObjClientes.Dispose() - watch.Stop() ' Alert(watch.ElapsedMilliseconds.ToString()) @@ -2992,7 +3027,17 @@ Partial Class Clientes If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) AndAlso CType(sender, GridView).ID = "GVAnticipos" Then - If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString() = "Ant" Then + If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then + If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then + e.Row.FCLinkButton("LnkAutorizar").Visible = True + e.Row.FCLinkButton("LnkCancelar").Visible = False + Else + e.Row.FCLinkButton("LnkAutorizar").Visible = False + e.Row.FCLinkButton("LnkCancelar").Visible = True + End If + End If + + If e.Row.DBCampo("CveIE").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("IxC") Then If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then e.Row.FCLinkButton("LnkAutorizar").Visible = True e.Row.FCLinkButton("LnkCancelar").Visible = False @@ -10744,14 +10789,23 @@ Partial Class Clientes Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero() - If CveVenta > 0 Then + Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero() + + If CveVenta > 0 OrElse CveIE > 0 Then Using ObjVentas As New ClsVentas - If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then - Alert("El anticipo se autorizó correctamente") + If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then + If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then + Alert("El anticipo se autorizó correctamente") + End If + ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then + If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then + Alert("El anticipo se autorizó correctamente") + End If End If End Using - CargaAnticipos() End If + + CargaAnticipos() End Sub Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs) diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index eb276ac57..dc5681eff 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -203,6 +203,9 @@ Partial Class Ventas_PVCobranza LkbEstadodeCaja.Visible = True LkbIngreso.Visible = True LkbRetiro.Visible = True + If UsuarioActual.CveEmpresa = 189 Then + LkbRetiro.Visible = False + End If UpTurno.Visible = True End If @@ -343,6 +346,11 @@ Partial Class Ventas_PVCobranza 'e.Row.CssClass = "blue-madison" End If + If e.Row.DBCampo("RemisionEspecial") = "1" Then + e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#e9edef") + e.Row.ToolTip = "Remisión especial" + End If + If e.Row.DBCampo("TipoEntrega") = "2" OrElse e.Row.DBCampo("AplicaImpresionPorAnt") = "1" Then e.Row.FCLinkButton("LnkImprimir").Visible = True ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkImprimir")) @@ -831,6 +839,9 @@ Partial Class Ventas_PVCobranza DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal)) DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal)) DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal)) + DtAnticipos.Columns.Add("Fecha", GetType(DateTime)) + DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal)) + DtAnticipos.Columns.Add("Folio", GetType(String)) For Each GvRow As GridViewRow In GVAnticipos.Rows If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then @@ -844,8 +855,11 @@ Partial Class Ventas_PVCobranza Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal() Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal() Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero() + Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime() + Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal() + Dim Folio = GvRow.DataKey("Folio") - DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda) + DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio) End If Next @@ -968,6 +982,9 @@ Partial Class Ventas_PVCobranza DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal)) DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal)) DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal)) + DtAnticipos.Columns.Add("Fecha", GetType(DateTime)) + DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal)) + DtAnticipos.Columns.Add("Folio", GetType(String)) For Each GvRow As GridViewRow In GVAnticipos.Rows If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then @@ -981,8 +998,11 @@ Partial Class Ventas_PVCobranza Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal() Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal() Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero() + Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime() + Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal() + Dim Folio = GvRow.DataKey("Folio") - DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda) + DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio) End If Next @@ -1019,38 +1039,44 @@ Partial Class Ventas_PVCobranza ObjFactura.Timbre.CFDIRelacionados.UUID.Clear() If HdnTipoAmortizacion.Value = "2" Then Dim Anticipos = ListaAnticiposAplicados.Where(Function(Obj) Obj.Tipo = "Ant") - For Each Ant As Modelos.MAnticipoRelacionado In Anticipos - ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) - Next + If Anticipos IsNot Nothing AndAlso Anticipos.Count() > 0 Then + For Each Ant As Modelos.MAnticipoRelacionado In Anticipos + ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) + Next - ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "07" - ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo" + ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "07" + ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo" - 'AJUSTAR NC - If ObjNC IsNot Nothing Then - ObjNC.Timbre.CFDIRelacionados.UUID.Clear() + 'AJUSTAR NC + If ObjNC IsNot Nothing Then + ObjNC.Timbre.CFDIRelacionados.UUID.Clear() - ObjNC.Timbre.CFDIRelacionados.TipoRelacion = "07" - ObjNC.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo" + ObjNC.Timbre.CFDIRelacionados.TipoRelacion = "07" + ObjNC.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo" + End If End If + End If 'DEVOLUCIONES DE OTRA VENTA, APLICADAS EN UNA NUEVA If HdnTipoAmortizacion.Value = "4" Then Dim DevolucionesNC = ListaAnticiposAplicados.Where(Function(Obj) Obj.Tipo = "NC") - For Each Ant As Modelos.MAnticipoRelacionado In DevolucionesNC - ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) - Next + If DevolucionesNC IsNot Nothing AndAlso DevolucionesNC.Count() > 0 Then + For Each Ant As Modelos.MAnticipoRelacionado In DevolucionesNC + ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) + Next - 'TEMPORAL- DEBE SER TIPO RELACION "01 - Nota de crédito de los documentos relacionados" - Dim CveTipoRelacion As Integer = 1 + 'TEMPORAL- DEBE SER TIPO RELACION "01 - Nota de crédito de los documentos relacionados" + Dim CveTipoRelacion As Integer = 1 - ObjFactura.CveTipoRelacion = CveTipoRelacion + ObjFactura.CveTipoRelacion = CveTipoRelacion - Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}") + Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}") - ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString() - ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString() + ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString() + ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString() + + End If End If @@ -1187,22 +1213,58 @@ Partial Class Ventas_PVCobranza ObjPVenta.Dispose() End Sub + + Private Function ValidaCobranza() As Boolean + Dim Respuesta As Boolean = False + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + + Dim ObjMovtos As New ClsMovimientos() + Dim FechaI, FechaF As Date + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) + + If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero(), FechaI, FechaF) Then + Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") + 'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") + 'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta + + If dtt.Rows.Count = 0 Then + Respuesta = True + Else + Respuesta = False + Alert("No se puede realizar el cerrar el turno, ya que hay cobros pendientes por aplicar.", TipoMensaje.MsgAdvertencia) + End If + + Else + Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia) + Respuesta = False + End If + ObjMovtos.Dispose() + Else + Respuesta = True + End If + + Return Respuesta + End Function + Private Sub BtnCerrarTurno_Click(sender As Object, e As EventArgs) Handles BtnCerrarTurno.Click 'validar. ' que no existan movimientos pendientes de pago. ' que no halla facturas pendientes de cancelación. ' no facturar remisiones de días anteriores - - 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) + If ValidaCobranza() Then + 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 If - ObjPVenta.Dispose() End Sub Private Sub BtnCerrarBloqueo_Click(sender As Object, e As EventArgs) Handles BtnCerrarBloqueo.Click Dim ObjPVenta As New ClsPuntoVenta @@ -1239,6 +1301,10 @@ Partial Class Ventas_PVCobranza ObjPVenta.Dispose() + If UsuarioActual.CveEmpresa = 189 Then + LkbRetiro.Visible = False + End If + RegistraScript("$('#DivCorteDeCaja').hide();") UpTurno.Update() @@ -1702,16 +1768,34 @@ Partial Class Ventas_PVCobranza Dim ObjProceso As New ClsSisProcesos If ObjProceso.GetUsuariosconProceso(379, UsuarioActual.CveEmpresa) Then 'proceso para autorizar - dtt = ObjProceso.DtResultados.Copy() + dtt = ObjProceso.DtResultados.FiltraParametros("", DistinctColumns:={"CveUsuario", "Celular"}) End If ObjProceso.Dispose() + Dim NombreCliente As String = "" + If gvr.DataKey("CveCliente").ToEntero() > 0 Then + NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=gvr.DataKey("CveCliente").ToEntero()).FiltroPrimeroValor("NombreComercial") + End If + + Dim EnvioMsg As Boolean = False + If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then For Each dr As DataRow In dtt.Rows - ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio}
Ir Activar", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB) + Dim NumeroTelefono = "526621143532" + 'If EsProduccion Then + ' NumeroTelefono = String.Format("52{0}", dr("Celular").ToString()) + 'End If + EnvioMsg = ModExtensiones.EnviarNotificacionWhatsApp2(NumeroTelefono, "", $"Solicitud de activación de anticipo.\\nFolio: {Folio}.\\nCliente: {NombreCliente}.") + 'ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio}
Ir Activar", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB) Next End If + If EnvioMsg Then + Alert("Se envió una solicitud de autorización") + Else + Alert("No se envió la solicitud de autorización", TipoMensaje.MsgAdvertencia) + End If + UpAnticipos.Update() End Sub @@ -1806,7 +1890,7 @@ Partial Class Ventas_PVCobranza End If If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then - If e.Row.DBCampo("Tipo").ToString().Contiene("Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then + If e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado" e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 340c0f9ae..628d6c0ad 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -865,6 +865,16 @@ + + Remisión Especial:  + + + + + + + + Sin existencia:  diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1ccbb5c4b..79bb303f6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3614,6 +3614,10 @@ Partial Class Ventas End If + If UsuarioActual.Empresa.CveEmpresa = 189 Then + ImgAntiPend.Visible = False + End If + End If End Sub @@ -5236,6 +5240,15 @@ Partial Class Ventas DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero() EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If DbRowVenta("Num2").ToString().ToEntero() = 2000 Then + ChkRemEspecial.Checked = True + ChkRemEspecial.Enabled = False + TxtFech2.Text = DbRowVenta("Fech2").ToString() + TrRemEspecial.Visible = UsuarioActual.TienePermisoProceso(390) + End If + End If + 'If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then ' Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) ' If TienePermiso <> "" Then ' si tiene acceso en el subproyecto @@ -6650,10 +6663,14 @@ Partial Class Ventas DdlTipoRelacionARelacionar.Items.Insert(0, New ListItem("-", "-1")) End Sub Private Sub CargaFormaEntrega() - TrFormaEntrega.Visible = True - DdlFormaEntrega.DataSource = GlobalDTVtaCondicionesEntrega(UsuarioActual.CveEmpresa) - DdlFormaEntrega.DataBind() - DdlFormaEntrega.Items.Insert(0, New ListItem("Seleccione", "-1")) + If GlobalDTVtaCondicionesEntrega(UsuarioActual.CveEmpresa).Rows.Count > 0 Then + TrFormaEntrega.Visible = True + DdlFormaEntrega.DataSource = GlobalDTVtaCondicionesEntrega(UsuarioActual.CveEmpresa) + DdlFormaEntrega.DataBind() + DdlFormaEntrega.Items.Insert(0, New ListItem("Seleccione", "-1")) + Else + TrFormaEntrega.Visible = False + End If End Sub Private Sub CargaMonedas() DdlMoneda.DataSource = GlobalDTMonedas @@ -12418,6 +12435,15 @@ Partial Class Ventas End If End If + 'VALOR PARA REMISIONES ESPECIALES + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If ObjFactura.TipoDocto = "Rem" AndAlso ChkRemEspecial.Checked Then + ObjFactura.Num2 = 2000 + 'FECHA DE VIGENCIA PARA REMISION ESPECIAL + ObjFactura.Fech2 = DateTime.Now.AddDays(1).Date + End If + End If + If divcondicionespago.Visible Then ObjFactura.FechaPago = TxtFechaPago.Text.ToDate Else @@ -18549,6 +18575,10 @@ Partial Class Ventas TrAntEspecial.Visible = DdlTipoComprobante.SelectedValue = "Ant" End If + If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then + TrRemEspecial.Visible = UsuarioActual.TienePermisoProceso(390) + End If + 'REINICIALIZA VALORES DE ENTREGA POR ADELANTADO RequiereAlmacenDestino = False TrAlmacenAsignado.Visible = False @@ -18696,6 +18726,7 @@ Partial Class Ventas ImgAntiPend.Visible = True End If + If ImgAntiPend.Visible Then If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('NC','RNC','IxC','Ant') ", "")}")