diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 9ab579855..9f4d8f0e8 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -6576,14 +6576,17 @@ Public Class ClsContabilidad End Function #Region "F L U C T U A C I O N - C A M B I A R I A" - Public Function UpdateVentaTCValuacion(CveVenta As Integer, TCValuacion As Decimal) As Boolean + Public Function UpdateTCValuacion(CveVenta As Integer, CveCompra As Integer, CveIE As Integer, TCValuacion As Decimal, CveEmpresa As Integer) As Boolean Dim Retorno = False - DataAdapter("PA_Conta_VentasTCValuacionUpdate") + DataAdapter("PA_Conta_TipoCambioValuacionUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@TCValuacion", SqlDbType.Decimal).Value = TCValuacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -6615,6 +6618,7 @@ Public Class ClsContabilidad Return Retorno End Function + #End Region #Region "IDisposable Support" diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 04d56a648..36a2814a5 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1,6 +1,7 @@ Option Strict On Option Explicit On +Imports System Imports System.Data Imports System.Data.SqlClient Imports Extensiones @@ -4111,6 +4112,32 @@ Public Class ClsGenerales #End Region + + Public Function GetMediosTransporte(CveOrigen As Integer, Estatus As Boolean, CveEmpresa As Integer, CveTipoNomina As Integer, CveSubProyecto As Integer, Tipo As Integer, GPO As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Agro_OrigenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOrigen", SqlDbType.Int).Value = CveOrigen + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveTipoNomina", SqlDbType.Int).Value = CveTipoNomina + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@GPO", SqlDbType.Int).Value = GPO + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError($"Ocurrió un error al obtener los medios de transporte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 469a026bf..f7896eacb 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1091,13 +1091,17 @@ Public Class ClsPaginas ' Application("GlobalDTSucursales") = value ' End Set 'End Property - Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable + Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1, Optional RegimenFiscalReceptor As String = "-1") As DataTable Get If EsPersonaFisica <> -1 Then - Dim Tipo As String = "" - If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1" + Dim Tipo As New StringBuilder + If EsPersonaFisica = 1 Then Tipo.Append("AplicaPersonaFisica = 1") Else Tipo.Append("AplicaPersonaMoral = 1") - Dim Dv As New DataView(DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows) + If RegimenFiscalReceptor <> "-1" Then + Tipo.AppendFormat("AND RegimenFiscalReceptor LIKE '%{0}%'", RegimenFiscalReceptor) + End If + + Dim Dv As New DataView(DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable), Tipo.ToString(), " UsoCFDIDescripcion", DataViewRowState.CurrentRows) GlobalDTSATUsosCFDI = Dv.ToTable Dv.Dispose() Else diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 26432a79f..1e17d5ae3 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -745,7 +745,8 @@ Public Class ClsVentas Public Function UpdateEstatusFactura(Estatus As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveVenta As Integer, Optional IdPolizaCancelacion As Integer = -1, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1", - Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional EstadoCancelacion As String = "") As Boolean + Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional EstadoCancelacion As String = "", + Optional CveEstadoCancelacion As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasUpdateEstatus") @@ -765,6 +766,7 @@ Public Class ClsVentas .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion .Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion .Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion + .Add("@CveEstadoCancelacion", SqlDbType.TinyInt).Value = CveEstadoCancelacion End With Try @@ -855,7 +857,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional EstadoCancelacion As String = "") As Boolean + Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional EstadoCancelacion As String = "", Optional CveEstadoCancelacion As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasCancelacion") @@ -868,6 +870,7 @@ Public Class ClsVentas .Add("@CvePAC", SqlDbType.SmallInt).Value = CvePAC .Add("@CveEstatusRefacturacion", SqlDbType.TinyInt).Value = CveEstatusRefacturacion .Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion + .Add("@CveEstadoCancelacion", SqlDbType.TinyInt).Value = CveEstadoCancelacion .Add("@Cancelada", SqlDbType.SmallInt).Direction = ParameterDirection.Output End With diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index fcad20aec..087d8e134 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4636,8 +4636,8 @@ Namespace Modelos ''' Cancela la factura para poder realizar la refacturacion ''' ''' - Public Function CancelarPorRefacturacion(CveMotivoCancelacion As Integer, Motivo As String, Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = False) As MCancelacionVentaMensaje - Return CancelarVenta(Me, Me.UsuarioActual, EsRefacturacion:=True, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, FolioSustitucion:=FolioSustitucion, ValidarSAT:=ValidarSAT) + Public Function CancelarPorRefacturacion(CveMotivoCancelacion As Integer, Motivo As String, Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = False, Optional CveEstadoCancelacion As Integer = 0) As MCancelacionVentaMensaje + Return CancelarVenta(Me, Me.UsuarioActual, EsRefacturacion:=True, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, FolioSustitucion:=FolioSustitucion, ValidarSAT:=ValidarSAT, CveEstadoCancelacion:=CveEstadoCancelacion) End Function ''' ''' Cancela la factura y realiza las operaciones correspondientes @@ -4645,15 +4645,15 @@ Namespace Modelos ''' ''' ''' - Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True) As MCancelacionVentaMensaje + Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0) As MCancelacionVentaMensaje 'Comprobante emitido con errores sin relación - Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo) + Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion) End Function Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False, - Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, - Optional FechaCancelacion As String = "-1", Optional AcuseCancelacion As String = "", - Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True) As MCancelacionVentaMensaje + Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1", + Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", + Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0) As MCancelacionVentaMensaje Dim Retorno As New MCancelacionVentaMensaje() Dim ErrorList As New List(Of String) @@ -4801,6 +4801,7 @@ Namespace Modelos Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion) + If Not EsRefacturacion Then CveEstatusRefacturacion = 0 End If @@ -4828,7 +4829,7 @@ Namespace Modelos Dim Continuar As Boolean = False Dim ContinuarCancelacion As Boolean = False Dim ObtenerAcuse As Boolean = False - Dim RequiereAceptacion As Boolean = False + Dim RequiereAceptacion As Boolean = True Dim Mensaje As String = "" Dim CveSATMotivoCancelacion As Integer = -1 @@ -4845,6 +4846,14 @@ Namespace Modelos CveEstatusFacturaAsignado = 23 End If + 'SI NO SE ASIGNA EL ESTATUS DE CANCELACION, TOMA EL GUARADO DE LA FACTURA + CveEstadoCancelacion = If(CveEstadoCancelacion <= 0, ObjFactura.CveEstadoCancelacion, CveEstadoCancelacion) + + 'SI YA SE CONOCE EL ESTADO DE CANCELACION, NO LO VERIFICA ANTE EL SAT + If CveEstadoCancelacion > 0 Then + ValidarSAT = False + End If + If CveEstatusFacturaAsignado <= 0 Then Try If ObjFactura.FolioFiscal <> "" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then @@ -4919,22 +4928,26 @@ Namespace Modelos If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then CveEstatus = 20 ContinuarCancelacion = False + RequiereAceptacion = True ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then CveEstatus = 20 ContinuarCancelacion = True RequiereAceptacion = True ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then ContinuarCancelacion = True + RequiereAceptacion = False CveEstatus = 5 End If Else If Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then ContinuarCancelacion = True + RequiereAceptacion = False CveEstatus = 5 Else CveEstatus = 20 ContinuarCancelacion = False + RequiereAceptacion = True CancelacionFecha = Now.Date CancelacionAcuse = "" End If @@ -4951,10 +4964,19 @@ Namespace Modelos CancelacionFecha = Now.Date CancelacionAcuse = "" - Dim diasTimbrado As Decimal = DateDiff(DateInterval.Day, ObjFactura.FechaCP, Now) + 'VERICA SI YA SE TIENE EL ESTADO DE CANCELACION, PARA SABER SI REQUIERE ACEPTACION + If CveEstadoCancelacion > 0 Then + If CveEstadoCancelacion = 1 Then + RequiereAceptacion = False + ElseIf CveEstadoCancelacion = 2 Then + RequiereAceptacion = True + End If + Else + Dim diasTimbrado As Decimal = DateDiff(DateInterval.Day, ObjFactura.FechaCP, Now) - If ObjFactura.Total < 5000D OrElse diasTimbrado <= 3 OrElse ObjFactura.Cliente.RFC.Contiene("XAXX010101000", "XEXX010101000") Then - RequiereAceptacion = False + If ObjFactura.Total < 1000D OrElse diasTimbrado <= 1 OrElse ObjFactura.Cliente.RFC.Contiene("XAXX010101000", "XEXX010101000") Then + RequiereAceptacion = False + End If End If End If @@ -5596,13 +5618,14 @@ Namespace Modelos If CveEstatus.Contiene(4, 5) Then - If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion, EstadoCancelacion:=EstadoCancelacion) Then + If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion, EstadoCancelacion:=EstadoCancelacion, CveEstadoCancelacion:=CveEstadoCancelacion) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar el estatus de cancelación." End If Else If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion, - CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=MotivoCancelacion, EstadoCancelacion:=EstadoCancelacion) Then + CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion, + MotivoCancelacion:=MotivoCancelacion, EstadoCancelacion:=EstadoCancelacion, CveEstadoCancelacion:=CveEstadoCancelacion) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar el estatus de cancelación." End If @@ -6257,6 +6280,7 @@ Namespace Modelos Public Property RFCReceptor As String = "" Public Property ServicioDomicilio As Boolean Public Property CveEstatusRefacturacion As Integer = 0 + Public Property CveEstadoCancelacion As Integer = 0 Public Property NuevaFactura As Integer Public Property EnviarCorreo As Boolean = False Public Property ErrorList As List(Of String) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index f161ebbdc..cb222b49c 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -232,7 +232,7 @@ -
+
-
+
-
-
-
+ +

