This commit is contained in:
HECTOR RODRIGUEZ
2021-04-22 20:07:46 -07:00
26 changed files with 1431 additions and 500 deletions

View File

@@ -875,6 +875,23 @@ Public Class ClsAcumuladores
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function UpdatePolizaVirtual(CvePolizaVirtual As Integer, CveMarca As Integer, FechaUsado As DateTime) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un al actualizar el envio de la poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String) As Boolean Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate") SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate")

View File

@@ -514,6 +514,23 @@ Public Class ClsNominas
Return Retorno Return Retorno
End Function End Function
Public Function DeleteNom_NominasDetalles(CveConcepto As Integer, CvePersonal As Integer, CvePeriodo As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Nom_NominasDetallesDelete")
SqlAdapter.SelectCommand.Parameters.Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto
SqlAdapter.SelectCommand.Parameters.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
SqlAdapter.SelectCommand.Parameters.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveNom_NominasDetalles(CveNominaDetalle As Integer) As Boolean Public Function RemoveNom_NominasDetalles(CveNominaDetalle As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -2108,13 +2125,14 @@ Public Class ClsNominas
Return retorno Return retorno
End Function End Function
Public Function GetCalculoSBC(CveEmpresa As Integer, FechaCalculo As String) As Boolean Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
Try Try
DTSet = New DataSet() DTSet = New DataSet()
DataAdapter("PA_GetCalculoSBC", CommandType.StoredProcedure) DataAdapter("PA_GetCalculoSBC", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = Tipo
.Add("@Fecha", SqlDbType.Date).Value = FechaCalculo .Add("@Fecha", SqlDbType.Date).Value = FechaCalculo
End With End With
@@ -2514,6 +2532,97 @@ Public Class ClsNominas
End Function End Function
#End Region #End Region
#Region "CRUD_RH_TablasValores"
Public Function RH_TablasValoresGet(cveEmpresa As Int32, tipo As Int32) As Boolean
Dim retorno As Boolean = False
Try
DataAdapter("PA_RH_TablasValoresGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = tipo
End With
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function RH_TablasValoresAdd(cveEmpresa As Int32, fecha As DateTime, tipo As Int32, valor As Decimal) As Boolean
Dim retorno As Boolean = False
Try
DataAdapter("PA_RH_TablasValoresAdd", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = tipo
.Add("@fecha", SqlDbType.DateTime).Value = fecha
.Add("@valor", SqlDbType.Money).Value = valor
End With
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function RH_TablasValoresUp(cveEmpresa As Int32, fecha As DateTime, tipo As Int32, valor As Decimal) As Boolean
Dim retorno As Boolean = False
Try
DataAdapter("PA_RH_TablasValoresUp", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = tipo
.Add("@fecha", SqlDbType.DateTime).Value = fecha
.Add("@valor", SqlDbType.Money).Value = valor
End With
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function RH_TablasValoresRemove(cveEmpresa As Int32, fecha As DateTime, tipo As Int32) As Boolean
Dim retorno As Boolean = False
Try
DataAdapter("PA_RH_TablasValoresRemove", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = tipo
.Add("@fecha", SqlDbType.DateTime).Value = fecha
End With
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
#End Region
#Region "IDisposable Support" #Region "IDisposable Support"
' IDisposable ' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean) Protected Overridable Sub Dispose(ByVal disposing As Boolean)

View File

@@ -1268,17 +1268,19 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Double, PU As Double, IEPS As Double, PorcentajeIEPS As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleRemisionUpdate") DataAdapter("PA_VentasDetalleRemisionUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad
.Add("@PU", SqlDbType.Float).Value = PU .Add("@PU", SqlDbType.Decimal).Value = PU
.Add("@IEPS", SqlDbType.Float).Value = IEPS .Add("@IEPS", SqlDbType.Decimal).Value = IEPS
.Add("@PorcentajeIEPS", SqlDbType.Float).Value = PorcentajeIEPS .Add("@PorcentajeIEPS", SqlDbType.Decimal).Value = PorcentajeIEPS
.Add("@IVA", SqlDbType.Decimal).Value = IVA
.Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With End With

View File

@@ -392,22 +392,37 @@ Public Class E141 : Implements IHttpHandler
Select Case Metodo Select Case Metodo
Case "CrearActualizarProductos" Case "CrearActualizarProductos"
respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False)) respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
If respuesta Then
retorno = "True"
Else
retorno = "False"
End If
Case "CrearActualizarProductosJson"
retorno = CrearActualizarProductosJson(If(FiltrarTodos = "1", True, False))
Case "ActualizarPrecios" Case "ActualizarPrecios"
respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False)) respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
If respuesta Then
retorno = "True"
Else
retorno = "False"
End If
Case "ActualizarExistencias" Case "ActualizarExistencias"
respuesta = ActualizarExistencias() respuesta = ActualizarExistencias()
If respuesta Then
retorno = "True"
Else
retorno = "False"
End If
Case "ActualizarVendedores" Case "ActualizarVendedores"
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False)) respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
If respuesta Then
retorno = "True"
Else
retorno = "False"
End If
End Select End Select
If respuesta Then
retorno = "True"
Else
retorno = "False"
End If
End If End If
End If End If
context.Response.Write(retorno) context.Response.Write(retorno)
@@ -1962,6 +1977,25 @@ Public Class E141 : Implements IHttpHandler
Return Retorno Return Retorno
End Function End Function
Private Function CrearActualizarProductosJson(Todos As Boolean) As String
Dim payload = New JObject()
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
DtPS = ObjPS.DtResultados.Copy()
End If
End Using
If DtPS IsNot Nothing Then
payload.Add(New JProperty("products", GenerarPayloadProductos(DtPS)))
End If
Return payload.ToString()
End Function
Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray
Dim ArrayPS As New JArray Dim ArrayPS As New JArray
For Each RowPS As DataRow In DtPS.Rows For Each RowPS As DataRow In DtPS.Rows

View File

@@ -718,79 +718,76 @@ Partial Class Bancos_PopIEVentas
Validada = True Validada = True
End If End If
CveCliente = dr("CveCliente").ToString.ToEntero
If Validada Then CveClienteOriginal = dr("CveCliente").ToString.ToEntero
HdnCveCliente.Value = CveCliente.ToString
CveCliente = dr("CveCliente").ToString.ToEntero CargaCliente(CveCliente, "-1")
CveClienteOriginal = dr("CveCliente").ToString.ToEntero CveMoneda = dr("CveMoneda").ToString.ToEntero
HdnCveCliente.Value = CveCliente.ToString CveMonedaVenta = dr("CveMoneda").ToString.ToEntero
CargaCliente(CveCliente, "-1") CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero
CveMoneda = dr("CveMoneda").ToString.ToEntero NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente))
CveMonedaVenta = dr("CveMoneda").ToString.ToEntero SerieFolio = dr("SerieFolio").ToString
CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
NombreCliente = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero
SerieFolio = dr("SerieFolio").ToString
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }"
CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero
'Configuración de Modalidad Update
LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }"
'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ")
If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then
If dr("TipoDocto").ToString = "Rem" Then
Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
End If
End If
'Configuración de Modalidad Update MovimientoPagar = New IEMovimiento
MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal
MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal
MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal
MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal
MovimientoPagar.Total = dr("Total").ToString.ToDecimal
MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal
MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal
MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") LtlTitulo.Text = "Cuentas por Cobrar"
LtlTipo2.Text = "Folio de la Venta"
LtlTipo3.Text = "Fecha de la Venta"
LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}")
LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString()
LtlFolio.Text = dr("SerieFolio").ToString
TxtFolio.Enabled = True
TxtFechaDocumento.Enabled = True
Calendario.Enabled = True
TxtPagueseA.Enabled = False
TxtImporte.Enabled = True
DdlCuenta.Enabled = True
DdlTipoTransaccion.Enabled = True
TxtObservaciones.Enabled = True
RVImporte.Enabled = True
RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero
TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero
FechaVenta = dr("Fecha").ToString.ToDate
SaldoVenta = dr("Saldo").ToString.ToDouble
If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then 'Cortes de Caja
If dr("TipoDocto").ToString = "Rem" Then If UsuarioActual.TienePermisoProceso(160) Then
Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) CargaCorteCaja()
BtnGuardar.Visible = False End If
End If
End If
If Not Validada Then
BtnGuardar.Visible = False
MovimientoPagar = New IEMovimiento
MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal
MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal
MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal
MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal
MovimientoPagar.Total = dr("Total").ToString.ToDecimal
MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal
MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal
MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
LtlTitulo.Text = "Cuentas por Cobrar"
LtlTipo2.Text = "Folio de la Venta"
LtlTipo3.Text = "Fecha de la Venta"
LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}")
LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString()
LtlFolio.Text = dr("SerieFolio").ToString
TxtFolio.Enabled = True
TxtFechaDocumento.Enabled = True
Calendario.Enabled = True
TxtPagueseA.Enabled = False
TxtImporte.Enabled = True
DdlCuenta.Enabled = True
DdlTipoTransaccion.Enabled = True
TxtObservaciones.Enabled = True
RVImporte.Enabled = True
RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero
TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero
FechaVenta = dr("Fecha").ToString.ToDate
SaldoVenta = dr("Saldo").ToString.ToDouble
'Cortes de Caja
If UsuarioActual.TienePermisoProceso(160) Then
CargaCorteCaja()
End If
End If End If
@@ -1388,8 +1385,6 @@ Partial Class Bancos_PopIEVentas
#Region "G U A R D A R" #Region "G U A R D A R"
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim FechaFactura As Date = FechaVenta Dim FechaFactura As Date = FechaVenta
Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate

View File

@@ -2091,6 +2091,8 @@ Partial Class GPS_Rastreo
DtDatos.Columns.Add("Evento", GetType(String)) DtDatos.Columns.Add("Evento", GetType(String))
DtDatos.Columns.Add("LatLng", GetType(String)) DtDatos.Columns.Add("LatLng", GetType(String))
Dim KMRecorridos = DtPosiciones.SUM("KMRecorridos").ToString
Try Try
Dim Direcciones As JArray = ConsultarDirecciones(DtPosiciones) Dim Direcciones As JArray = ConsultarDirecciones(DtPosiciones)
For Each row As DataRow In DtPosiciones.Rows For Each row As DataRow In DtPosiciones.Rows
@@ -2107,6 +2109,12 @@ Partial Class GPS_Rastreo
For Each Dir As JObject In Direcciones For Each Dir As JObject In Direcciones
DtDatos.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() DtDatos.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
Next Next
DtDatos.Columns("Vehiculo").ColumnName = "Vehículo"
DtDatos.Columns("TiempoDetenido").ColumnName = "Tiempo Detenido"
DtDatos.Columns("Direccion").ColumnName = "Dirección"
Catch ex As Exception Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try End Try
@@ -2159,15 +2167,17 @@ Partial Class GPS_Rastreo
If FechaI.Length > 0 And FechaF.Length > 0 Then If FechaI.Length > 0 And FechaF.Length > 0 Then
Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
RangoFechas.Merged = True
RangoFechas.Value = $"Fechas: {FechaI} a {FechaF}"
RangoFechas.Style.Font.Size = 15 * 20
RangoFechas.Style.Font.Name = "Calibri Light"
RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If End If
Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
RangoFechas.Merged = True
RangoFechas.Value = $"Distancia: {KMRecorridos:N2} KM {If(FechaI.Length > 0 And FechaF.Length > 0, $"Fechas: {FechaI} a {FechaF}", "")}"
RangoFechas.Style.Font.Size = 15 * 20
RangoFechas.Style.Font.Name = "Calibri Light"
RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex

View File

@@ -335,6 +335,45 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
<div id="DivRecepcionApartado" runat="server" visible="false" class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Apartado Usado</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
</div>
</div>
<div class="portlet-body">
<div class="row">
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMarcaRem" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione la Marca" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlMarcaRem.ClientID.ToString()%>">Marca:</label>
</div>
</div>
<div class="col-md-4">
<label for="<%= TxtFechaAjuste.ClientID.ToString()%>">Fecha Vigencia:</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaVigencia" CssClass="form-control input-sm ADSMaskDate" Width="100%" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaVigencia" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaVigencia" runat="server" TargetControlID="TxtFechaVigencia" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaVigencia" TargetControlID="TxtFechaVigencia" PopupButtonID="LnkFechaVigencia" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaVigencia" runat="server" ControlToValidate="TxtFechaVigencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Vigencia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaVigencia" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaVigencia"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</div> </div>
<div id="DivAjuste" runat="server" visible="false" class="col-md-6"> <div id="DivAjuste" runat="server" visible="false" class="col-md-6">
<asp:UpdatePanel ID="UpAjuste" runat="server" class="portlet light xspadding bordered" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAjuste" runat="server" class="portlet light xspadding bordered" UpdateMode="Conditional">

View File

@@ -317,6 +317,15 @@ Partial Class Inventarios_RecepcionUsados
ViewState("DtPorcentajeMarcas") = value ViewState("DtPorcentajeMarcas") = value
End Set End Set
End Property End Property
Private Property TmpDTPolizaVirtual As DataTable
Get
Return If(IsNothing(ViewState("TmpDTPolizaVirtual")), Nothing, CType(ViewState("TmpDTPolizaVirtual"), DataTable))
End Get
Set(value As DataTable)
ViewState("TmpDTPolizaVirtual") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -1125,57 +1134,76 @@ Partial Class Inventarios_RecepcionUsados
Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text,
PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor, Modulo:="RU/G") PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor, Modulo:="RU/G")
If CveMovimiento <= 0 Then If CveMovimiento <= 0 Then
Mensaje = "Error al guardar los movimientos" Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True ErrorMovInv = True
Else Else
FolioInv = ObjInventario.Folio.ToString() FolioInv = ObjInventario.Folio.ToString()
For Each Dr As DataRow In DtMovimientos.Rows For Each Dr As DataRow In DtMovimientos.Rows
If CveConcepto = 42 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then If CveConcepto = 42 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
Else Else
ImporteConcepto = Dr("PU").ToString.ToDecimal ImporteConcepto = Dr("PU").ToString.ToDecimal
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al guardar los movimientos" Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
End If
If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True, CveMovimiento) Then
Mensaje = "Error al actualizar el recibo de los usados"
ErrorMovInv = True
Exit For
End If
'si es selectedvalue = 42, es entrada ,3 -salida
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2)
If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True, CveMovimiento) Then End If
Mensaje = "Error al actualizar el recibo de los usados" Next
ErrorMovInv = True
Exit For
End If
'si es selectedvalue = 42, es entrada ,3 -salida 'ACTUALIZA LA POLIZA VIRTUAL DEL LA REMISION
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2) 'If Not ErrorMovInv AndAlso ObjFactura.TipoDocto = "Rem" Then
' If ObjAcum.GetPolizasVirtuales(ObjFactura.CveVenta) Then
' Dim DtPoliza As DataTable = ObjAcum.DtResultados.Copy()
' For Each RowPoliza As DataRow In DtPoliza.Rows
' If Not ObjAcum.UpdatePolizaVirtual(RowPoliza("CvePolizaVirtual").ToString().ToEntero, DdlMarcaRem.SelectedValue.ToEntero(), TxtFechaVigencia.Text.ToDateTime()) Then
' Mensaje = "Error al guardar la póliza virtual"
' ErrorMovInv = True
' Exit For
' End If
' Next
If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then ' DtPoliza.Dispose()
' Else
' Mensaje = "Error al obtener la póliza virtual"
' ErrorMovInv = True
' End If
'End If
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, 'GENERA LA PREPOLIZA DE ALMACEN VS EL CONCEPTO DE RNC
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then 'If Not ErrorMovInv Then
Mensaje = "Error al guardar Movimientos de distribuidor" ' ErrorMovInv = Not GeneraPrePoliza(CveMovimiento, ObjInventario, ObjConta, True)
ErrorMovInv = True 'End If
Exit For
End If
End If
Next
'GENERA LA PREPOLIZA DE ALMACEN VS EL CONCEPTO DE RNC
'If Not ErrorMovInv Then
' ErrorMovInv = Not GeneraPrePoliza(CveMovimiento, ObjInventario, ObjConta, True)
'End If
End If
End If End If
End If
If Not ErrorMovInv Then
If Not ErrorMovInv Then
If Resp IsNot Nothing Then If Resp IsNot Nothing Then
For Each mensaje2 As String In Resp.Mensajes For Each mensaje2 As String In Resp.Mensajes
Msg.AppendFormat("<br>{0}", mensaje2) Msg.AppendFormat("<br>{0}", mensaje2)
@@ -1473,6 +1501,13 @@ Partial Class Inventarios_RecepcionUsados
GvM.DataSource = DtTemp GvM.DataSource = DtTemp
GvM.DataBind() GvM.DataBind()
'If TmpDTPolizaVirtual IsNot Nothing AndAlso RblUsadosAjuste.SelectedValue = "2" Then
' TmpDTPolizaVirtual.Clear()
' For Each Row As DataRow In DtTemp.Rows
' AddPolizaVirtual(Row("CvePS").ToString().ToEntero())
' Next
'End If
EscondeColumnasGVM(DtTemp) EscondeColumnasGVM(DtTemp)
End Sub End Sub
Private Sub EscondeColumnasGVM(DtTemp As DataTable) Private Sub EscondeColumnasGVM(DtTemp As DataTable)
@@ -2076,6 +2111,14 @@ Partial Class Inventarios_RecepcionUsados
DdlClientes.SelectedValueExist(CveCliente) DdlClientes.SelectedValueExist(CveCliente)
End If End If
If Me.ObjFactura IsNot Nothing Then
Me.ObjFactura.Dispose()
Me.ObjFactura = Nothing
End If
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas)
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO 'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO
If EsDistribuidor Then If EsDistribuidor Then
DivCliente.Visible = True DivCliente.Visible = True
@@ -2087,13 +2130,6 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC = Nothing Me.ObjRemisionNC = Nothing
End If End If
If Me.ObjFactura IsNot Nothing Then
Me.ObjFactura.Dispose()
Me.ObjFactura = Nothing
End If
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas)
If Me.ObjFactura IsNot Nothing Then If Me.ObjFactura IsNot Nothing Then
'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda) 'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
DivTotal.Visible = True DivTotal.Visible = True
@@ -2102,12 +2138,17 @@ Partial Class Inventarios_RecepcionUsados
'DivCliente.Visible = False 'DivCliente.Visible = False
'DivFactura.Visible = False 'DivFactura.Visible = False
End If End If
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
DtUsados = ObjVentas.DtResultados.Copy() DtUsados = ObjVentas.DtResultados.Copy()
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
If DtUsados IsNot Nothing Then If DtUsados IsNot Nothing Then
'DivRecepcionApartado.Visible = True
For Each RowUsado As DataRow In DtUsados.Rows For Each RowUsado As DataRow In DtUsados.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero() Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
@@ -2271,6 +2312,10 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.PedidoContrato = "" Me.ObjRemisionNC.PedidoContrato = ""
Me.ObjRemisionNC.ObservacionesAlmacen = "" Me.ObjRemisionNC.ObservacionesAlmacen = ""
'If TmpDTPolizaVirtual IsNot Nothing Then
' Me.ObjRemisionNC.DtPolizasVirtuales = TmpDTPolizaVirtual
'End If
End Sub End Sub
Private Function AddPSRNC(ByRef TmpDT As DataTable, Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String, Private Function AddPSRNC(ByRef TmpDT As DataTable, Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
@@ -3087,6 +3132,10 @@ Partial Class Inventarios_RecepcionUsados
ObjPS.Dispose() ObjPS.Dispose()
GuardaAjuste() GuardaAjuste()
'If TmpDTPolizaVirtual Is Nothing Then
' CreaDTmpDTPolizaVirtual()
'End If
End Sub End Sub
Protected Sub CargarDescuento() Protected Sub CargarDescuento()
@@ -3251,15 +3300,126 @@ Partial Class Inventarios_RecepcionUsados
Using ObjMarcas As New ClsProductosServicios Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados
DdlMarcaRem.DataSource = ObjMarcas.DtResultados
End If End If
End Using End Using
DdlMarcaPSAjuste.DataBind() DdlMarcaPSAjuste.DataBind()
DdlMarcaRem.DataBind()
DdlMarcaPSAjuste.Items.Insert(0, New ListItem("Todas", "-1")) DdlMarcaPSAjuste.Items.Insert(0, New ListItem("Todas", "-1"))
DdlMarcaRem.Items.Insert(0, New ListItem("Todas", "-1"))
UpAjuste.Update() UpAjuste.Update()
End Sub End Sub
#Region "P O L I Z A - V I R T U A L"
Private Sub CreaDTmpDTPolizaVirtual()
TmpDTPolizaVirtual = New DataTable
TmpDTPolizaVirtual.Columns.Add("CvePS", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("Cantidad", GetType(Decimal))
TmpDTPolizaVirtual.Columns.Add("PU", GetType(Decimal))
TmpDTPolizaVirtual.Columns.Add("Descuento", GetType(Decimal))
TmpDTPolizaVirtual.Columns.Add("Total", GetType(Decimal))
TmpDTPolizaVirtual.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("TipoServicio", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("TipoPoliza", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("CveModeloAuto", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("AnioVehiculo", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("TieneUsado", GetType(Boolean))
TmpDTPolizaVirtual.Columns.Add("FechaUsado", GetType(DateTime))
TmpDTPolizaVirtual.Columns.Add("CvePSUsado", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("CveBCIUsado", GetType(Integer))
End Sub
Private Function AddPolizaVirtual(CvePS As Integer) As Boolean
Dim Retorno As Boolean = True
'If Modalidad = "U" Then
' If TmpDTPolizaVirtual.Rows.Count > 0 Then
' Dim Elimino As Boolean = False
' For Each RowPoliza As DataRow In TmpDTPolizaVirtual.Rows
' If RowPoliza("CvePS").ToString().ToEntero() = CvePS Then
' RowPoliza.Delete()
' Elimino = True
' Exit For
' End If
' Next
' If Elimino Then
' TmpDTRecepcionUsados.AcceptChanges()
' End If
' End If
'End If
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If Not DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
Return Retorno
End If
Else
Retorno = False
Return Retorno
End If
Dim Cantidad As Decimal = 1
Dim PU As Decimal = txtPrecio.Text.ToDecimal()
Dim Descuento As Decimal = 0
Dim ImporteAjuste As Decimal = TxtImporteAjuste.Text.ToDecimal().RoundSQL(2)
Dim Total As Decimal = ((Cantidad * PU) - Descuento).RoundSQL(2)
Dim TipoServicio As Integer = -1
Dim FechaUsado As DateTime = If(TxtFechaAjuste.Text.ToDateTime() < MinFecha, Now, TxtFechaAjuste.Text.ToDateTime())
Dim CveModeloAuto As Integer = -1
Dim AnioVehiculo As Integer = 0
Dim TipoPoliza As Integer = 1 'VENTA
If Total = ImporteAjuste Then
TipoPoliza = 3 'GARANTIA
Else
TipoPoliza = 2 'AJUSTE
End If
'Dim TieneUsado As Boolean = GvRecepcionUsados.Rows.Cast(Of GridViewRow).Any(Function(GvRow) GvRow.RowType = DataControlRowType.DataRow AndAlso GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0)
Dim CvePSUsado As Integer = -1
Dim CveBCIUsado As Integer = -1
'If TieneUsado Then
' For Each GvRow As GridViewRow In GvRecepcionUsados.Rows
' If GvRow.RowType = DataControlRowType.DataRow Then
' If GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0 Then
' CvePSUsado = GvRow.DataKey("CvePSCargo").ToEntero()
' CveBCIUsado = GvRow.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero()
' Exit For
' End If
' End If
' Next
'End If
Dim Row As DataRow = TmpDTPolizaVirtual.NewRow()
Row("CvePS") = CvePS
Row("Cantidad") = Cantidad
Row("PU") = PU
Row("Descuento") = Descuento
Row("Total") = Total
Row("CveVentaDetalle") = -1
Row("TipoServicio") = TipoServicio
Row("TipoPoliza") = TipoPoliza
Row("CveModeloAuto") = CveModeloAuto
Row("AnioVehiculo") = AnioVehiculo
Row("TieneUsado") = 1
Row("FechaUsado") = FechaUsado
Row("CvePSUsado") = CvePSUsado
Row("CveBCIUsado") = CveBCIUsado
TmpDTPolizaVirtual.Rows.Add(Row)
Return Retorno
End Function
#End Region
Partial Class MFolioGarantiaMensaje Partial Class MFolioGarantiaMensaje
Public Property CvePS As Integer Public Property CvePS As Integer

View File

@@ -3071,7 +3071,7 @@ Partial Class Inventarios_TraspasoAlmacen
ElseIf DrAlmO("CveTipoAlmacen").ToString.ToEntero = 22 Then 'Recepcion de Usados ElseIf DrAlmO("CveTipoAlmacen").ToString.ToEntero = 22 Then 'Recepcion de Usados
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (22) AND Estatus = 'Activo'") DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (21,22) AND Estatus = 'Activo'")
DdlAlmacenDestino.DataBind() DdlAlmacenDestino.DataBind()
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
Else Else

View File

@@ -321,7 +321,7 @@ public partial class Nomina_CatConcepto : ClsPaginas
if (EsEditar) if (EsEditar)
{ {
TieneError = !ObjNomina.UpdateConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, CveConcepto, retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, CveSATConcepto); TieneError = !ObjNomina.UpdateConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, CveConcepto, retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, CveSATConcepto,UsuarioActual.CveEmpresa);
if (TieneError) if (TieneError)
{ {

View File

@@ -4,7 +4,10 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style> <style>
.dnone {display:none !important;} .dnone {
display: none !important;
}
.GvConceptos tr td a { .GvConceptos tr td a {
color: #5b9bd1; color: #5b9bd1;
} }
@@ -127,9 +130,10 @@
font-weight: bold; font-weight: bold;
font-size: 15px; font-size: 15px;
} }
.form-group.form-md-line-input .form-control.input-sm ~ label { .form-group.form-md-line-input .form-control.input-sm ~ label {
padding-bottom: 20px; padding-bottom: 20px;
} }
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
@@ -726,7 +730,7 @@
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
<a onclick="$('#C_BtnImprimirsobrerecibo').click()" class="btn btn-primary">Imprimir</a> <a onclick="$('#C_BtnImprimirsobrerecibo').click()" class="btn yellow-gold">Imprimir</a>
</div> </div>
</div> </div>
</div> </div>
@@ -753,6 +757,7 @@
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("ImporteP", "${0:N}") %>' Style="word-break: break-all;"></asp:Label> <asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("ImporteP", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server"></asp:LinkButton> <asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server"></asp:LinkButton>
<asp:LinkButton ID="LnkImportexCalculo" OnClick="LnkImportexCalculo_Click" runat="server" CssClass="btn btn-circle btn-sm btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el importe fijo?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="13%" /> <ItemStyle HorizontalAlign="Right" Width="13%" />
</asp:TemplateField> </asp:TemplateField>
@@ -773,6 +778,7 @@
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtlImporteD" runat="server" Text='<%# Eval("ImporteD", "${0:N}") %>' Style="word-break: break-all;"></asp:Label> <asp:Label ID="LtlImporteD" runat="server" Text='<%# Eval("ImporteD", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporteD" OnClick="LnkConcepto_Click" runat="server"></asp:LinkButton> <asp:LinkButton ID="LnkImporteD" OnClick="LnkConcepto_Click" runat="server"></asp:LinkButton>
<asp:LinkButton ID="LnkImporteDxCalculo" OnClick="LnkImportexCalculo_Click" runat="server" CssClass="btn btn-circle btn-sm btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el importe fijo?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="13%" /> <ItemStyle HorizontalAlign="Right" Width="13%" />
</asp:TemplateField> </asp:TemplateField>
@@ -797,7 +803,6 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
<asp:Button ID="BtnGuardarInfornavit" OnClick="BtnGuardarInfornavit_Click" runat="server" Text="Guardar" class="btn btn-primary" />
</div> </div>
</div> </div>
</div> </div>
@@ -861,6 +866,9 @@
<asp:CheckBox ID="ChkInfo" CssClass="chksino" runat="server" Text=" " /> <asp:CheckBox ID="ChkInfo" CssClass="chksino" runat="server" Text=" " />
</div> </div>
</div> </div>
<div class="text-right">
<asp:Button ID="BtnGuardarInfornavit" OnClick="BtnGuardarInfornavit_Click" runat="server" Text="Guardar" class="btn btn-primary" />
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -879,7 +887,6 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
<asp:LinkButton ID="LnkGuardarFonacot" OnClick="LnkGuardarFonacot_Click" runat="server" Text="Guardar" class="btn btn-primary" />
</div> </div>
</div> </div>
</div> </div>
@@ -941,6 +948,9 @@
<asp:CheckBox ID="ChkFonacot" CssClass="chksino" runat="server" Text=" " /> <asp:CheckBox ID="ChkFonacot" CssClass="chksino" runat="server" Text=" " />
</div> </div>
</div> </div>
<div class="text-right">
<asp:LinkButton ID="LnkGuardarFonacot" OnClick="LnkGuardarFonacot_Click" runat="server" Text="Guardar" class="btn btn-primary" />
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -998,7 +1008,6 @@
</div> </div>
</div> </div>
<div class="portlet-body "> <div class="portlet-body ">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescripcion" CssClass="form-control" runat="server"></asp:TextBox> <asp:TextBox ID="TxtDescripcion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtDescripcion" CssClass="help-block errorimput" <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtDescripcion" CssClass="help-block errorimput"
@@ -1079,7 +1088,6 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@@ -1096,9 +1104,8 @@
<div class="col-md-3"> <div class="col-md-3">
</div> </div>
</div> </div>
<div class="text-right"> <div class="text-right">
<asp:LinkButton ID="LnkAddMovto" OnClick="LnkAddMovto_Click" ValidationGroup="GrpGuardarMovyoPerma" CssClass="btn btn-primary" runat="server">Agregar</asp:LinkButton> <asp:LinkButton ID="LnkAddMovto" OnClick="LnkAddMovto_Click" ValidationGroup="GrpGuardarMovyoPerma" CssClass="btn btn-primary" runat="server">Guardar</asp:LinkButton>
<asp:LinkButton ID="LnkUpMovto" OnClick="LnkUpMovto_Click" ValidationGroup="GrpGuardarMovyoPerma" CssClass="btn btn-success" runat="server">Actualizar</asp:LinkButton> <asp:LinkButton ID="LnkUpMovto" OnClick="LnkUpMovto_Click" ValidationGroup="GrpGuardarMovyoPerma" CssClass="btn btn-success" runat="server">Actualizar</asp:LinkButton>
</div> </div>
</div> </div>
@@ -1227,12 +1234,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="text-right">
<asp:LinkButton ID="LnkSRVacacionesUP" OnClick="LnkSRVacacionesUP_Click" Visible="false" CssClass="btn btn-success" ValidationGroup="VG_Vacaciones" runat="server">Actualizar</asp:LinkButton>
<asp:LinkButton ID="LnkSRVacacionesADD" OnClick="LnkSRVacacionesADD_Click" Visible="true" CssClass="btn btn-primary" ValidationGroup="VG_Vacaciones" runat="server">Guardar</asp:LinkButton>
</div>
</div> </div>
</div> </div>
<div class="text-right">
<asp:LinkButton ID="LnkSRVacacionesUP" OnClick="LnkSRVacacionesUP_Click" Visible="false" CssClass="btn btn-primary" ValidationGroup="VG_Vacaciones" runat="server">Actualizar</asp:LinkButton>
<asp:LinkButton ID="LnkSRVacacionesADD" OnClick="LnkSRVacacionesADD_Click" Visible="true" CssClass="btn btn-success" ValidationGroup="VG_Vacaciones" runat="server">Agregar</asp:LinkButton>
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -1257,6 +1265,11 @@
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a> <a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div> </div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkshowaaddIncapacidad" OnClick="LnkshowaaddIncapacidad_Click" CssClass="btn yellow-gold" runat="server">Agregar</asp:LinkButton>
</div>
</div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<asp:GridView ID="GVNom_PersonalIncapacidad" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False" <asp:GridView ID="GVNom_PersonalIncapacidad" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
@@ -1294,11 +1307,6 @@
<a href="javascript:;" class="collapse" data-original-title="" title=""></a> <a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div> </div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkshowaaddIncapacidad" OnClick="LnkshowaaddIncapacidad_Click" CssClass="btn yellow-gold" runat="server">Agregar</asp:LinkButton>
</div>
</div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<div class="row"> <div class="row">
@@ -1395,12 +1403,13 @@
<ajax:ValidatorCalloutExtender ID="VcoNom_descripcion" runat="server" HighlightCssClass="vco" TargetControlID="RfvNom_descripcion"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VcoNom_descripcion" runat="server" HighlightCssClass="vco" TargetControlID="RfvNom_descripcion"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" AssociatedControlID="TxtSRINCdescripcion">Descripción</asp:Label> <asp:Label runat="server" AssociatedControlID="TxtSRINCdescripcion">Descripción</asp:Label>
</div> </div>
<div class="text-right">
<asp:LinkButton ID="LnkActualizarIncapacidad" OnClick="LnkActualizarIncapacidad_Click" CssClass="btn btn-success " ValidationGroup="VGMNom_" runat="server">Actualizar</asp:LinkButton>
<asp:LinkButton ID="LnkAgregarIncapacidad" OnClick="LnkAgregarIncapacidad_Click" CssClass="btn btn-primary" ValidationGroup="VGMNom_" runat="server">Guardar</asp:LinkButton>
</div>
</div> </div>
</div> </div>
<div class="text-right">
<asp:LinkButton ID="LnkActualizarIncapacidad" OnClick="LnkActualizarIncapacidad_Click" CssClass="btn btn-primary" ValidationGroup="VGMNom_" runat="server">Actualizar</asp:LinkButton>
<asp:LinkButton ID="LnkAgregarIncapacidad" OnClick="LnkAgregarIncapacidad_Click" CssClass="btn btn-success" ValidationGroup="VGMNom_" runat="server">Agregar</asp:LinkButton>
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -1429,7 +1438,7 @@
<asp:Label ID="LblConceptoMod" runat="server" Text=""></asp:Label></h4> <asp:Label ID="LblConceptoMod" runat="server" Text=""></asp:Label></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div runat="server" visible="<%# (SRCvePersonal <=0) %>" class="form-group form-md-line-input input-iconright"> <div runat="server" id="PnlConceptoPersonal" class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" AssociatedControlID="DdlmcPersonal" Enabled="false" Text="Empleado"></asp:Label> <asp:Label runat="server" AssociatedControlID="DdlmcPersonal" Enabled="false" Text="Empleado"></asp:Label>
<asp:DropDownList ID="DdlmcPersonal" DataTextField="Nombre" DataValueField="CvePersonal" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control select2me"> <asp:DropDownList ID="DdlmcPersonal" DataTextField="Nombre" DataValueField="CvePersonal" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
@@ -1601,7 +1610,49 @@
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel ID="TTUma" runat="server" HeaderText="UMA"> <ajax:TabPanel ID="TTUma" runat="server" HeaderText="UMA">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVUma" runat="server" CssClass="table table-striped table-hover mysmallbtn Widthall GvNominas" GridLines="None"></asp:GridView> <div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFechaUma" CssClass="form-control input-sm ADSMaskDate" runat="server"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtFechaUma">Fecha Inicio</asp:Label>
<ajax:MaskedEditExtender ID="MEEFechaUma" runat="server" TargetControlID="TxtFechaUma" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaUma" TargetControlID="TxtFechaUma" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaUma" runat="server" ControlToValidate="TxtFechaUma" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VGAddUma"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaUma" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaUma"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtValorUma" CssClass="form-control input-sm " runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvValorUma" runat="server" ControlToValidate="TxtValorUma" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VGAddUma"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoValorUma" runat="server" HighlightCssClass="vco" TargetControlID="RfvValorUma"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-4">
<asp:LinkButton ID="LnkAddUMA" OnClick="LnkAddUMA_Click" CssClass="btn btn-primary" runat="server">Guardar</asp:LinkButton>
</div>
</div>
<asp:GridView ID="GVUma" runat="server" CssClass="table table-striped table-hover mysmallbtn Widthall GVUma" GridLines="None" AutoGenerateColumns="false"
DataKeyNames="CveEmpresa,Fecha,Tipo,Valor">
<Columns>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Label ID="lblfecha" runat="server" Text='<%# Eval("Fecha","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UMA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblvalor" runat="server" Text='<%# Eval("Valor","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarUma" runat="server" OnClick="LnkEliminarUma_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el registro de uma?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
</ajax:TabContainer> </ajax:TabContainer>

View File

@@ -181,7 +181,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
TxtPeriodo.Text = $"{DateTime.Now :yyyyMM}"; TxtPeriodo.Text = $"{DateTime.Now:yyyyMM}";
CargarCentrosDeCosto(DdlProyecto, null, LblProyecto, LblSubProyeccto); CargarCentrosDeCosto(DdlProyecto, null, LblProyecto, LblSubProyeccto);
cargaEjercicios(); cargaEjercicios();
CargaTiposPeriodo(); CargaTiposPeriodo();
@@ -392,7 +392,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
LnkListaRaya.Visible = true; LnkListaRaya.Visible = true;
LnkAsistenciaIncidencias.Visible = true; LnkAsistenciaIncidencias.Visible = true;
LnkFormatoTabular.Visible = true; LnkFormatoTabular.Visible = true;
HypPDFSTimbrados.Visible = true; HypPDFSTimbrados.Visible = true;
if (objnom.GetNominaEmpleado(FiltCveProyecto, FiltCveSubProyecto, FiltCveTurno, FiltCvePeriodo, CveEmpresa, FiltAgrupador, DdlRegimenContratacion.SelectedValue.ToEntero()) && objnom.DTSetResultados.Tables.Count > 1) if (objnom.GetNominaEmpleado(FiltCveProyecto, FiltCveSubProyecto, FiltCveTurno, FiltCvePeriodo, CveEmpresa, FiltAgrupador, DdlRegimenContratacion.SelectedValue.ToEntero()) && objnom.DTSetResultados.Tables.Count > 1)
@@ -1439,6 +1439,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
#region SobreRecibo #region SobreRecibo
#region SobreRecibo propiedades
protected int SRCvePersonal protected int SRCvePersonal
{ {
@@ -1481,6 +1482,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
set { ViewState["SRTipoConcepto"] = value; } set { ViewState["SRTipoConcepto"] = value; }
} }
#endregion
protected void LnkSobreRecibo_Click(object sender, EventArgs e) protected void LnkSobreRecibo_Click(object sender, EventArgs e)
{ {
GridViewRow gvrow = (GridViewRow)(((LinkButton)sender).NamingContainer); GridViewRow gvrow = (GridViewRow)(((LinkButton)sender).NamingContainer);
@@ -1490,7 +1493,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
using (ClsContPAQi ObjConta = new ClsContPAQi(UsuarioActual.Empresa)) using (ClsContPAQi ObjConta = new ClsContPAQi(UsuarioActual.Empresa))
{ {
if (ObjConta.GetCuentas(-1, "-1", 1)) if (ObjConta.Conectado && ObjConta.GetCuentas(-1, "-1", 1))
{ {
DdlCtaContable.DataSource = ObjConta.DtResultados; DdlCtaContable.DataSource = ObjConta.DtResultados;
DdlCtaContable.DataBind(); DdlCtaContable.DataBind();
@@ -1530,6 +1533,23 @@ public partial class Nomina_Nomina2 : ClsPaginas
UpGvVacaciones.Update(); UpGvVacaciones.Update();
} }
protected void LnkImportexCalculo_Click(object sender, EventArgs e)
{
SRCveConcepto = ((LinkButton)sender).CommandArgument.ToEntero();
//CvePeriodoSeleccionado
//SRCvePersonal
if (SRCveConcepto > 0)
{
using (ClsNominas onom =new ClsNominas())
{
if(onom.DeleteNom_NominasDetalles(SRCveConcepto, SRCvePersonal, CvePeriodoSeleccionado))
{
Alert("el importe sera tomado del calculo y no del valor fijo");
}
}
}
}
protected void LnkConcepto_Click(object sender, EventArgs e) protected void LnkConcepto_Click(object sender, EventArgs e)
{ {
SRCveConcepto = ((LinkButton)sender).CommandArgument.ToEntero(); SRCveConcepto = ((LinkButton)sender).CommandArgument.ToEntero();
@@ -1553,7 +1573,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (SRTipoConcepto == "P") if (SRTipoConcepto == "P")
{ {
dtCon = dtConceptos.FiltraParametros("Tipo ='P' AND EsPadre = 1 ").Copy(); dtCon = dtConceptos.FiltraParametros("Tipo ='P' AND EsPadre = 1 ").Copy(); //AND CveSistema <>12'
} }
else else
{ {
@@ -1578,6 +1598,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
DdlmcConceptos.SelectedValueExist(SRCveConcepto); DdlmcConceptos.SelectedValueExist(SRCveConcepto);
} }
PnlConceptoPersonal.Visible = false;
DdlmcConceptos_SelectedIndexChanged(DdlmcConceptos, null); DdlmcConceptos_SelectedIndexChanged(DdlmcConceptos, null);
RegistraScript(string.Format("$('#ModalUpConcepto').on('shown.bs.modal', function () {{$('#{0}').trigger('focus')}});$('#ModalUpConcepto').modal();", TxtmcImporte.ClientID)); RegistraScript(string.Format("$('#ModalUpConcepto').on('shown.bs.modal', function () {{$('#{0}').trigger('focus')}});$('#ModalUpConcepto').modal();", TxtmcImporte.ClientID));
UPpanelModalUpConcepto.Update(); UPpanelModalUpConcepto.Update();
@@ -1615,7 +1636,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
DdlmcConceptos.SelectedValueExist(SRCveConcepto); DdlmcConceptos.SelectedValueExist(SRCveConcepto);
} }
PnlConceptoPersonal.Visible = true;
DdlmcConceptos_SelectedIndexChanged(DdlmcConceptos, null); DdlmcConceptos_SelectedIndexChanged(DdlmcConceptos, null);
RegistraScript(string.Format("$('#ModalUpConcepto').on('shown.bs.modal', function () {{$('#{0}').trigger('focus')}});$('#ModalUpConcepto').modal();", TxtmcImporte.ClientID)); RegistraScript(string.Format("$('#ModalUpConcepto').on('shown.bs.modal', function () {{$('#{0}').trigger('focus')}});$('#ModalUpConcepto').modal();", TxtmcImporte.ClientID));
UPpanelModalUpConcepto.Update(); UPpanelModalUpConcepto.Update();
@@ -1875,7 +1896,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
int BorradoLogico = 0; int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero(); int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal)) != 0)) if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal)) != 0)
&& (dtempleadosConceptos.COUNT("CveConcepto", string.Format("CveConcepto={0} AND CvePersonal ={1} AND Estatus =2", CveConcepto, SRCvePersonal)) == 0)
)
{ {
BorradoLogico = 1; BorradoLogico = 1;
} }
@@ -1886,7 +1909,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
int BorradoLogico = 0; int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero(); int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal)) != 0)) if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal)) != 0)
&& (dtempleadosConceptos.COUNT("CveConcepto", string.Format("CveConcepto={0} AND CvePersonal ={1} AND Estatus =2", CveConcepto, SRCvePersonal)) == 0)
)
{ {
BorradoLogico = 1; BorradoLogico = 1;
} }
@@ -2281,6 +2306,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
Label LtlImporteD = e.Row.FCLabel("LtlImporteD"); Label LtlImporteD = e.Row.FCLabel("LtlImporteD");
LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD"); LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD");
LinkButton LnkImportexCalculo = e.Row.FCLinkButton("LnkImportexCalculo");
LinkButton LnkImporteDxCalculo = e.Row.FCLinkButton("LnkImporteDxCalculo");
//isEditedD //isEditedD
if (isOnlyBisibleP == 1) if (isOnlyBisibleP == 1)
{ {
@@ -2315,6 +2343,10 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
LnkImporte.CommandArgument = (CveConcepto > 0 ? CveConcepto.ToString() : "P"); LnkImporte.CommandArgument = (CveConcepto > 0 ? CveConcepto.ToString() : "P");
LnkImporteD.CommandArgument = (CveConceptoD > 0 ? CveConceptoD.ToString() : "D"); LnkImporteD.CommandArgument = (CveConceptoD > 0 ? CveConceptoD.ToString() : "D");
LnkImportexCalculo.CommandArgument = LnkImporte.CommandArgument;
LnkImporteDxCalculo.CommandArgument = LnkImporteD.CommandArgument;
LnkImportexCalculo.Visible = isEditedP;
LnkImporteDxCalculo.Visible =isEditedD;
LnkImporte.Text = (CveConcepto > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteP").ToDecimal()) : (CveConceptoPolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : "")); LnkImporte.Text = (CveConcepto > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteP").ToDecimal()) : (CveConceptoPolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : ""));
LnkImporteD.Text = (CveConceptoD > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteD").ToDecimal()) : (CveConceptoDolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : "")); LnkImporteD.Text = (CveConceptoD > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteD").ToDecimal()) : (CveConceptoDolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : ""));
@@ -2619,7 +2651,10 @@ public partial class Nomina_Nomina2 : ClsPaginas
GVInfonavitSegViv.DataSource = objnom.DTSetResultados.Tables[3]; GVInfonavitSegViv.DataSource = objnom.DTSetResultados.Tables[3];
GVVigISRMensual.DataSource = objnom.DTSetResultados.Tables[4]; GVVigISRMensual.DataSource = objnom.DTSetResultados.Tables[4];
GVVigSubEmpMensual.DataSource = objnom.DTSetResultados.Tables[5]; GVVigSubEmpMensual.DataSource = objnom.DTSetResultados.Tables[5];
GVUma.DataSource = objnom.DTSetResultados.Tables[6]; }
if (objnom.RH_TablasValoresGet(UsuarioActual.CveEmpresa, 1))
{
GVUma.DataSource = objnom.DtResultados;
} }
} }
@@ -2633,6 +2668,43 @@ public partial class Nomina_Nomina2 : ClsPaginas
GVUma.DataBind(); GVUma.DataBind();
UpModalTablas.Update(); UpModalTablas.Update();
} }
protected void LnkAddUMA_Click(object sender, EventArgs e)
{
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.RH_TablasValoresAdd(UsuarioActual.CveEmpresa, TxtFechaUma.Text.ToDateTime(), 1, TxtValorUma.Text.ToDecimal()))
{
if (objnom.RH_TablasValoresGet(UsuarioActual.CveEmpresa, 1))
{
GVUma.DataSource = objnom.DtResultados;
GVUma.DataBind();
}
Alert("La UMA se ha actualizado.");
}
}
}
protected void LnkEliminarUma_Click(object sender, EventArgs e)
{
GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer;
DateTime fecha = gvrow.DataKey("Fecha").ToDateTime();
//DateTime tipo = gvrow.DataKey("Tipo").ToDateTime();
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.RH_TablasValoresRemove(UsuarioActual.CveEmpresa, TxtFechaUma.Text.ToDateTime(), 1))
{
if (objnom.RH_TablasValoresGet(UsuarioActual.CveEmpresa, 1))
{
GVUma.DataSource = objnom.DtResultados;
GVUma.DataBind();
}
Alert("La UMA se ha eliminado.");
}
}
}
protected void LnkVerTablas_Click(object sender, EventArgs e) protected void LnkVerTablas_Click(object sender, EventArgs e)
{ {
loadtablas(); loadtablas();
@@ -4211,134 +4283,127 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0", FiltroCvePersonal), "", getcolumnas); DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0", FiltroCvePersonal), "", getcolumnas);
DataTable dtconp = null; DataTable dtconp = null;
int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
if (FiltCveSubProyecto == -1 && DdlRegimenContratacion.SelectedValue == "-1")
#region PropNomina
int CvePersonal = 0;
int CveNomina = 0;
int CveMetodoPago = 0;
double SubTotal = 0;
double Total = 0;
int CveMoneda = 1;
#endregion
#region PropNominaDetalle
int CveConcepto = 0;
decimal ImporteConcepto = 0, ImporteGravadoConcepto = 0, ImporteExentoConcepto = 0, ImporteValor = 0;
#endregion
using (ClsNominas objNomina = new ClsNominas())
{ {
#region PropNomina objNomina.IniciaTransacSQL();
int CvePersonal = 0; foreach (DataRow rtemp in dtr.Rows)
int CveNomina = 0;
int CveMetodoPago = 0;
double SubTotal = 0;
double Total = 0;
int CveMoneda = 1;
#endregion
#region PropNominaDetalle
int CveConcepto = 0;
decimal ImporteConcepto = 0, ImporteGravadoConcepto = 0, ImporteExentoConcepto = 0, ImporteValor = 0;
#endregion
using (ClsNominas objNomina = new ClsNominas())
{ {
objNomina.IniciaTransacSQL(); CveNomina = 0;
foreach (DataRow rtemp in dtr.Rows) CvePersonal = rtemp["CvePersonal"].ToString().ToEntero();
CveMetodoPago = rtemp["CveMetodoPago"].ToString().ToEntero();
SubTotal = rtemp["SumaPercepciones"].ToString().ToDouble();
Total = rtemp["Total"].ToString().ToDouble();
if (CvePersonal > 0)
{ {
CveNomina = 0; if (continuar)
CvePersonal = rtemp["CvePersonal"].ToString().ToEntero();
CveMetodoPago = rtemp["CveMetodoPago"].ToString().ToEntero();
SubTotal = rtemp["SumaPercepciones"].ToString().ToDouble();
Total = rtemp["Total"].ToString().ToDouble();
if (CvePersonal > 0)
{ {
if (continuar) if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
{ {
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
{
if (objNomina.DtResultados.Rows.Count > 0) if (objNomina.DtResultados.Rows.Count > 0)
{
CveNomina = objNomina.CveNomina;
}
else
{
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, SubTotal, 0, 0, Total, CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{ {
CveNomina = objNomina.CveNomina; CveNomina = objNomina.CveNomina;
} }
else else
{ {
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, SubTotal, 0, 0, Total, CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina", continuar = false;
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
CveNomina = objNomina.CveNomina;
}
else
{
continuar = false;
}
} }
} }
} }
if (CveNomina == 0) }
{ if (CveNomina == 0)
continuar = false; {
} continuar = false;
}
if (continuar) if (continuar)
{
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal));
foreach (DataRow rcon in dtconp.Rows)
{ {
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal));
foreach (DataRow rcon in dtconp.Rows) CveConcepto = rcon["CveConcepto"].ToString().ToEntero();
ImporteConcepto = rcon["Importe"].ToString().ToDecimal();
ImporteGravadoConcepto = rcon["ImporteGravado"].ToString().ToDecimal();
ImporteExentoConcepto = ImporteConcepto - ImporteGravadoConcepto;
ImporteValor = rcon["Valor"].ToString().ToDecimal();
if (continuar)
{ {
CveConcepto = rcon["CveConcepto"].ToString().ToEntero(); if (!objNomina.AddUPNom_NominasDetalles(CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, ImporteConcepto, ImporteGravadoConcepto, ImporteExentoConcepto, ImporteValor, UsuarioActual.CveUsuario))
ImporteConcepto = rcon["Importe"].ToString().ToDecimal();
ImporteGravadoConcepto = rcon["ImporteGravado"].ToString().ToDecimal();
ImporteExentoConcepto = ImporteConcepto - ImporteGravadoConcepto;
ImporteValor = rcon["Valor"].ToString().ToDecimal();
if (continuar)
{ {
continuar = false;
if (!objNomina.AddUPNom_NominasDetalles(CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, ImporteConcepto, ImporteGravadoConcepto, ImporteExentoConcepto, ImporteValor, UsuarioActual.CveUsuario))
{
continuar = false;
}
} }
} }
}
if (continuar)
{
decimal SalarioDiario = rtemp["SalarioDiario"].ToString().ToEntero();
decimal SalarioDiarioIMSS = rtemp["SalarioDiarioIMSS"].ToString().ToEntero();
decimal SalarioDiarioIntegrado = rtemp["SalarioDiarioIntegrado"].ToString().ToEntero();
int DiasLaborados = rtemp["DiasLaborados"].ToString().ToEntero();
int DiasFaltados = rtemp["DiasFaltados"].ToString().ToEntero();
int DiasVacaciones = rtemp["DiasVacaciones"].ToString().ToEntero();
int DiasIncapacidad = rtemp["DiasIncapacidad"].ToString().ToEntero();
continuar = objNomina.PA_Nom_NominasAutorizarUP(CvePersonal, CvePeriodoSeleccionado, SalarioDiario, SalarioDiarioIMSS, SalarioDiarioIntegrado, 0, 0, Total, SubTotal, DiasLaborados, DiasFaltados, DiasVacaciones, DiasIncapacidad);
}
}
} }
} if (continuar)
{
decimal SalarioDiario = rtemp["SalarioDiario"].ToString().ToDecimal();
decimal SalarioDiarioIMSS = rtemp["SalarioDiarioIMSS"].ToString().ToDecimal();
decimal SalarioDiarioIntegrado = rtemp["SalarioDiarioIntegrado"].ToString().ToDecimal();
int DiasLaborados = rtemp["DiasLaborados"].ToString().ToEntero();
int DiasFaltados = rtemp["DiasFaltados"].ToString().ToEntero();
int DiasVacaciones = rtemp["DiasVacaciones"].ToString().ToEntero();
int DiasIncapacidad = rtemp["DiasIncapacidad"].ToString().ToEntero();
continuar = objNomina.PA_Nom_NominasAutorizarUP(CvePersonal, CvePeriodoSeleccionado, SalarioDiario, SalarioDiarioIMSS, SalarioDiarioIntegrado, 0, 0, Total, SubTotal, DiasLaborados, DiasFaltados, DiasVacaciones, DiasIncapacidad);
continuar = objNomina.AutorizaNom_Nominas(CvePersonal, CvePeriodoSeleccionado, true);
}
if (continuar)
{
continuar = objNomina.AutorizaNom_Nominas(-1, CvePeriodoSeleccionado, true);
}
if (continuar)
{
objNomina.Commit();
Alert("La nomina se autorizó correctamente.");
cargaDatos();
}
else
{
objNomina.RollBack();
} }
} }
if (dtr != null)
{
dtr.Dispose();
}
if (dtconp != null)
if (continuar)
{ {
dtconp.Dispose(); objNomina.Commit();
Alert("La nomina se autorizó correctamente.");
cargaDatos();
}
else
{
objNomina.RollBack();
} }
} }
else if (dtr != null)
{ {
Alert("para poder autorizar debe seleccionar a todos en el centro de costo y en Régimen de contratación.", TipoMensaje.MsgAdvertencia); dtr.Dispose();
} }
if (dtconp != null)
{
dtconp.Dispose();
}
} }
protected void LnkCargaAsistenciaMasiva_Click(object sender, EventArgs e) protected void LnkCargaAsistenciaMasiva_Click(object sender, EventArgs e)
@@ -5049,7 +5114,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
DdlSRINCcveControlIncapacidad.SelectedValueExist(cveControlIncapacidad.ToString()); DdlSRINCcveControlIncapacidad.SelectedValueExist(cveControlIncapacidad.ToString());
TxtSRINCdescripcion.Text = descripcion.ToString(); TxtSRINCdescripcion.Text = descripcion.ToString();
LnkAgregarIncapacidad.Visible = false; LnkAgregarIncapacidad.Visible = false;
LnkActualizarIncapacidad.Visible = true; //LnkActualizarIncapacidad.Visible = true;
} }
protected void LnkshowaaddIncapacidad_Click(object sender, EventArgs e) protected void LnkshowaaddIncapacidad_Click(object sender, EventArgs e)
{ {
@@ -5550,15 +5615,16 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkRegistrarProvision_Click(object sender, EventArgs e) protected void LnkRegistrarProvision_Click(object sender, EventArgs e)
{ {
using(ClsNominas objnom = new ClsNominas() ) using (ClsNominas objnom = new ClsNominas())
{ {
int CvePrePolizaProvision = 0; int CvePrePolizaasmilidos=0; int CvePrePolizaProvision = 0; int CvePrePolizaasmilidos = 0;
if(objnom.DtResultados.Rows.Count > 0) if (objnom.DtResultados.Rows.Count > 0)
{ {
CvePrePolizaProvision= objnom.DtResultados.Rows[0]["CvePrePoliza"].ToString().ToEntero(); CvePrePolizaProvision = objnom.DtResultados.Rows[0]["CvePrePoliza"].ToString().ToEntero();
CvePrePolizaasmilidos = objnom.DtResultados.Rows[0]["CvePrePolizaAsimilables"].ToString().ToEntero(); CvePrePolizaasmilidos = objnom.DtResultados.Rows[0]["CvePrePolizaAsimilables"].ToString().ToEntero();
} }
if (objnom.Autorizaperiodoconta(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa)){ if (objnom.Autorizaperiodoconta(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
string mensaje = string.Format("La provision a sido autorizada.<br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\">Provision </a><br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\"> Asimilados</a>", CvePrePolizaProvision, CvePrePolizaasmilidos); string mensaje = string.Format("La provision a sido autorizada.<br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\">Provision </a><br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\"> Asimilados</a>", CvePrePolizaProvision, CvePrePolizaasmilidos);
Alert(mensaje); Alert(mensaje);
} }
@@ -5679,7 +5745,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
CrearLayout(objnom.DtResultados); CrearLayout(objnom.DtResultados);
} }
} }
} }
protected void LnkAsistenciaIncidencias_Click(object sender, EventArgs e) protected void LnkAsistenciaIncidencias_Click(object sender, EventArgs e)
@@ -5701,14 +5767,14 @@ public partial class Nomina_Nomina2 : ClsPaginas
var libro = wb.AddWorksheet(nom.DTSetResultados.Tables[2], "Incidencias"); var libro = wb.AddWorksheet(nom.DTSetResultados.Tables[2], "Incidencias");
libro.ColumnsUsed().AdjustToContents(); libro.ColumnsUsed().AdjustToContents();
var libroin = wb.AddWorksheet(nom.DTSetResultados.Tables[1], "Descripción incidencias"); var libroin = wb.AddWorksheet(nom.DTSetResultados.Tables[1], "Descripción incidencias");
libro.ColumnsUsed().AdjustToContents(); libroin.ColumnsUsed().AdjustToContents();
libro.Row(1).InsertRowsAbove(4); libro.Row(1).InsertRowsAbove(4);
libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa; libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa;
libro.Range(2, 2, 2, 6).Merge().Value = "Reporte de incidencias"; libro.Range(2, 2, 2, 6).Merge().Value = "Reporte de incidencias";
libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}"; libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}";
libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}"; libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}"; libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
//ws.Row(1).InsertRowsAbove(1); //ws.Row(1).InsertRowsAbove(1);
} }
} }
@@ -5737,8 +5803,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkProcesarReporteAcumulados_Click(object sender, EventArgs e) protected void LnkProcesarReporteAcumulados_Click(object sender, EventArgs e)
{ {
DateTime fechai = TxtRIFechaInicio.Text.ToDateTime(); //DateTime fechai = TxtRIFechaInicio.Text.ToDateTime();
DateTime fechaf = TxtRIFechaFin.Text.ToDateTime(); //DateTime fechaf = TxtRIFechaFin.Text.ToDateTime();
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook(); ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
using (ClsNominas nom = new ClsNominas()) using (ClsNominas nom = new ClsNominas())
{ {
@@ -5747,6 +5813,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
var libro = wb.AddWorksheet(nom.DTSetResultados.Tables[0], "Acumulados"); var libro = wb.AddWorksheet(nom.DTSetResultados.Tables[0], "Acumulados");
libro.ColumnsUsed().AdjustToContents(); libro.ColumnsUsed().AdjustToContents();
libro.Row(1).InsertRowsAbove(4);
libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa;
libro.Range(2, 2, 2, 6).Merge().Value = "Reporte de Acumulados";
//libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}";
libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
//ws.Row(1).InsertRowsAbove(1); //ws.Row(1).InsertRowsAbove(1);
} }
@@ -5778,5 +5850,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
RegistraScript("$('#DmodalReporteAcumulados').modal()"); RegistraScript("$('#DmodalReporteAcumulados').modal()");
} }
} }