- - + + + - + <%----%> @@ -339,7 +339,7 @@ -
+
-
+
-
+
-
+
-
- - - +
@@ -524,7 +522,7 @@ @@ -553,7 +551,7 @@
-
+
diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb index 5ffc3dff2..6c56fa07f 100644 --- a/RH/CatPersonal.aspx.vb +++ b/RH/CatPersonal.aspx.vb @@ -62,7 +62,7 @@ Partial Class RH_CatPersonal CargaJornada() CargaEstados() CargaSatRiesgoPuesto() - + CargaMedioTransporte() LoadDefaultValues() @@ -288,6 +288,18 @@ Partial Class RH_CatPersonal 'End If UpSubProyecto.Update() End Sub + Private Sub CargaMedioTransporte() + Dim objgenerales As New ClsGenerales() + objgenerales.GetMediosTransporte(-1, True, UsuarioActual.CveEmpresa, -1, -1, -1, -1) + DdlMedioTransporte.Items.Clear() + DdlMedioTransporte.DataSource = objgenerales.DtResultados + DdlMedioTransporte.DataBind() + 'filtro por usuario subproyecto/sucursal vsh + 'If UsuarioActual.CveEmpresa = 7 Then + ' DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1).FiltraParametros($"CveSubProyecto = { UsuarioActual.CveSubProyecto }") + 'End If + 'UpSubProyecto.Update() + End Sub Private Sub CargaTipoCentroCosto() diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx index 332b5e7ed..531702304 100644 --- a/Ventas/ClientesAbonar.aspx +++ b/Ventas/ClientesAbonar.aspx @@ -187,11 +187,18 @@
-
- -
+
+
Otros Ingresos:
+
+ + +
Liquidación:
+
+ +
+
@@ -264,6 +271,8 @@ DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago,CveTipoRetencion,Descuento,ClaveMetodoPagoSAT" CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None"> + + <%--0--%> @@ -272,58 +281,84 @@ + <%--1--%> Venta - - <%----%> + <%--2--%> - Fecha Venta + Tipo
Docto
+ + + +
+ <%--3--%> + + Fecha
Venta
+ <%--4--%> - Fecha Vencimiento + Fecha
Vencimiento
+ <%--5--%> - Días Vencidos + Días
Vencidos
-   +
- - + <%--6--%> + + Método
de Pago
+ + + +
+ <%--7--%> + + Forma
de Pago
+ + + +
+ <%--8--%> - Monto Compra + Monto
Compra
 