View File

@@ -5352,13 +5352,29 @@ Partial Class OC
Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal
Dim PU As Decimal = Row("Importe").ToString.ToDecimal() + (Row("Importe").ToString.ToDecimal() * PorcentajeGanancia) Dim PU As Decimal = Row("Importe").ToString.ToDecimal() + (Row("Importe").ToString.ToDecimal() * PorcentajeGanancia)
Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal
Dim ImporteIEPS As Decimal = ((Cantidad * PU) * IEPSPS).RoundSQL(2)
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, "", UsuarioActual.CveUsuario) Then
Dim TotalCalculableImpuestos = (Cantidad * (PU))
Dim TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
Dim PorcentajeIEPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal
Dim PorcentajeIVA As Decimal = 0D
If DrPS("IVA").ToString().Contiene("-1", "") Then
PorcentajeIVA = Row("IVAPorcentaje")
Else
PorcentajeIVA = DrPS("IVA")
End If
Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * PorcentajeIEPS).RoundSQL(2)
Dim ImporteIVA As Decimal = (TotalCalculableImpuestosIVA * PorcentajeIVA).RoundSQL(2)
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, PorcentajeIEPS, ImporteIVA, PorcentajeIVA, "", UsuarioActual.CveUsuario) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
Next Next
Catch ex As Exception Catch ex As Exception
OcurrioError = True OcurrioError = True

View File

@@ -51,6 +51,13 @@
<div class="portlet-title portlet-filterT smalltitle"> <div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row"> <div class="row">
<asp:Label ID="Label1" runat="server" CssClass="col-md-1 ">Tipo :</asp:Label>
<div class="col-md-3" id="Div1" runat="server">
<asp:DropDownList ID="DdlTipo" runat="server">
<asp:ListItem Value="1" Text="Cambio en salario variable" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="modificación de salario"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label ID="LblFechaPago" runat="server" CssClass="col-md-1 ">Fecha :</asp:Label> <asp:Label ID="LblFechaPago" runat="server" CssClass="col-md-1 ">Fecha :</asp:Label>
<div class="col-md-3" id="DivFechaPago" runat="server"> <div class="col-md-3" id="DivFechaPago" runat="server">

View File

@@ -27,7 +27,7 @@ public partial class RH_CalculoSBC : ClsPaginas
{ {
using (ClsNominas objnom = new ClsNominas()) using (ClsNominas objnom = new ClsNominas())
{ {
if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa, TxtFechaPago.Text)) if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa,DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text))
{ {
GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0]; GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0];
GVCFija.DataSource = objnom.DTSetResultados.Tables[0]; GVCFija.DataSource = objnom.DTSetResultados.Tables[0];
@@ -61,13 +61,13 @@ public partial class RH_CalculoSBC : ClsPaginas
//02: MovtosmodSalario GVCalculosSBC //02: MovtosmodSalario GVCalculosSBC
concater = ""; concater = "";
int contador = 0; int contador = 0;
foreach (var item in ObjPersonal.DtResultados.Select("Tipo=2")) //foreach (var item in ObjPersonal.DtResultados.Select("Tipo=2"))
{ //{
MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, item["Movtotxt"]); // MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, item["Movtotxt"]);
concater = "\\r\\n"; // concater = "\\r\\n";
contador++; // contador++;
} //}
foreach (GridViewRow item in GVCalculosSBC.Rows) foreach (GridViewRow item in GVCalculosSBC.Rows)
{ {
double SalarioDiarioSSNuevo =Math.Round( item.DataKey("SalarioDiarioSSNuevo").ToDouble(),2); double SalarioDiarioSSNuevo =Math.Round( item.DataKey("SalarioDiarioSSNuevo").ToDouble(),2);

View File

@@ -697,7 +697,7 @@
<div> <div>
<asp:GridView ID="GvPersonalAltas" EnableViewState="False" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None"> <asp:GridView ID="GvPersonalAltas" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Fecha Inicio" DataField="FechaInicio" DataFormatString="{0:d}"> <asp:BoundField HeaderText="Fecha Inicio" DataField="FechaInicio" DataFormatString="{0:d}">
<ItemStyle Width="150px" /> <ItemStyle Width="150px" />
@@ -1175,7 +1175,7 @@
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" /> CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</EditItemTemplate> </EditItemTemplate>
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="LnkshowEditcuentasbancarias" runat="server" OnClick="LnkshowEditcuentasbancarias_Click" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Elim." ItemStyle-Width="7%" ItemStyle-CssClass="Excede" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Elim." ItemStyle-Width="7%" ItemStyle-CssClass="Excede" ItemStyle-HorizontalAlign="Center">
@@ -1200,7 +1200,7 @@
</div> </div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<asp:GridView ID="GvBancos" EnableViewState="False" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró Historial de Cuentas X Pagar" CssClass="table table-striped table-advance table-hover" GridLines="None"> <asp:GridView ID="GvBancos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró Historial de Cuentas X Pagar" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Factura</HeaderTemplate> <HeaderTemplate>Factura</HeaderTemplate>
@@ -3291,120 +3291,6 @@
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel ID="TabGES" Visible="false" runat="server" HeaderText="GES">
<ContentTemplate>
<div class="row">
<div class="col-md-9">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption ">
<i class="icon-user-following bold font-green"></i>
<span class="caption-subject uppercase font-green">Datos GES</span>
</div>
<div class="tools"><a href="javascript;" class="collapse" data-original-title="" title=""></a></div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body ">
<table border="0" width="100%">
<tr>
<td width="25%"></td>
<td width="25%"></td>
<td width="25%"></td>
<td width="25%"></td>
</tr>
<tr>
<td>DEPENDENCIA:</td>
<td colspan="3">
<asp:TextBox ID="TxtGESDependencia" runat="server" Text="SECRETARIA DE HACIENDA" Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td>ADSCRIPCION:</td>
<td colspan="3">
<asp:TextBox ID="TxtGESAdscripcion" runat="server" Text="1050001600 - DIRECCION GENERAL DE POLITICA Y CONTROL PRESUPUESTAL" Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td>CLAVE PPTAL:</td>
<td colspan="3">
<asp:TextBox ID="TxtGESClavePPTAL" runat="server" Text="10500016001502E502M000HWA - 1 - # Plaza: 4986" Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td>UBICACION:</td>
<td colspan="3">
<asp:TextBox ID="TxtGESUbicacion" runat="server" Text="9010 - SUBSECRETARIA DE EGRESOS - HERMOSILLO" Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td></td>
<td colspan="2">
<asp:TextBox ID="TxtGESCampo" runat="server" Text="TABULADOR BUROCRATA" Width="100%"></asp:TextBox>
</td>
<td></td>
</tr>
<tr>
<td>PUESTO:</td>
<td colspan="3">
<asp:TextBox ID="TxtGESPuesto" runat="server" Text="020512 - COORDINADOR DE AREA" Width="100%"></asp:TextBox>
</td>
</tr>
<tr>
<td>ESTATUS:</td>
<td>
<asp:DropDownList Width="100%" runat="server" ID="DdlGESEstatus">
<asp:ListItem Text="SELECCIONE" Value="-1" />
<asp:ListItem Selected="True" Text="ACTIVO" Value="1" />
<asp:ListItem Text="INACTIVO" Value="0" />
</asp:DropDownList>
</td>
<td colspan="2">
<asp:Label runat="server" Text="Ultimo mov Qna 16 2015 - 16/08/2015"></asp:Label>
</td>
</tr>
<tr>
<td>SINDICATO:</td>
<td>
<asp:TextBox ID="TxtGESSindicato" runat="server" Text="S.U.T.S.P.E.S" Width="100%"></asp:TextBox>
</td>
<td colspan="2">
<asp:Label runat="server" Text="NIVEL SALARIAL 07 - B - $16210.38"></asp:Label>
</td>
</tr>
<tr>
<td>TIPO PLAZA:</td>
<td>
<asp:TextBox ID="TxtGESTipoPlaza" runat="server" Text="BASE" Width="100%"></asp:TextBox>
</td>
<td>
<asp:Label runat="server" Text="Sueldo - $19452.46"></asp:Label>
</td>
<td>
<asp:Label runat="server" Text="Quinquenio - $3242.08"></asp:Label>
</td>
</tr>
<tr>
<td>INDOLE:</td>
<td>
<asp:TextBox ID="TxtGESIndole" runat="server" Text="TITULAR" Width="100%"></asp:TextBox>
</td>
<td>ANTIGUEDAD:</td>
<td>
<asp:Label ID="LbGESAntiguedad" runat="server" Text="23 Año(s) 7 Mes(es) 7 Dia(s)" Width="100%"></asp:Label>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabSistema" runat="server" HeaderText="Sistema"> <ajax:TabPanel ID="TabSistema" runat="server" HeaderText="Sistema">
<ContentTemplate> <ContentTemplate>

View File

@@ -809,9 +809,6 @@ Partial Class RH_Personal
ViewState("Archivo") = "" ViewState("Archivo") = ""
DTConsumos = Nothing DTConsumos = Nothing
If UsuarioActual.CveRol = 1 Or UsuarioActual.CveEmpresa = 74 Then
TabGES.Visible = True
End If
SetValues() SetValues()
'SetPermisos() 'SetPermisos()
@@ -3087,8 +3084,10 @@ Partial Class RH_Personal
End If End If
End Sub End Sub
Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing
Dim gvrow As GridViewRow = GvBancosCuentas.Rows(e.NewEditIndex) 'DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Protected Sub LnkshowEditcuentasbancarias_Click(sender As Object, e As EventArgs)
Dim gvrow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
BtnActualizarCuentaBanco.Visible = True BtnActualizarCuentaBanco.Visible = True
BtnAgregarCuentaBanco.Visible = False BtnAgregarCuentaBanco.Visible = False
'CveCuentaDeposito,CveSATBanco,Cuenta,CLABE,EstatusPagoElectronico,CveMoneda 'CveCuentaDeposito,CveSATBanco,Cuenta,CLABE,EstatusPagoElectronico,CveMoneda
@@ -3101,9 +3100,12 @@ Partial Class RH_Personal
ChkEstatuscuenta.Checked = gvrow.DataKey("EstatusTexto").ToUpper().Contiene("TRUE", "1", "ACTIVO") ChkEstatuscuenta.Checked = gvrow.DataKey("EstatusTexto").ToUpper().Contiene("TRUE", "1", "ACTIVO")
UpCuentasVancarias.Update() UpCuentasVancarias.Update()
RegistraScript("$('#DivCuentasVancarias').modal();") RegistraScript("$('#DivCuentasVancarias').modal();")
End Sub
Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing
'GvBancosCuentas.EditIndex = e.NewEditIndex
'CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) GvBancosCuentas.EditIndex = e.NewEditIndex
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
End Sub End Sub
Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit
GvBancosCuentas.EditIndex = -1 GvBancosCuentas.EditIndex = -1
@@ -6481,4 +6483,6 @@ Partial Class RH_Personal
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
End Sub End Sub
End Class End Class

View File

@@ -1641,7 +1641,7 @@ function loadsortadscroll() {
} else { } else {
var splited = texto.split("/") var splited = texto.split("/")
if (splited.length == 3) { if (splited.length == 3) {
var d = new Date(splited[2] + "-" + splited[1] + "-" + splited[0]) var d = new Date(splited[2] + "/" + splited[1] + "/" + splited[0])
if (!(d.toString == "Invalid Date")) { if (!(d.toString == "Invalid Date")) {
textod = d; textod = d;
tipodate = 1; tipodate = 1;
@@ -1736,7 +1736,7 @@ function loadsortadscroll() {
} else { } else {
var splited = texto.split("/") var splited = texto.split("/")
if (splited.length == 3) { if (splited.length == 3) {
var d = new Date(splited[2] + "-" + splited[1] + "-" + splited[0]) var d = new Date(splited[2] + "/" + splited[1] + "/" + splited[0])
if (!(d.toString == "Invalid Date")) { if (!(d.toString == "Invalid Date")) {
textod = d; textod = d;
} }

View File

@@ -316,7 +316,26 @@ Partial Class Ventas_ActualizarPrecios
Exit Sub Exit Sub
End If End If
DtExcel.TableName = DdlPrecioLista.SelectedItem.Text
If DdlPrecioLista.SelectedItem IsNot Nothing Then
Dim worksheetName As String = DdlPrecioLista.SelectedItem.Text
Const invalidCharsRegex As String = "[/\\*'?[\]:]+"
Const maxLength As Integer = 31
Dim safeName As String = Regex.Replace(worksheetName, invalidCharsRegex, " ").Replace(" ", " ").Trim()
If String.IsNullOrEmpty(safeName) Then
safeName = "Precios" ' cannot be empty
ElseIf safeName.Length > maxLength Then
safeName = safeName.Substring(0, maxLength)
End If
DtExcel.TableName = safeName
Else
DtExcel.TableName = "Precios"
End If
DtExcel.Columns("Codigo").ColumnName = "Código" DtExcel.Columns("Codigo").ColumnName = "Código"
DtExcel.Columns("PS").ColumnName = "Producto / Servicio" DtExcel.Columns("PS").ColumnName = "Producto / Servicio"
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)

View File

@@ -203,7 +203,8 @@
<br /> <br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron Productos o Servicios registrados" ToolTip="Listado de Productos o Servicios" CssClass="table table-striped table-hover Widthall" UseAccessibleHeader="true" GridLines="None"> <asp:GridView ID="GvDatos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron Productos o Servicios registrados"
ToolTip="Listado de Productos o Servicios" CssClass="table table-striped table-hover Widthall" UseAccessibleHeader="true" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" SortExpression="OrdenarGV" /> <asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" SortExpression="OrdenarGV" />
<asp:BoundField DataField="TipoPS" HeaderText="Tipo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" /> <asp:BoundField DataField="TipoPS" HeaderText="Tipo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
@@ -373,7 +374,23 @@
<script src="/Metronic/assets/global/scripts/datatable.js"></script> <script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script> <script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
"date-esMX-pre": function (a) {
if (a == null || a == "") {
return 0;
}
var ukDatea = a.split('/');
return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
},
"date-esMX-asc": function (a, b) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"date-esMX-desc": function (a, b) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
});
var OrdenarGV = function () { var OrdenarGV = function () {
var Tam = TamañoVentana(); var Tam = TamañoVentana();
var Alto = Tam.height - 270; var Alto = Tam.height - 270;
@@ -385,7 +402,11 @@
scrollCollapse: true, scrollCollapse: true,
paging: false, paging: false,
searching: false, searching: false,
info: false info: false,
columnDefs: [
{ "type": "date-esMX", targets: 7 }
]
}); });
$('#GvDatos').parent().parent().children().first().css("position", "static"); $('#GvDatos').parent().parent().children().first().css("position", "static");
} }

View File

@@ -5037,6 +5037,9 @@
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargar" />
</Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>

View File

@@ -1763,7 +1763,7 @@ Partial Class Clientes
DivPortletSucursales.Visible = False DivPortletSucursales.Visible = False
DivPortletDireccionEnvio.Visible = False DivPortletDireccionEnvio.Visible = False
DivPortletAsignaciones.Visible = False DivPortletAsignaciones.Visible = False
DivPortletBitacora.Visible = False 'DivPortletBitacora.Visible = False
BtnEliminar.Visible = False BtnEliminar.Visible = False
DivProtletRegistrar.Visible = True DivProtletRegistrar.Visible = True

View File

@@ -1867,7 +1867,7 @@ Partial Class PV
For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero() Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
If CveVentaDetalle > 0 Then If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If

View File

@@ -1427,7 +1427,7 @@
<td> <td>
<asp:TextBox ID="TxtSubTotal2" ClientIDMode="Static" runat="server" BorderStyle="None" Style="text-align: right;" Text="0.00" Width="78px"></asp:TextBox></td> <asp:TextBox ID="TxtSubTotal2" ClientIDMode="Static" runat="server" BorderStyle="None" Style="text-align: right;" Text="0.00" Width="78px"></asp:TextBox></td>
<td> <td>
<%-- <asp:LinkButton ID="LkbAgregarComplementos" runat="server" CssClass="btn btn-circle btn-xs gray" Text="<i class='fa fa-bell '></i>"></asp:LinkButton>--%> <%-- <asp:LinkButton ID="LkbAgregarComplementos" runat="server" CssClass="btn btn-circle btn-xs gray" Text="<i class='fa fa-bell '></i>"></asp:LinkButton>--%>
</td> </td>
</tr> </tr>
@@ -2723,7 +2723,7 @@
</div> </div>
</div> </div>
</div> </div>
</td> </td>
<td rowspan="1" colspan="1"> <td rowspan="1" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 450px;"> <div class="portlet light xspadding bordered whitoutcol" style="width: 450px;">
<div class="portlet-title"> <div class="portlet-title">
@@ -7110,6 +7110,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" /> <asp:CheckBox ID="ChkAplicar" runat="server" />
<asp:HiddenField ID="HdnPorcentajeIVA" ClientIDMode="Static" runat="server" Value='<%# Eval("PorcentajeIVA").ToString %>' />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad"> <asp:TemplateField HeaderText="Cantidad">
@@ -7124,6 +7125,7 @@
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:HiddenField ID="HdnPU" ClientIDMode="Static" runat="server" Value='<%# Eval("PU").ToString %>' />
<asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal> <asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
@@ -7440,6 +7442,66 @@
TxtImporte.value = ""; TxtImporte.value = "";
} }
} }
function CalculaSaldoRNCChkDetalle(TxtCantidad, CantidadPendiente, ImporteTotal, Chk) {
//ImportesRNCCargo
let Importe = 0;
if (Chk.checked) {
let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
let ImportesAsignados = 0;
$('.ImportesRNCDetalle').each(function () {
if (Chk.id != $(this).find("td").eq(0).find(":checkbox").attr('id')) {
let seleccionado = $(this).find("td").eq(0).find(":checkbox").is(':checked');
if (seleccionado) {
let cantidad = ToDouble($(this).find("td").eq(1).find(":text").val());
let porcentajeIVA = ToDouble($(this).find("td").eq(0).find(":hidden").val());
let precio = ToDouble($(this).find("td").eq(5).find(":hidden").val());
let totalcalculableImpuestos = (cantidad * precio);
let iva = ToDouble((totalcalculableImpuestos * porcentajeIVA).toFixed(2));
ImportesAsignados += totalcalculableImpuestos + iva;
}
}
});
Importe = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > 0) {
} else {
if (SaldoMaximoUtilizable > 0) {
Importe = 0;
Chk.checked = false;
} else {
Importe = 0;
}
}
} else {
Importe = 0;
}
Importe = ToDouble(Importe.toFixed(2));
if (Importe > 0) {
let pu = (ImporteTotal / CantidadPendiente);
if (pu > 0) {
TxtCantidad.value = (Importe / pu).toString();
}
}else {
TxtCantidad.value = "0";
}
}
function LimitaSaldoRNCChk(TxtImporte, Saldo) { function LimitaSaldoRNCChk(TxtImporte, Saldo) {
//var Importe = 0; //var Importe = 0;
@@ -8729,21 +8791,21 @@
if (TotalRem == TotalNC) { if (TotalRem == TotalNC) {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431"; document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431"; document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = ""; document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = ""; document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
} else { } else {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #ff0000"; document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #ff0000"; document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "#ff0000"; document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "#ff0000";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "#ff0000"; document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "#ff0000";
}
} }
} }
}
function CerrarModalRemNC() { function CerrarModalRemNC() {
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') { if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
AplicarValidarRNC(true); AplicarValidarRNC(true);
CompararNC(); CompararNC();
} }