+ <%--9--%>   + <%--10--%> Abonado   + <%--11--%> Saldo   + <%--12--%> Abonar @@ -331,6 +366,7 @@ + <%--13--%> Ot. Ing. @@ -338,33 +374,96 @@ + <%--14--%> - Descuento Pronto Pago + Descuento
Pronto Pago
 
- + <%--15--%> + + Generar
NC
+ + + <%--16--%> + + Col. 1 + + + + + <%--17--%> + + Col. 2 + + + + + <%--18--%> + + Col. 3 + + + + + <%--19--%> + + Col. 4 + + + + + <%--20--%> + + Col. 5 + + + + + <%--21--%> + + Col. 6 + + + + + <%--22--%> + + Col. 7 + + + + + <%--23--%> + + Total
Liquidación
+ + + +
+ + <%--24--%> Auxiliar + <%--25--%> CveVenta - - + <%--26--%> - Complemento Pago + Complemento
Pago
@@ -508,7 +607,7 @@ diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index bba882c29..207f07c10 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -257,7 +257,7 @@ Partial Class Ventas_ClientesAbonar IdCuentaBancaria = 0 - TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0)) + TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1},-1);", "TxtTotal", 0)) If CveMoneda > 0 Then LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda")) @@ -292,6 +292,12 @@ Partial Class Ventas_ClientesAbonar RVTxtFechaDocumento.MaximumValue = Now.ToString("dd/MM/yyyy") + + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + DvLiquidacion1.Visible = True + DvLiquidacion2.Visible = True + End If + End If If (CveMonedaFiltro = 2 And ChkPagarPesos.Checked) Then @@ -497,6 +503,7 @@ Partial Class Ventas_ClientesAbonar End Sub Protected Sub GvCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxC.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then Dim moneda As Integer = 0 If e.Row.RowIndex = 0 Then @@ -507,6 +514,19 @@ Partial Class Ventas_ClientesAbonar e.Row.Cells(3).Visible = False e.Row.Cells(4).Visible = False e.Row.BackColor = Drawing.Color.LightGray + + + e.Row.FCTextBox("TxtLiquidacionCol1").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol2").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol3").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol4").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol5").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol6").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol7").Visible = False + e.Row.FCTextBox("TxtLiquidacionCol8").Visible = False + + + End If If e.Row.RowIndex = 1 Then e.Row.Cells(0).Width = Unit.Pixel(25) @@ -548,9 +568,9 @@ Partial Class Ventas_ClientesAbonar End Select If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then - e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6},{0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID)) + e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6},{0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID, e.Row.DBCampo("CveVenta"))) Else - e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda)) + e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4},{5});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.DBCampo("CveVenta"))) End If If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then @@ -578,9 +598,32 @@ Partial Class Ventas_ClientesAbonar If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 AndAlso e.Row.DBCampo("DiasVencidos").ToEntero() <= 0 Then e.Row.FCCheckBox("ChkGenerarNC").Visible = True - e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda)) + e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda, e.Row.DBCampo("CveVenta"))) End If + e.Row.FCTextBox("TxtLiquidacionCol1").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol2").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol3").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol4").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol5").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol6").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol7").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiquidacionCol8").Attributes.Add("class", $"ClsSelLiquidacionVentaTotal{e.Row.DBCampo("CveVenta").ToEntero}") + + + e.Row.FCTextBox("TxtLiquidacionCol1").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiquidacionCol2").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiquidacionCol3").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiquidacionCol4").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiquidacionCol5").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiquidacionCol6").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiquidacionCol7").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + + + + + + Else e.Row.FCTextBox("TxtAbonar").Visible = False e.Row.FCTextBox("TxtComision").Visible = False @@ -823,7 +866,9 @@ Partial Class Ventas_ClientesAbonar 'inserto las ventas que voy a pagar For Each gvr As GridViewRow In GvCxC.Rows + If gvr.FCCheckBox("Chk").Checked Then + Dim ObjFactura As Modelos.Factura = Nothing If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then @@ -861,6 +906,7 @@ Partial Class Ventas_ClientesAbonar If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then EsAnticipoEspecial = True If dtConceptos IsNot Nothing Then + For Each Row As DataRow In dtConceptos.Rows Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero @@ -1487,7 +1533,84 @@ Partial Class Ventas_ClientesAbonar End If End If + Next + + + Dim ImporteLiquidacion1 As Decimal = gvr.FCTextBox("TxtLiquidacionCol1").Text.ToDecimal + Dim ImporteLiquidacion2 As Decimal = gvr.FCTextBox("TxtLiquidacionCol2").Text.ToDecimal + Dim ImporteLiquidacion3 As Decimal = gvr.FCTextBox("TxtLiquidacionCol3").Text.ToDecimal + Dim ImporteLiquidacion4 As Decimal = gvr.FCTextBox("TxtLiquidacionCol4").Text.ToDecimal + Dim ImporteLiquidacion5 As Decimal = gvr.FCTextBox("TxtLiquidacionCol5").Text.ToDecimal + Dim ImporteLiquidacion6 As Decimal = gvr.FCTextBox("TxtLiquidacionCol6").Text.ToDecimal + Dim ImporteLiquidacion7 As Decimal = gvr.FCTextBox("TxtLiquidacionCol7").Text.ToDecimal + + Dim CveClasificacionCol1 As Integer = 21267 + Dim CveClasificacionCol2 As Integer = 21229 + Dim CveClasificacionCol3 As Integer = 21520 + Dim CveClasificacionCol4 As Integer = 21519 + Dim CveClasificacionCol5 As Integer = 21547 + Dim CveClasificacionCol6 As Integer = 21572 + Dim CveClasificacionCol7 As Integer = 21571 + + Dim CveSubProyectoLiquidacion As Integer = gvr.DataKey("CveSubProyecto").ToEntero + + Dim CveConceptoLiquidacion As Integer = 51 + + If ImporteLiquidacion1 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion1, "Liquidacion Col 1", CveConceptoLiquidacion, "Liquidacion Col 2", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion1 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + If ImporteLiquidacion2 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion2, "Liquidacion Col 2", CveConceptoLiquidacion, "Liquidacion Col 2", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion2 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + If ImporteLiquidacion3 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion3, "Liquidacion Col 4", CveConceptoLiquidacion, "Liquidacion Col 3", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion3 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + + If ImporteLiquidacion4 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion4, "Liquidacion Col 4", CveConceptoLiquidacion, "Liquidacion Col 4", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion4 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + + + If ImporteLiquidacion5 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion5, "Liquidacion Col 5", CveConceptoLiquidacion, "Liquidacion Col 5", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion5 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + If ImporteLiquidacion6 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion6, "Liquidacion Col 6", CveConceptoLiquidacion, "Liquidacion Col 6", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion6 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + If ImporteLiquidacion7 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion7, "Liquidacion Col 7", CveConceptoLiquidacion, "Liquidacion Col 7", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion7 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If + End If + + + End If If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() @@ -3136,4 +3259,46 @@ Partial Class Ventas_ClientesAbonar Calendario.EndDate = DateTime.Now End Sub + + +#Region "LIQUIDACION" + + Protected Sub ChkLiquidacion_CheckedChanged(sender As Object, e As EventArgs) + + + If ChkLiquidacion.Checked Then + '16-23 + GvCxC.Columns(16).Visible = True + GvCxC.Columns(17).Visible = True + GvCxC.Columns(18).Visible = True + GvCxC.Columns(19).Visible = True + GvCxC.Columns(20).Visible = True + GvCxC.Columns(21).Visible = True + GvCxC.Columns(22).Visible = True + GvCxC.Columns(23).Visible = True + + GvCxC.Columns(26).Visible = False + + Else + GvCxC.Columns(16).Visible = False + GvCxC.Columns(17).Visible = False + GvCxC.Columns(18).Visible = False + GvCxC.Columns(19).Visible = False + GvCxC.Columns(20).Visible = False + GvCxC.Columns(21).Visible = False + GvCxC.Columns(22).Visible = False + GvCxC.Columns(23).Visible = False + + GvCxC.Columns(26).Visible = True + + + End If + + UPVentas.Update() + + End Sub + +#End Region + + End Class diff --git a/Ventas/MetasVendedores.aspx b/Ventas/MetasVendedores.aspx index 26f289904..913d8faf7 100644 --- a/Ventas/MetasVendedores.aspx +++ b/Ventas/MetasVendedores.aspx @@ -52,7 +52,7 @@ - Metas de Vendedores + Scorecard Ventas
  • diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 9d68c30bf..756088bb6 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -264,7 +264,7 @@
  • - + <%----%> diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 36978c5c2..8541c148b 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -1372,7 +1372,7 @@ Partial Class ProductosyServicios ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim, - CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero) > 0 Then + CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal) > 0 Then ViewState("CvePS") = ObjProductosServicios.CvePS For Each GVR As GridViewRow In GvImpuestosLocales.Rows If GVR.FCCheckBox("ChkDeduccion").Checked Then @@ -1423,7 +1423,7 @@ Partial Class ProductosyServicios ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim, - CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero) Then + CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal) Then If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then TieneError = True diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb index 48888726d..f23491722 100644 --- a/Ventas/RepProductosServiciosDetalle.aspx.vb +++ b/Ventas/RepProductosServiciosDetalle.aspx.vb @@ -451,12 +451,13 @@ Partial Class Ventas_RepProductosServiciosDetalle DdlGrupo.SelectedValueExist(GPO) RblTipoCambio.SelectedValue = TipoCambio.ToString If TipoCambio > 1 Then CveMoneda = -1 + CargarMarcas(CveMarca) CargaProvedores(CveProveedorCompra) 'If CveProveedorCompra.ToEntero > 0 Then DdlProveedor.SelectedValue = CveProveedorCompra DdlTipoPSDes.SelectedValueExist(CveClasificacionDetalle) - CargaDatos(CveProyecto, CveSubProyecto, CveCategoria, CveClasificacion, CvePS, Mes, MesEjec, CveCliente, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatus, GPO.ToEntero, TipoDocto, CveMarca, ModalidadContable) - CargarMarcas(CveMarca) + CargaDatos() + End Sub #End Region @@ -497,32 +498,6 @@ Partial Class Ventas_RepProductosServiciosDetalle Agrupador = DdlGrupo.SelectedItem.Text End Sub - Private Sub CargaDatos(CveProyecto As String, CveSubProyecto As String, CveCategoria As String, CveClasificacion As String, CvePS As String, Mes As String, MesEjec As String, CveCliente As Integer, CveSubProyectoEjecucion As String, CveVendedor As Integer, CveUsuario As String, CveEstatus As String, Gpo As Integer, TipoDocto As String, CveMarca As Integer, ModalidadContable As Boolean) - Dim ObjVentas As New ClsVentas() - Dim FechaI, FechaF, FechaIEjec, FechaFEjec As Date - FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha) - FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha) - FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.ToDate, MinFecha) - FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.ToDate, MaxFecha) - Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) - Dim TipoComprobante As String = If(DdlTipoComprobante.GetSelectedValuesM = "", "-1", DdlTipoComprobante.GetSelectedValuesM) - - If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDouble Else TCEspecifico = -1 - - If ObjVentas.GetRepProductosServiciosDetalle(CveProyecto.ToEntero, CveSubProyecto.ToEntero, CveCategoria.ToEntero, CveClasificacion.ToEntero, CvePS.ToEntero, - FechaI, FechaF, Mes.ToEntero, FechaIEjec, FechaFEjec, MesEjec.ToEntero, CveCliente.ToEntero, CveSubProyectoEjecucion.ToEntero, - CveVendedor, CveUsuario.ToEntero, CveEstatus.ToEntero, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante, - GPO:=Gpo, CveMoneda:=CveMoneda, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, - CveProveedorCompra:=CveProveedorCompra, CveMarca:=CveMarca, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then - GvDatos.DataSource = ObjVentas.DtResultados - TmpDT = ObjVentas.DtResultados - Else - GvDatos.DataSource = Nothing - End If - ObjVentas.Dispose() - GvDatos.DataBind() - Agrupador = DdlGrupo.SelectedItem.Text - End Sub Protected Sub BtnTipoCambio_Click(sender As Object, e As EventArgs) CargaDatos() RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio")) @@ -533,14 +508,10 @@ Partial Class Ventas_RepProductosServiciosDetalle DivMarca.Visible = True LblMarca.Visible = True - Dim ObjMarcas As New ClsProductosServicios - If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then - DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados - ObjMarcas.Dispose() - DdlMarcaPSDes.DataBind() - End If + DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) + DdlMarcaPSDes.DataBind() End If - DdlMarcaPSDes.Items.Insert(0, New ListItem(" - ", "-1")) + DdlMarcaPSDes.Items.Insert(0, New ListItem("Todas", "-1")) DdlMarcaPSDes.Items.FindByValue(CStr(CveMarca)).Selected = True End Sub #End Region @@ -573,14 +544,7 @@ Partial Class Ventas_RepProductosServiciosDetalle End If Else If Not e.Row.DBCampo("CveVenta").ToEntero > 0 Then - 'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(0).Width = Unit.Pixel(200) - 'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(1).Width = Unit.Pixel(60) - 'e.Row.Cells(2).Width = Unit.Pixel(90) - 'e.Row.Cells(3).Width = Unit.Pixel(90) - 'e.Row.Cells(5).Width = Unit.Pixel(80) - 'e.Row.Cells(8).Width = Unit.Pixel(100) + If e.Row.DBCampo("Gpo") = "" Then e.Row.Cells(5).Text = e.Row.DBCampo("Moneda").ToString e.Row.CssClass = "Totales" @@ -593,9 +557,6 @@ Partial Class Ventas_RepProductosServiciosDetalle End If - - - 'Dim FechaI, FechaF As String 'FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") 'FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") @@ -663,7 +624,6 @@ Partial Class Ventas_RepProductosServiciosDetalle DdlProveedor.Attributes.Add("data-metodo", "getproveedores") DdlProveedor.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor)) Else - DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedor.DataBind() DdlProveedor.ddl.Items.Insert(0, New ListItem("Todos", "-1")) diff --git a/Ventas/RepRecuperacion.aspx.vb b/Ventas/RepRecuperacion.aspx.vb index 61db1d92a..2321748eb 100644 --- a/Ventas/RepRecuperacion.aspx.vb +++ b/Ventas/RepRecuperacion.aspx.vb @@ -182,13 +182,13 @@ Partial Class Ventas_RepRecuperacion Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}", DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, -1, e.Row.DBCampo("CveTipoTransaccion")) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion")) e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4 Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}", DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, -1, e.Row.DBCampo("CveTipoTransaccion")) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion")) e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5 diff --git a/Ventas/RepRecuperacionDetalle.aspx b/Ventas/RepRecuperacionDetalle.aspx index bf1ee36a7..1c3a85292 100644 --- a/Ventas/RepRecuperacionDetalle.aspx +++ b/Ventas/RepRecuperacionDetalle.aspx @@ -179,8 +179,8 @@
    -
    Fecha Aplicado Inicio:
    -
    +
    Fecha Aplicado I:
    +
    @@ -194,8 +194,8 @@
    -
    Fecha Aplicado Fin:
    -
    +
    Fecha Aplicado F:
    +
    @@ -225,8 +225,8 @@
    -
    F. Registro IE inicio:
    -
    +
    F. Registro IE Inicio:
    +
    @@ -241,7 +241,7 @@
    F. Registro IE Fin:
    -
    +
    @@ -257,6 +257,16 @@
    +
    +
    Condiciones de Pago
    +
    + + + + + + +
    diff --git a/Ventas/RepRecuperacionDetalle.aspx.vb b/Ventas/RepRecuperacionDetalle.aspx.vb index 8be1388ab..6103a062e 100644 --- a/Ventas/RepRecuperacionDetalle.aspx.vb +++ b/Ventas/RepRecuperacionDetalle.aspx.vb @@ -147,11 +147,11 @@ Partial Class Ventas_RepRecuperacionDetalle txtFechaI.Text = FechaI End If - FechaAplicadoI = If(Request("FechaAplicadoI") IsNot Nothing And Request("FechaAplicadoI").ToString <> "01/01/1900", Request("FechaAplicadoI").ToString, "-1").ToString - FechaAplicadoF = If(Request("FechaAplicadoF") IsNot Nothing And Request("FechaAplicadoF").ToString <> "01/01/9999", Request("FechaAplicadoF").ToString, "-1").ToString + FechaAplicadoI = If(Request("FechaAplicadoI") IsNot Nothing AndAlso Request("FechaAplicadoI").ToString <> "01/01/1900", Request("FechaAplicadoI").ToString, "-1").ToString + FechaAplicadoF = If(Request("FechaAplicadoF") IsNot Nothing AndAlso Request("FechaAplicadoF").ToString <> "01/01/9999", Request("FechaAplicadoF").ToString, "-1").ToString - FechaRegistroIEI = If(Request("FechaRegistroIEI") IsNot Nothing And Request("FechaRegistroIEI").ToString <> "01/01/1900", Request("FechaRegistroIEI").ToString, "-1").ToString - FechaRegistroIEF = If(Request("FechaRegistroIEF") IsNot Nothing And Request("FechaRegistroIEF").ToString <> "01/01/9999", Request("FechaRegistroIEF").ToString, "-1").ToString + FechaRegistroIEI = If(Request("FechaRegistroIEI") IsNot Nothing AndAlso Request("FechaRegistroIEI").ToString <> "01/01/1900", Request("FechaRegistroIEI").ToString, "-1").ToString + FechaRegistroIEF = If(Request("FechaRegistroIEF") IsNot Nothing AndAlso Request("FechaRegistroIEF").ToString <> "01/01/9999", Request("FechaRegistroIEF").ToString, "-1").ToString If FechaAplicadoF <> "-1" Then TxtFechaAplicadoF.Text = FechaAplicadoF @@ -187,7 +187,6 @@ Partial Class Ventas_RepRecuperacionDetalle CveClienteClasificacion = IfNull(Request("CveClienteClasificacion"), "-1").ToString.ToEntero Tipo = IfNull(Request("Tipo"), "-1").ToString.ToEntero EsDistribuidor = IfNull(Request("EsDistribuidor"), "-1").ToString.ToEntero - Dim CveTipoTransaccion As Integer = IfNull(Request("CveTipoTransaccion"), "-1").ToString.ToEntero 'Carga Clasificacion Cliente' Dim ObjCliente As New ClsClientes @@ -232,7 +231,8 @@ Partial Class Ventas_RepRecuperacionDetalle DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion) DdlClienteSucursal.SelectedValueExist(CveClienteSucursal) DdlDistribuidor.SelectedValueExist(EsDistribuidor) - DdlTipoTransaccion.SelectedValueExist(CveTipoTransaccion) + DdlTipoTransaccion.SelectedValueExist(IfNull(Request("CveTipoTransaccion"), "-1").ToString.ToEntero) + DdlCondicionesPago.SelectedValueExist(IfNull(Request("CveCondicionesPago"), "-1").ToString.ToEntero) If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then lblEsDistribuidor.Visible = True @@ -260,7 +260,7 @@ Partial Class Ventas_RepRecuperacionDetalle DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo, EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF, - CveTipoTransaccion:=DdlTipoTransaccion.SelectedValue.ToEntero) Then + CveTipoTransaccion:=DdlTipoTransaccion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then GvDatos.DataSource = ObjMovtos.DtResultados DtDatos = ObjMovtos.DtResultados diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 3e278eee2..9e94a4355 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1170,11 +1170,13 @@ - + + + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3dddaee0d..805a7c828 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1267,6 +1267,15 @@ Partial Class Ventas End Set End Property + Private Property CveEstadoCancelacion As Integer + Get + Return If(IsNothing(ViewState("CveEstadoCancelacion")), 0, CType(ViewState("CveEstadoCancelacion"), Integer)) + End Get + Set(value As Integer) + ViewState("CveEstadoCancelacion") = value + End Set + End Property + Private Property PermiteCredito As Boolean Get Return If(IsNothing(ViewState("PermiteCredito")), False, CBool(ViewState("PermiteCredito"))) @@ -1321,6 +1330,14 @@ Partial Class Ventas ViewState("RFCReceptorVenta") = value End Set End Property + Private Property RegimenFiscalCliente As String + Get + Return IfNull(ViewState("RegimenFiscalCliente"), "").ToString() + End Get + Set(value As String) + ViewState("RegimenFiscalCliente") = value + End Set + End Property Private Property Adjunto As String Get Return If(IsNothing(ViewState("Adjunto")), "", ViewState("Adjunto").ToString()) @@ -2245,6 +2262,7 @@ Partial Class Ventas SeCancelaRemisionProceso = False TotalOriginal = 0 CveAlmacenDevolucion = 0 + Me.CveEstadoCancelacion = 0 txtFechaICot.Text = Now.AddMonths(-3).ToShortDateString TxtFechaIRem.Text = Now.AddMonths(-3).ToShortDateString @@ -5681,8 +5699,12 @@ Partial Class Ventas 'End If End Sub Private Sub CargaUsoCFDI() - DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica) - DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica) + If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then + RegimenFiscalCliente = "-1" + End If + + DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) + DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) DdlUsoCFDI.DataBind() DdlSucursalUsoCFDI.DataBind() @@ -5964,6 +5986,10 @@ Partial Class Ventas ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) ViewState("CliPais") = ObjCliente.Pais ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal + If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then + RegimenFiscalCliente = ObjCliente.DtResultados(0)("CodigoRegimenFiscal").ToString() + CargaUsoCFDI() + End If 'ViewState("NumCtaPago") = ObjCliente.NumCtaPago ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS If Not ClienteDesglosaIEPS Then @@ -10111,8 +10137,8 @@ Partial Class Ventas 'si es cancelacion, debe de conservar el folio actual If Not EsCancelacion Then ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero(), -1) - 'SI ES FACTURACION DE REMISION O COTIZACION NO TOMAR EL FOLIO QUE SE MUESTRA - If Not EsCancelacion AndAlso ObjFactura.Folio > 0 AndAlso TipoDoctoViejo.Contiene("Rem", "Cot") Then + 'SI NO ESTABLECIO UN FOLIO FIJO Y SI ES FACTURACION DE REMISION O COTIZACION NO TOMAR EL FOLIO QUE SE MUESTRA + If Not EstablecioFolio AndAlso (Not EsCancelacion AndAlso ObjFactura.Folio > 0 AndAlso TipoDoctoViejo.Contiene("Rem", "Cot")) Then ObjFactura.Folio = -1 End If @@ -19258,6 +19284,7 @@ Partial Class Ventas End Sub Protected Sub TxtFolio_TextChanged(sender As Object, e As System.EventArgs) Handles TxtFolio.TextChanged ViewState("EstablecioFolio") = True + Alert("Se estableció el Folio Fijo para el nuevo documento.") End Sub Private Sub HabilitarFacturacionSucursal() trsucursalciente.Visible = True @@ -20735,12 +20762,14 @@ Partial Class Ventas If Vigencia.EsCancelable = "Cancelable sin aceptación" Then 'script = "BtnRefacturacionConfirmarAceptacion();" + Me.CveEstadoCancelacion = 1 sb.AppendFormat("{0}
    ", Vigencia.EsCancelable) sb.Append("Está seguro de realizar la refacturación?.") End If If Vigencia.EsCancelable = "Cancelable con aceptación" OrElse String.IsNullOrEmpty(Vigencia.EsCancelable) Then 'script = "BtnRefacturacionConfirmar();" + Me.CveEstadoCancelacion = 2 sb.AppendFormat("{0}
    ", "Cancelable con aceptación") sb.Append("Está seguro de cancelar el documento para realizar la refacturación?.") End If @@ -23129,7 +23158,7 @@ Partial Class Ventas If ObjVentas.EliminarVenta(CveVenta) Then ObjVentas.Commit() - Alert("La venta ha sido eliminada correctamente.", TipoMensaje.MsgInformacion) + Alert("La venta ha sido eliminada correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Clientes.aspx?CveCliente=" & CveCliente & """;") Else ObjVentas.RollBack() End If @@ -23460,6 +23489,13 @@ Partial Class Ventas sb.Append("No encontrado
    ") sb.Append("Está seguro de cancelar el documento?.") Else + 'GUARDA EL ESTADO DE CANCELACION + If Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then + Me.CveEstadoCancelacion = 2 + ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then + Me.CveEstadoCancelacion = 1 + End If + sb.AppendFormat("{0}
    ", Vigencia.EsCancelable) If Vigencia.EsCancelable.ToUpper() <> "NO CANCELABLE" Then sb.Append("Está seguro de cancelar el documento?.") @@ -23647,7 +23683,7 @@ Partial Class Ventas 'ObjE.AddEventoBitacora(msgBitacora, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) 'ObjE.Dispose() - resp = ObjFacturaCancelacion.CancelarPorRefacturacion(DdlMotivoRefacturacion.SelectedValue.ToEntero(), TxtMotivoRefac.Text.Trim()) + resp = ObjFacturaCancelacion.CancelarPorRefacturacion(DdlMotivoRefacturacion.SelectedValue.ToEntero(), TxtMotivoRefac.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) Else Dim ListaRemisionesCancelar As New List(Of Integer) If ChkCanRem.Checked Then @@ -23660,7 +23696,7 @@ Partial Class Ventas ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion - resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim()) + resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) End If SWatch.Stop() @@ -30562,7 +30598,11 @@ Partial Class Ventas BtnEmitirImprimir.Text = "Facturar" DdlTipoComprobante.SelectedValue = "Ing" - TxtFecha.Text = Now.ToShortDateString() + + If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then + TxtFecha.Text = Now.ToShortDateString() + End If + UpPS.Update() UpFacturar.Update() @@ -31280,7 +31320,9 @@ Partial Class Ventas Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue DdlTipoComprobante.SelectedValue = TipoDoctoNuevo - TxtFecha.Text = Now.ToString() + If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then + TxtFecha.Text = Now.ToString() + End If TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString TxtFechaEjecucion.Text = Now.ToString()