View File

@@ -2907,6 +2907,15 @@ Partial Class Ventas
End If End If
MostrarOpcionesPaqueteria() MostrarOpcionesPaqueteria()
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
' BtnEmitirImprimir.Visible = True
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
'End If
'End If
'UNA VEZ CARGADA LAS CONDICIONES DE PAGO INICIALMENTE, NO VUELVE A SOBREESCRIBIR EL VALOR 'UNA VEZ CARGADA LAS CONDICIONES DE PAGO INICIALMENTE, NO VUELVE A SOBREESCRIBIR EL VALOR
CveFormaPago33Cliente = -1 CveFormaPago33Cliente = -1
@@ -7019,17 +7028,15 @@ Partial Class Ventas
End If End If
Else Else
Dim DrPS As DataRow = Nothing
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("")
If Not ClienteDesglosaIEPS Then If Not ClienteDesglosaIEPS Then
Dim DrPS As DataRow = Nothing
'DrPS = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero(), Estatus:=-1).FiltroPrimero("")
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("")
PU = PU * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal) PU = PU * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
TmpDT.Rows(e.RowIndex)("PorcentajeIEPS") = 0 TmpDT.Rows(e.RowIndex)("PorcentajeIEPS") = 0
DrPS = Nothing
End If End If
Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (ObjDescuento.ImporteDescuento)) Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (ObjDescuento.ImporteDescuento))
@@ -7052,7 +7059,11 @@ Partial Class Ventas
End If End If
End If End If
If DrPS("IVA").ToString().Contiene("-1", "") Then
TmpDT.Rows(e.RowIndex)("PorcentajeIVA") = PorcentajeIVA
Else
TmpDT.Rows(e.RowIndex)("PorcentajeIVA") = DrPS("IVA")
End If
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero() TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero()
TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text
@@ -7086,6 +7097,8 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue
End If End If
DrPS = Nothing
GvPS.EditIndex = -1 GvPS.EditIndex = -1
GvPS.DataSource = TmpDT GvPS.DataSource = TmpDT
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
@@ -9727,7 +9740,7 @@ Partial Class Ventas
ObjFactura.SetSubProyectoMatriz(Me) ObjFactura.SetSubProyectoMatriz(Me)
ObjFactura.SetSubProyecto(Me) ObjFactura.SetSubProyecto(Me)
ObjFactura.ClienteSucursal = New Modelos.SucursalModel() ObjFactura.ClienteSucursal = New Modelos.SucursalModel()
If Not CveEmpresaCRM > 0 Then If CveCliente > 0 Then
If Me.ClienteSucursal IsNot Nothing Then If Me.ClienteSucursal IsNot Nothing Then
ObjFactura.ClienteSucursal.RFC = Me.ClienteSucursal.RFC ObjFactura.ClienteSucursal.RFC = Me.ClienteSucursal.RFC
ObjFactura.ClienteSucursal.Nombre = Me.ClienteSucursal.Nombre ObjFactura.ClienteSucursal.Nombre = Me.ClienteSucursal.Nombre
@@ -9828,7 +9841,7 @@ Partial Class Ventas
End If End If
If Not CveEmpresaCRM > 0 Then ObjFactura.Timbre = PreParaTimbre(ObjFactura) If CveCliente > 0 Then ObjFactura.Timbre = PreParaTimbre(ObjFactura)
'SI SE ESTA EDITANDO ACTUALIZA LOS IMPORTES DEL DT 'SI SE ESTA EDITANDO ACTUALIZA LOS IMPORTES DEL DT
If GvImpuestosLocales2.Visible AndAlso GvImpuestosLocales2.Enabled Then If GvImpuestosLocales2.Visible AndAlso GvImpuestosLocales2.Enabled Then
@@ -16164,7 +16177,7 @@ Partial Class Ventas
'End If 'End If
End Sub End Sub
Private Sub CargaFormatoSucursal() Private Sub CargaFormatoSucursal(Optional RecalcularIVA As Boolean = True)
Dim dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", If(DdlSubProyectoDatos.SelectedValue = "", "-1", DdlSubProyectoDatos.SelectedValue))) Dim dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", If(DdlSubProyectoDatos.SelectedValue = "", "-1", DdlSubProyectoDatos.SelectedValue)))
If dr IsNot Nothing Then If dr IsNot Nothing Then
ViewState("SucCalle") = dr("Calle") ViewState("SucCalle") = dr("Calle")
@@ -16195,7 +16208,7 @@ Partial Class Ventas
If CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then If CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
DdlIVA.Visible = True DdlIVA.Visible = True
End If End If
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 AndAlso (Not CveVenta > 0 Or EsCreaApartirDe Or CveDevolucion > 0) Then RecalculaIVA() If RecalcularIVA AndAlso TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 AndAlso (Not CveVenta > 0 Or EsCreaApartirDe Or CveDevolucion > 0) Then RecalculaIVA()
'ViewState("SubProyectoPorcentajeIVA") = dr("IVA") 'ViewState("SubProyectoPorcentajeIVA") = dr("IVA")
ViewState("TipoFormato") = dr("TipoFormato") ViewState("TipoFormato") = dr("TipoFormato")
'ViewState("Serie") = dr("Serie") 'ViewState("Serie") = dr("Serie")
@@ -16547,7 +16560,7 @@ Partial Class Ventas
If TipoAplicacion = 2 Then If TipoAplicacion = 2 Then
Descuento = 0 Descuento = 0
SeAjustoPU = True SeAjustoPU = True
PUModificado = PUPromocion PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
Else Else
Descuento = Descuento + PU - TotalPromocion Descuento = Descuento + PU - TotalPromocion
End If End If
@@ -17063,11 +17076,17 @@ Partial Class Ventas
DrPoliza("CveTipoPS") = DrPSAdicional("CveTipoPS") DrPoliza("CveTipoPS") = DrPSAdicional("CveTipoPS")
DrPoliza("CveTipoInvPS") = DrPSAdicional("Inv_CveMetodoInventario") DrPoliza("CveTipoInvPS") = DrPSAdicional("Inv_CveMetodoInventario")
DrPoliza("NoIdentificacion") = DrPSAdicional("Codigo") DrPoliza("NoIdentificacion") = DrPSAdicional("Codigo")
If Modalidad = "U" Then If Modalidad = "U" Then
DrPoliza("Consec") = Index DrPoliza("Consec") = Index
Else Else
DrPoliza("Consec") = TmpDT.Rows.Count + 1 Dim ConsecutivoActual As Integer = TmpDT.MAX("Consec").ToEntero()
If ConsecutivoActual < 0 Then
ConsecutivoActual = 0
End If
DrPoliza("Consec") = ConsecutivoActual + 1
End If End If
Row("Orden") = TmpDT.Rows.Count + 1 Row("Orden") = TmpDT.Rows.Count + 1
DrPoliza("Cantidad") = If(Dr("Cantidad").ToString().ToDecimal > 0, Dr("Cantidad").ToString().ToDecimal, Cantidad) DrPoliza("Cantidad") = If(Dr("Cantidad").ToString().ToDecimal > 0, Dr("Cantidad").ToString().ToDecimal, Cantidad)
PU = 0 PU = 0
@@ -17141,6 +17160,249 @@ Partial Class Ventas
Return Retorno Return Retorno
End Function End Function
'Private Function AgregarProductoServicioCotizacion(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
' PU As Decimal, Descuento As Decimal, PorcentajeIVA As Decimal, ImporteIVA As Decimal, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, Optional Serie As String = "", Optional TiempoEntrega As String = "",
' Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
' Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
' Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
' Optional ImporteProntoPago As Decimal = 0) As Boolean
' Dim Retorno As Boolean = False
' Try
' If Not CvePS > 0 Then
' Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgError)
' Return False
' End If
' Dim Row As DataRow = Nothing
' Dim TotalCalculableImpuestos As Decimal = 0
' PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
' Descuento = Descuento.RoundSQL(NumeroDecimales)
' If Not TmpDT.Columns.Contains("RetIVA") Then
' TmpDT.Columns.Add("RetIVA", GetType(Decimal))
' End If
' Row = TmpDT.NewRow()
' Row("CveProyecto") = CveProyecto
' Row("Proyecto") = Proyecto
' Row("CveSubProyecto") = CveSubProyecto
' Row("SubProyecto") = SubProyecto
' Row("Serie") = Serie
' Row("TiempoEntrega") = TiempoEntrega
' If Modalidad = "U" Then
' Row("Orden") = Index
' Else
' Dim ConsecutivoActual As Integer = TmpDT.MAX("Consec").ToEntero()
' If ConsecutivoActual < 0 Then
' ConsecutivoActual = 0
' End If
' Row("Orden") = ConsecutivoActual + 1
' End If
' Row("Cantidad") = Cantidad
' Row("CveUM") = CveUM
' Row("UM") = UM
' Row("CveClasificacion") = CveClasificacion
' Row("Clasificacion") = Clasificacion
' Row("CvePS") = CvePS
' Row("Obs") = Obs
' Dim DrPS As DataRow = Nothing
' DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
' If DrPS Is Nothing Then
' Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
' Return False
' End If
' If (DrPS("SATClaveUnidadMedida").ToString() = "" Or DrPS("SATClavePS").ToString() = "") Then
' 'VALIDA CLAVESAT
' If Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then 'DOCUMENTOS DONDE NO SE VALIDA
' If DrPS("SATClavePS").ToString() = "" Then
' MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: Sin producto SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
' Return False
' ElseIf DrPS("SATClaveUnidadMedida").ToString() = "" Then
' MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: Sin Unidad Medida SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
' Return False
' End If
' 'If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) AndAlso DrPS("SATClavePS").ToString() = "01010101" Then
' ' MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: El producto/servicio no existe en el catálogo del SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
' ' Return False
' 'End If
' End If
' Else
' If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) AndAlso DrPS("SATClavePS").ToString() = "01010101" Then
' MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: El producto/servicio no existe en el catálogo del SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
' Return False
' End If
' End If
' 'verifica si tiene ventaminima
' If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString().ToDecimal > 0 Then
' 'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
' If Cantidad Mod DrPS("VentaMinima").ToString().ToDecimal <> 0 Then
' Alert(String.Format("El producto se vende solo en cantidades de {0}", DrPS("VentaMinima").ToString()))
' Return False
' End If
' End If
' 'VERIFICA SI EN LA FACTURA PADRE SE DESGLOSO EL IEPS
' Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Not Me.ObjFacturaNC.VentaDesglosaIEPS))
' If Not ClienteDesglosaIEPS Then
' If Not RegeneraIEPS AndAlso Not FacturaDesglosoIEPS Then
' PU = PU * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
' VentaDesglosaIEPS = True
' End If
' DrPS("IEPSPorcentaje") = 0
' End If
' 'SI YA SE DESGLOSO EL IEPS SE GUARDA LA BANDERA EN ESTA FACTURA
' If FacturaDesglosoIEPS Then
' VentaDesglosaIEPS = True
' End If
' TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
' Row("PU") = PU
' Row("Codigo") = DrPS("Codigo")
' Row("NoIdentificacion") = DrPS("Codigo")
' Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
' Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
' Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
' Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
' If Modalidad = "U" Then
' Row("Consec") = Index
' Else
' Dim ConsecutivoActual As Integer = TmpDT.MAX("Consec").ToEntero()
' If ConsecutivoActual < 0 Then
' ConsecutivoActual = 0
' End If
' Row("Consec") = ConsecutivoActual + 1
' End If
' Row("PS") = DrPS("PS")
' Row("CodigoPS") = DrPS("PSCodigo").ToString()
' Row("CveTipoPS") = DrPS("CveTipoPS")
' Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
' Row("CveTamaño") = DrPS("CveTamaño")
' If CveClasificacion <= 0 Then Row("CveClasificacion") = DrPS("CveClasificacion")
' If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion")
' Row("PorcentajeIVA") = PorcentajeIVA
' Dim ClienteRetIVA = Me.ClienteRetIVA
' If ClienteRetIVA <= 0 Then
' If CBool(DrPS("EsOutSourcing").ToString()) Then
' ClienteRetIVA = 0.06D
' DdlTipoRetencion.SelectedValueExist("4")
' ElseIf DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
' ClienteRetIVA = 0.106667D
' ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
' ClienteRetIVA = 0.04D
' End If
' End If
' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
' TrRetIVA.Style.Add("display", "")
' DdlTipoRetencion.Visible = True
' Row("IVA") = PorcentajeIVA
' Row("ImporteIVA") = (ImporteIVA).RoundSQL(NumeroDecimales)
' Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
' Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
' Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
' Row("PorcentajeRetIVA") = ClienteRetIVA
' Row("PorcentajeRetISR") = ClienteRetISR
' Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
' Row("ImporteIEPS") = (DrPS("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
' Row("IEPS") = Row("ImporteIEPS")
' Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
' Row("TipoDescuento") = HdnTipoDescuento.Value
' Row("CvePromocionDetalle") = CvePromocionDetalle
' Row("Total") = (Cantidad * PU)
' Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
' 'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
' ' Row("IdCtaContVentas") = IdCtaContable
' ' Row("AplicaParaConcepto") = AplicaParaConcepto
' Row("SATClaveProdServ") = DrPS("SATClavePS")
' Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
' If UsuarioActual.Empresa.UsaAC Then
' Row("CvePresupuestoIngreso") = Me.DdlFuenteRecaudacion.SelectedValue
' End If
' Row("EntregaDirecta") = EntregaDirecta
' 'Contratos
' Row("CveContratoDetalle") = CveContratoDetalle
' Row("CveVentaDetalle") = CveVentaDetalle
' Row("CveMovimientoDetallePedido") = CveMovimientoDetallePedido
' Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
' Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
' Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
' Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
' Row("CuentaPredial") = CuentaPredial
' Row("EsOutSourcing") = DrPS("EsOutSourcing")
' Row("EsCargo") = EsCargo
' If ImporteProntoPago > 0 Then
' Row("ImporteProntoPago") = ImporteProntoPago
' Row("TieneProntoPago") = "Si"
' 'SOLO DEBE MOSTRASE SI EL PAGO ES DE CONTADO
' If RBLPago.SelectedValue = "2" Then
' GvPS.Columns(22).Visible = True
' thProntoPago.Visible = True
' thProntoPago2.Visible = True
' End If
' End If
' If UsuarioActual.CveEmpresa = 119 Then
' If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
' 'MONEDA DIFERENTE DEL PS AL PRIMER PS AGREGADO
' If DdlMoneda.Enabled = False And CveVenta < 0 And TmpDT.Rows.Count > 0 Then
' If DdlMoneda.SelectedValue <> DrPS("CveMoneda").ToString() Then
' Alert($"La moneda base del producto: <b>{DrPS("PSCodigo").ToString()}</b> es diferente a la moneda del documento.", TipoMensaje.MsgAdvertencia)
' Return False
' End If
' End If
' 'ACTIVA PRODUCTOS DE LA MISMA MONEDA
' If TmpDT.Rows.Count = 0 And CveVenta < 0 Then
' DdlMoneda.SelectedValueExist(DrPS("CveMoneda").ToString())
' CambiaMoneda()
' DdlMoneda.Enabled = False
' End If
' End If
' End If
' 'RECARGAR GV
' TmpDT.Rows.Add(Row)
' Retorno = True
' Catch ex As Exception
' Retorno = False
' OnError("Ocurrió un error al agregar el producto/servicio", ex)
' End Try
' Return Retorno
'End Function
#End Region #End Region
#Region "D A T A - T A B L E S" #Region "D A T A - T A B L E S"
@@ -17731,6 +17993,9 @@ Partial Class Ventas
If TbDescuentosRNC.Visible AndAlso ListaNCDesc IsNot Nothing Then If TbDescuentosRNC.Visible AndAlso ListaNCDesc IsNot Nothing Then
TotalRemNCAplicado = ListaNCDesc.Sum(Function(RNC) RNC.TotalRemNCAplicado) TotalRemNCAplicado = ListaNCDesc.Sum(Function(RNC) RNC.TotalRemNCAplicado)
If ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0 Then
TotalRemNCAplicado += ListaNCBonificacion.Sum(Function(RNC) RNC.TotalRemNCAplicado)
End If
End If End If
Total = (TotalSubTotal - TotalDescuentos - TotalAmortizacion + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales) Total = (TotalSubTotal - TotalDescuentos - TotalAmortizacion + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
@@ -19705,7 +19970,7 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero() Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -19766,6 +20031,12 @@ Partial Class Ventas
End If End If
End If End If
If Not OcurrioError Then
If RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
OcurrioError = True
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then If ObjConta.ValorPolizaDescuadre = 2 Then
@@ -19775,12 +20046,6 @@ Partial Class Ventas
End If End If
End If End If
If Not OcurrioError Then
If RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
OcurrioError = True
End If
End If
Catch ex As Exception Catch ex As Exception
OcurrioError = True OcurrioError = True
OnError("Ocurrió un error al actualizar la remisión", ex) OnError("Ocurrió un error al actualizar la remisión", ex)
@@ -25067,6 +25332,23 @@ Partial Class Ventas
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});") e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If End If
End Sub End Sub
Protected Sub GvDescNCCargosDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCCargosDetalle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVentaDetalleRNC").ToEntero() = 0 Then
e.Row.CssClass = "Totales"
e.Row.FCCheckBox("ChkAplicar").Visible = False
e.Row.FCTextBox("TxtCantidadRNC").Visible = False
Else
e.Row.CssClass = "ImportesRNCDetalle"
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChkDetalle({e.Row.FCTextBox("TxtCantidadRNC").ClientID},{e.Row.DBCampo("CantidadPendiente").ToDouble},{e.Row.DBCampo("Total").ToDouble}, this);")
'e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If
End If
End Sub
Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);") e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
@@ -25096,15 +25378,6 @@ Partial Class Ventas
End If End If
End If End If
End Sub End Sub
Protected Sub GvDescNCCargosDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCCargosDetalle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVentaDetalleRNC").ToEntero() = 0 Then
e.Row.CssClass = "Totales"
e.Row.FCCheckBox("ChkAplicar").Visible = False
e.Row.FCTextBox("TxtCantidadRNC").Visible = False
End If
End If
End Sub
Protected Sub GvRemisionesNCBon_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCBon.RowDataBound Protected Sub GvRemisionesNCBon_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCBon.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -27047,65 +27320,145 @@ Partial Class Ventas
Dim OcurrioError = False Dim OcurrioError = False
Dim MensajeError = "" Dim MensajeError = ""
Try
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
'ACTUALIZA VENTA For Each Row As DataRow In TmpDT.Rows
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), LblDescuentos.Text.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), TxtIVA.Text.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), TxtIEPS.Text.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), TxtTotal.Text.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("PU") = Math.Round(Row("PU").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6)
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
End If
Next
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
Moneda = 2
End If
'CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES
If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
Dim Importe As Decimal
Dim TCC As Decimal = TxtTipoCambio.Text.Trim.ToDecimal
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString().ToDecimal * TCC, 6)
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDecimal * TCC, NumeroDecimales)
Importe = Row("Total").ToString().ToDecimal - Row("Descuento").ToString().ToDecimal
Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString().ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString().ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString().ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString().ToDecimal, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
End If
Next
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
TipoCambio = 1
Moneda = 1
End If
'ACTUALIZA VENTA
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(), LblDescuentos.Text.ToDouble(), TxtIVA.Text.ToDouble(), TxtIEPS.Text.ToDouble(), TxtTotal.Text.ToDouble(),
Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta, 0, 0, UsuarioActual.CveEmpresa, CveVenta, 0, 0,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(),
CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal,
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
MensajeError = "Ocurrió un error al actualizar la información de la cotización" MensajeError = "Ocurrió un error al actualizar la información de la cotización"
OcurrioError = True
End If
'ELIMINA DETALLES
If Not ObjVentas.RemoveVentasDetalle(CveVenta) Then
MensajeError = "Ocurrió un error al actualizar las partidas de la cotización"
OcurrioError = True
End If
'RE-INSERTA DETALLES
For Each Row As DataRow In TmpDT.Rows
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(),
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then
MensajeError = "Ocurrió un error al guardar las partidas de la cotización"
OcurrioError = True OcurrioError = True
Exit For
End If End If
Next
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows 'ELIMINA DETALLES
If gvr.RowType = DataControlRowType.DataRow Then If Not ObjVentas.RemoveVentasDetalle(CveVenta) Then
If Not ObjVentas.UpdateVentaImpuestoLocales(CveVenta, gvr.DataKey("CveImpuestoLocal").ToString().ToEntero(), gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble) Then MensajeError = "Ocurrió un error al actualizar las partidas de la cotización"
MensajeError = "Ocurrió un error al actualizar los impuestos locales" OcurrioError = True
End If
'RE-INSERTA DETALLES
For Each Row As DataRow In TmpDT.Rows
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDouble(), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble() * (1 + Row("PorcentajeIVA").ToString().ToDouble())), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(),
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then
MensajeError = "Ocurrió un error al guardar las partidas de la cotización"
OcurrioError = True OcurrioError = True
Exit For
End If
Next
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
If Not ObjVentas.UpdateVentaImpuestoLocales(CveVenta, gvr.DataKey("CveImpuestoLocal").ToString().ToEntero(), gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble) Then
MensajeError = "Ocurrió un error al actualizar los impuestos locales"
OcurrioError = True
End If
End If
Next
'ORDEN PRODUCCION
If UsuarioActual.CveEmpresa.Contiene(126) Then
If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero() > 0 Then
If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then
MensajeError = "Ocurrió un error al actualizar la orden de producción"
OcurrioError = True
End If
End If End If
End If End If
Next
'ORDEN PRODUCCION 'If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If UsuarioActual.CveEmpresa.Contiene(126) Then ' If ObjConta.ValorPolizaDescuadre > 0 Then
If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero() > 0 Then ' If ObjConta.ValorPolizaDescuadre = 2 Then
If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then ' OcurrioError = True
MensajeError = "Ocurrió un error al actualizar la orden de producción" ' MensajeError = ObjConta.MensajePolizaDescuadre
OcurrioError = True ' End If
End If ' End If
End If 'End If
End If Catch ex As Exception
OcurrioError = True
OnError("Ocurrió un error al guardar la cotización", ex)
End Try
'If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
' If ObjConta.ValorPolizaDescuadre > 0 Then
' If ObjConta.ValorPolizaDescuadre = 2 Then
' OcurrioError = True
' MensajeError = ObjConta.MensajePolizaDescuadre
' End If
' End If
'End If
If OcurrioError Then If OcurrioError Then
ObjVentas.RollBack() ObjVentas.RollBack()
@@ -27335,6 +27688,61 @@ Partial Class Ventas
UpPS.Update() UpPS.Update()
UpParametros.Update() UpParametros.Update()
End Sub End Sub
Private Function AjustarTotalCotizacionFacturada(CveCotizacion As Integer, TotalAjustar As Decimal) As Boolean
Dim ErrorAjuste As Boolean = False
Dim ObjCotizacion As New Modelos.Factura(UsuarioActual, CveCotizacion, UsuarioActual.CveEmpresa)
If ObjCotizacion.CveMoneda = 1 Then
Dim TotalNuevoDocumento As Decimal = TotalAjustar
Dim Diferencia As Decimal = (ObjCotizacion.Total - TotalNuevoDocumento)
If Diferencia <> 0 Then
'AJUSTAR EN EL IVA
For Each RowNuevoDocumento As DataRow In TmpDT.Rows
Dim CveVentaDetalleCotizacion As Integer = RowNuevoDocumento("CveVentaDetalleCotizacion").ToString().ToEntero()
Dim ImporteIVANuevoDocumento As Decimal = RowNuevoDocumento("ImporteIVA").ToString().ToDecimal()
Dim ImporteIEPSNuevoDocumento As Decimal = RowNuevoDocumento("ImporteIEPS").ToString().ToDecimal()
If CveVentaDetalleCotizacion > 0 Then
'AJUSTAR IVA
If ImporteIVANuevoDocumento > 0 Then
Dim ImporteIVACotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIVA", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal
If ImporteIVANuevoDocumento <> ImporteIVACotizacion Then
RowNuevoDocumento("ImporteIVA") = ImporteIVACotizacion
End If
End If
'AJUSTAR IEPS
If ImporteIEPSNuevoDocumento > 0 Then
Dim ImporteIEPSCotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIEPS", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal
If ImporteIEPSNuevoDocumento <> ImporteIEPSCotizacion Then
RowNuevoDocumento("ImporteIEPS") = ImporteIEPSCotizacion
End If
End If
End If
Next
End If
CalculaTotalesVenta(RecalculaImpuestosLocales:=False)
If Math.Abs(ObjCotizacion.Total - TotalAjustar) > 0 OrElse Math.Abs(TxtTotal.Text.ToDecimal - TotalAjustar) > 0 Then
ErrorAjuste = True
End If
End If
ObjCotizacion.Dispose()
Return Not ErrorAjuste
End Function
Private Class MVentaDetalleCotizacion Private Class MVentaDetalleCotizacion
Public Property CveVentaDetalle As Integer Public Property CveVentaDetalle As Integer
Public Property Cantidad As Decimal Public Property Cantidad As Decimal
@@ -27468,6 +27876,11 @@ Partial Class Ventas
tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
End If End If
'AgregarProductoServicioCotizacion(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
' Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
' Dr("PorcentajeIVA").ToString().ToDecimal, Dr("IVA").ToString().ToDecimal,
' Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
' CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True)
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(), AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal, Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(), Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
@@ -28735,6 +29148,11 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
'If Not AjustarTotalCotizacionFacturada(Me.CveVenta) Then
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
' Exit Sub
'End If
End If End If
'CARGA LO PENDIENTE POR FACTURAR DE REMISION 'CARGA LO PENDIENTE POR FACTURAR DE REMISION

View File

@@ -226,6 +226,10 @@