This commit is contained in:
Rakcsle Supertramp
2020-02-05 17:18:52 -07:00
28 changed files with 1437 additions and 1057 deletions

View File

@@ -1991,7 +1991,10 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double,
AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean,
AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1,
Optional CveClasificacion As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleAdd")
@@ -2014,6 +2017,7 @@ Public Class ClsVentas
.Add("@HoraInicio", SqlDbType.DateTime).Value = HoraInicio
.Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin
.Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
End With
Try
@@ -2025,7 +2029,10 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1) As Boolean
Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double,
PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean,
AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime,
Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleUpdate")
@@ -2049,6 +2056,7 @@ Public Class ClsVentas
.Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin
.Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle
.Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
End With
Try
@@ -2262,6 +2270,43 @@ Public Class ClsVentas
#End Region
#Region "Firmas"
Public Function GetVentasRelacionadas(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasRelacionadasGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las ventas relacionadas. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddVentasRelacionadas(CveVenta As Integer, CveVentaRelacionada As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasRelacionadasAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveVentaRelacionada", SqlDbType.Int).Value = CveVentaRelacionada
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar las ventas relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region " I M P U E S T O S L O C A L E S"
Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4233,7 +4278,7 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean) As Boolean
Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean, CveMovimiento As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUsadosRecibidoUpdate", CommandType.StoredProcedure)
@@ -4242,6 +4287,7 @@ Public Class ClsVentas
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Recibido", SqlDbType.Bit).Value = Recibido
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
End With
Try
@@ -4256,6 +4302,74 @@ Public Class ClsVentas
#End Region
#Region "P O R C E N T A J E - C O M I S I O N E S"
Public Function AddCierreComisionVendedor(CveVendedor As Integer, Mes As Integer, Anio As Integer, PorcentajeComision As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_CierreComisionVendedoresAdd", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Mes", SqlDbType.Int).Value = Mes
.Add("@Anio", SqlDbType.Int).Value = Anio
.Add("@PorcentajeComision", SqlDbType.Money).Value = PorcentajeComision
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar cierre de comisión al vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetCierreComisionVendedor(CveVendedor As Integer, Mes As Integer, Anio As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_CierreComisionVendedoresGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Mes", SqlDbType.Int).Value = Mes
.Add("@Anio", SqlDbType.Int).Value = Anio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar cierre de comisión al vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateCierreComisionVendedor(CveVendedor As Integer, Mes As Integer, Anio As Integer, PorcentajeComision As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_CierreComisionVendedoresUpdate", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Mes", SqlDbType.Int).Value = Mes
.Add("@Anio", SqlDbType.Int).Value = Anio
.Add("@PorcentajeComision", SqlDbType.Money).Value = PorcentajeComision
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el cierre de comisión del vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region "IDisposable Support"

View File

@@ -1439,10 +1439,11 @@ Namespace Modelos
End If
'Contratos
If factura.CveContrato > 0 AndAlso TipoDocto.Contiene("Ing") Then
GuardarContratoAvanceEstimaciones(ObjContr, ErrorList, 1)
ElseIf factura.CveContrato > 0 AndAlso factura.TipoDocto.Contiene("Egs", "Dev") Then
GuardarContratoAvanceEstimaciones(ObjContr, ErrorList, -1)
If factura.CveContrato > 0 AndAlso factura.TipoDocto.Contiene("Ing") Then
GuardarContratoAvanceEstimaciones(factura, ObjContr, ErrorList, 1)
'CUANDO ES NOTA DE CRÉDITO, NO DEBE DE CONSIDERAR AVANCE, CUANDO ES NOTA DE CRÉDITO POR AMORTIZACIÓN
ElseIf factura.CveContrato > 0 AndAlso factura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not factura.EsNCAmortizacion Then
GuardarContratoAvanceEstimaciones(factura, ObjContr, ErrorList, -1)
End If
'Impuestos Locales
@@ -1781,18 +1782,18 @@ Namespace Modelos
Return True
End Function
Private Sub GuardarContratoAvanceEstimaciones(ObjContrato As ClsContratos, ErrorList As List(Of String), Multiplicador As Integer, Optional CrearAvance As Boolean = False)
Private Sub GuardarContratoAvanceEstimaciones(ObjFactura As Modelos.Factura, ObjContrato As ClsContratos, ErrorList As List(Of String), Multiplicador As Integer, Optional CrearAvance As Boolean = False)
If Me.CveContrato > 0 Then
If ObjFactura.CveContrato > 0 Then
Dim CveEstimacion As Integer = -1
If ObjContrato.AddEstimaciones(Me.CveContrato, Me.Fecha, -1, Me.CveVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjContrato.AddEstimaciones(ObjFactura.CveContrato, ObjFactura.Fecha, -1, ObjFactura.CveVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CveEstimacion = ObjContrato.DtResultados(0)("CveEstimacion").ToString.ToEntero
For Each row As DataRow In DtDetalle.Rows
For Each row As DataRow In ObjFactura.DtDetalle.Rows
If row("CveContratoDetalle").ToString.ToEntero > 0 Then
If Not ObjContrato.AddContratosAvance(row("CveContratoDetalle").ToString.ToEntero, row("Cantidad").ToString.ToEntero * Multiplicador, Me.Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
If Not ObjContrato.AddContratosAvance(row("CveContratoDetalle").ToString.ToEntero, row("Cantidad").ToString.ToEntero * Multiplicador, ObjFactura.Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
ErrorList.Add("Ocurrió un error al agregar los avances")
End If
End If
@@ -4464,13 +4465,13 @@ Namespace Modelos
'CANCELA CONTRATOS
If Not ErrorCancelar Then
If ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, -1, True)
ObjFactura.GuardarContratoAvanceEstimaciones(ObjFactura, ObjContrato, ErrorList, -1, True)
If ErrorList.Count > 0 Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato."
End If
ElseIf ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, 1, True)
ObjFactura.GuardarContratoAvanceEstimaciones(ObjFactura, ObjContrato, ErrorList, 1, True)
If ErrorList.Count > 0 Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los avances del contrato."

File diff suppressed because it is too large Load Diff

View File

@@ -342,7 +342,9 @@ Partial Class Bancos_RepProgramarRecursos
LblPesosTotal.Text = String.Format("$ {0}", DtDatos.SUM("SaldoPesos", "CveCompra > 0").ToString.FormatoNumero())
LblAcumulado.Text = String.Format("$ {0}", DtDatos.MAX("TotalProgramado", "CveCompra > 0").ToString.FormatoNumero())
End If
End If
Gv.Columns(6).Visible = (UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0)
Mov.Dispose()
CargaGrid(Orden)
@@ -434,19 +436,41 @@ Partial Class Bancos_RepProgramarRecursos
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format(" $get('{0}').readOnly = !this.checked;", e.Row.FCTextBox("TxtS").ClientID))
'cuando estan programado, el saldo es el importe programado, para saber el total que se limite el rango, debe de ser el saldo real, saldo + importeprogramado
e.Row.FCTextBox("TxtS").Attributes.Add("onkeyup", String.Format("FnMonedaRango(this,{0});", e.Row.DBCampo("Original").ToDouble + e.Row.DBCampo("Abonado").ToDouble))
End If
'If UsuarioActual.Empresa.GralSoloProyecto Then ' solo muestar el subproyecto
' e.Row.FCDropDownList("DdlCuenta").Visible = True
' e.Row.FCDropDownList("DdlCuenta").DataSource = DtCuentas
' e.Row.FCDropDownList("DdlCuenta").DataBind()
' e.Row.FCDropDownList("DdlMov").Visible = True
' e.Row.FCDropDownList("DdlMov").DataSource = DtTipoTransaccion
' e.Row.FCDropDownList("DdlMov").DataBind()
'End If
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString)
Select Case e.Row.DBCampo("EstatusInventario").ToEntero
Case 1
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
Case 2
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
Case 3
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
End Select
End If
'If UsuarioActual.Empresa.GralSoloProyecto Then ' solo muestar el subproyecto
' e.Row.FCDropDownList("DdlCuenta").Visible = True
' e.Row.FCDropDownList("DdlCuenta").DataSource = DtCuentas
' e.Row.FCDropDownList("DdlCuenta").DataBind()
' e.Row.FCDropDownList("DdlMov").Visible = True
' e.Row.FCDropDownList("DdlMov").DataSource = DtTipoTransaccion
' e.Row.FCDropDownList("DdlMov").DataBind()
'End If
End If
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(1).ForeColor = Drawing.Color.Red

View File

@@ -7904,6 +7904,7 @@ Partial Class Compras_Compras
'AJUSTA POLIZA
If IdPoliza > 0 Then
PolizaFolio = ObjContaAC.Folio
ObjContaAC.AjustaPoliza(IdPoliza)
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
End If
@@ -7914,35 +7915,43 @@ Partial Class Compras_Compras
Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Entrada Almacen</a>", TempParametros)
End If
ObjCompras.UpdateCompraPrePoliza(TxtFecha.Text.ToDate, PolizaFolio.ToString, IdPoliza, CvePrePoliza, CveCompra, 0)
If Not ObjCompras.UpdateCompraPrePoliza(TxtFecha.Text.ToDate, PolizaFolio.ToString, IdPoliza, CvePrePoliza, CveCompra, 0) Then
TieneError = True
End If
If EntregaDirecta Then
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>")
End If
ObjCompras.Commit()
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
Dim CveEvaluacionProveedor As Integer = -1
If Me.RequiereEvaluacion Then
Dim ObjPro As New ClsCompProveedores()
CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, Now, "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa)
ObjPro.Dispose()
End If
'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
MandaCorreoOCVendedores(CveCompra)
If Not ErrorMovInv Then
For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen
MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen)
Next
End If
If CveEvaluacionProveedor > 0 Then
Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>")
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
If Not TieneError Then
ObjCompras.Commit()
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
Dim CveEvaluacionProveedor As Integer = -1
If Me.RequiereEvaluacion Then
Dim ObjPro As New ClsCompProveedores()
CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, Now, "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa)
ObjPro.Dispose()
End If
'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
MandaCorreoOCVendedores(CveCompra)
If Not ErrorMovInv Then
For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen
MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen)
Next
End If
If CveEvaluacionProveedor > 0 Then
Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>")
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
End If
Else
ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)

View File

@@ -1067,36 +1067,51 @@ Partial Class PopUpVerFactura
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
ObjVentas.DtResultados.Columns.Add("Importe", GetType(Decimal))
ObjVentas.DtResultados.Rows(0)("Importe") = ObjVentas.DtResultados.Rows(0)("Total")
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
End If
End If
End If
End If
Else
If dtVentas(0)("TipoDocto").ToString.Contiene("Ing", "Ant", "Rem") Then
'carga as notas de credito vinculadas
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If
End If
'If dtVentas(0)("TipoDocto").ToString.Contiene("Ing", "Ant", "Rem") Then
' 'carga as notas de credito vinculadas
' If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
' Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
' End If
'End If
If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
End If
End If
End If
End If
End If
'End If
If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
End If
End If
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
' 'If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
' ' Vta.DtNCVinculadas = ObjVentas.DtResultados
' 'End If
' If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
' Vta.DtNCVinculadas = ObjVentas.DtResultados
' End If
'End If
End If
ObjVentas.Dispose()

View File

@@ -10,6 +10,9 @@
white-space: nowrap;
overflow: hidden;
}
.tooltip-inner {
max-width: 350px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
@@ -315,6 +318,11 @@
<asp:Literal ID="LtlObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Alm." ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:Label data-toggle="tooltip" data-html="true" Text='' ID="LbEstatusInv" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />

View File

@@ -315,7 +315,9 @@ Partial Class RepCxPDetalle
DdlTipoProveedor.SelectedValueExist(CveTipoProveedor)
Dim Comprobaciones = IfNull(Request("Comprobaciones"), -1).ToString.ToEntero
DdlComprobacion.SelectedValueExist(Comprobaciones)
DdlComprobacion.SelectedValueExist(Comprobaciones)
GvDatos.Columns(9).Visible = (UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0)
End Sub
@@ -489,7 +491,28 @@ Partial Class RepCxPDetalle
e.Row.FCHyperLink("HplFolio").Text = String.Format("{0}...", e.Row.DBCampo("Agrupador").Substring(0, 25))
End If
Else
e.Row.FCHyperLink("HplFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
e.Row.FCHyperLink("HplFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString)
Select Case e.Row.DBCampo("EstatusInventario").ToEntero
Case 1
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
Case 2
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
Case 3
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
End Select
End If
End If
End If

View File

@@ -998,36 +998,40 @@ Partial Class ContabilidadC_RegPrePoliza
If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
OcurrioError = True
End If
ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate)
For Each row As GridViewRow In GvPrePoliza.Rows
If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then
If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
End If
If ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate) Then
For Each row As GridViewRow In GvPrePoliza.Rows
If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then
If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero)) Then
OcurrioError = True
Exit For
End If
Else
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero)) Then
OcurrioError = True
Exit For
End If
Else
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString,
row.DataKey("CveConceptoContable").ToEntero, row.FCTextBox("TxtConcepto").Text, Now,
row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero),
ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then
OcurrioError = True
Exit For
End If
End If
Next
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then
OcurrioError = True
Exit For
End If
End If
Next
Else
OcurrioError = True
End If
If Not OcurrioError Then
ObjContabilidad.Commit()
Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion)

View File

@@ -2247,6 +2247,7 @@
<asp:HyperLinkField HeaderText="Fecha" DataTextField="Fecha" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Sucursal" DataTextField="SubProyecto" Target="_blank" ItemStyle-Width="15%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Cliente" DataTextField="Cliente" Target="_blank" ItemStyle-Width="35%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Cantidad" DataTextField="Cantidad" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Total" DataTextField="Total" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
</Columns>
</asp:GridView>

View File

@@ -4153,11 +4153,25 @@
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Sucursal:</Value>
<Style>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>11.66812cm</Top>
<Left>0.10722cm</Left>
<Height>2.31759cm</Height>
<Height>2.54689cm</Height>
<Width>3.426cm</Width>
<ZIndex>54</ZIndex>
<Style>
@@ -4229,11 +4243,22 @@
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>7007</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Top>11.66812cm</Top>
<Left>3.65968cm</Left>
<Height>2.31759cm</Height>
<Height>2.54689cm</Height>
<Width>6.20467cm</Width>
<ZIndex>55</ZIndex>
<Style>

View File

@@ -56,28 +56,28 @@
<Width>2.54731cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.73227cm</Width>
<Width>0.70704cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.66702cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.26144cm</Width>
<Width>1.99686cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.46086cm</Width>
<Width>1.96369cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.09776cm</Width>
<Width>1.75246cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.57396cm</Width>
<Width>0.85958cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.37522cm</Width>
<Width>1.6398cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.23062cm</Width>
<Width>1.77947cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -95,7 +95,7 @@
<TextRun>
<Value>=Fields!Fecha.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
<Format>dd/MM/yyy</Format>
</Style>
</TextRun>
@@ -130,7 +130,7 @@
<TextRun>
<Value>=Fields!ConceptoContable.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
@@ -164,7 +164,7 @@
<TextRun>
<Value>=Fields!TipoDocto.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
@@ -198,7 +198,7 @@
<TextRun>
<Value>=Fields!SerieFolio.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
@@ -232,7 +232,7 @@
<TextRun>
<Value>=Fields!FolioReferencia.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
@@ -266,7 +266,7 @@
<TextRun>
<Value>=Fields!Cargo.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
<Format>#,0.00</Format>
</Style>
</TextRun>
@@ -301,7 +301,7 @@
<TextRun>
<Value>=Fields!Abono.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
<Format>#,0.00</Format>
</Style>
</TextRun>
@@ -336,7 +336,7 @@
<TextRun>
<Value>=Fields!Abreviatura.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
@@ -370,7 +370,8 @@
<TextRun>
<Value>=Fields!CargoMN.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
@@ -404,7 +405,8 @@
<TextRun>
<Value>=Fields!AbonoMN.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
@@ -435,7 +437,7 @@
<TablixMembers>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox40">
<CanGrow>true</CanGrow>
@@ -473,7 +475,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox42">
<CanGrow>true</CanGrow>
@@ -511,7 +513,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox44">
<CanGrow>true</CanGrow>
@@ -549,7 +551,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox49">
<CanGrow>true</CanGrow>
@@ -587,7 +589,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox51">
<CanGrow>true</CanGrow>
@@ -625,7 +627,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox47">
<CanGrow>true</CanGrow>
@@ -663,7 +665,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox4">
<CanGrow>true</CanGrow>
@@ -701,7 +703,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox6">
<CanGrow>true</CanGrow>
@@ -710,7 +712,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Moneda</Value>
<Value>Mon.</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
@@ -739,7 +741,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox5">
<CanGrow>true</CanGrow>
@@ -777,7 +779,7 @@
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.8593cm</Size>
<Size>0.59472cm</Size>
<CellContents>
<Textbox Name="Textbox13">
<CanGrow>true</CanGrow>
@@ -831,7 +833,7 @@
<TextRun>
<Value>=Fields!RazonSocial.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
@@ -860,8 +862,8 @@
<DataSetName>DataSet1</DataSetName>
<Top>0.75875cm</Top>
<Left>0.06614cm</Left>
<Height>1.4593cm</Height>
<Width>19.58715cm</Width>
<Height>1.19472cm</Height>
<Width>19.55393cm</Width>
<Style>
<Border>
<Style>None</Style>

View File

@@ -2017,7 +2017,7 @@
</Style>
</TextRun>
<TextRun>
<Value>Contralor </Value>
<Value>Contador</Value>
<MarkupType>HTML</MarkupType>
<Style>
<FontWeight>Bold</FontWeight>

View File

@@ -604,6 +604,7 @@
<div class="modal-body">
<div align="right">
<asp:Label ID="LblVentasPUE" runat="server" Text="" Font-Italic="True"></asp:Label>
<input type="text" id="TxtBusq" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
@@ -792,6 +793,7 @@
<div class="modal-body">
<div style="text-align:right">
<asp:Label ID="LblComprasPUE" runat="server" Text="" Font-Italic="True"></asp:Label>
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>

View File

@@ -203,7 +203,9 @@ Partial Class Inicio
Private Sub MuestraVentasPUE()
Dim objVentas As New ClsVentas
If objVentas.GetPUESinPago(Now.AddYears(-4), Now, -1, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Dim FechaInicio As Date = Now.AddYears(-2)
LblVentasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString
If objVentas.GetPUESinPago(FechaInicio, Now, -1, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
If objVentas.DtResultados.Rows.Count > 0 Then
GvVtaPUE.DataSource = objVentas.DtResultados
@@ -216,8 +218,10 @@ Partial Class Inicio
End Sub
Private Sub MuestraComprasPUE()
Dim objCompras As New ClsCompras
If objCompras.GetPUESinPago(Now.AddYears(-4), Now, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Dim objCompras As New ClsCompras
Dim FechaInicio As Date = Now.AddYears(-2)
LblComprasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString
If objCompras.GetPUESinPago(FechaInicio, Now, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
If objCompras.DtResultados.Rows.Count > 0 Then
GvCompPUE.DataSource = objCompras.DtResultados

View File

@@ -322,82 +322,80 @@ Partial Class Inventarios_RecepcionUsados
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CveMovimiento = -1
CveMovimientoRelacionado = -1
TieneRelacionado = -1
TieneSalida = False
EstatusAlmacenCompra = -1
EsConsumoInterno = False
Correo = ""
FolioCorreo = ""
If IfNull(Request("Opc"), "").ToString = "S" Then
RBLOpcion.SelectedValue = "3"
DivCliente.Visible = False
End If
CreaDT()
CargaCombos()
TxtFecha.Text = Now.ToShortDateString
TxtFechaPendientes.Text = Now.ToShortDateString
RVFecha.MaximumValue = Now.ToShortDateString
InicializaClientes()
'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos
Select Case UsuarioActual.Empresa.Funcionalidad(103)
Case "1"
Case "2"
divMonedaSeccion.Visible = True
divGuia.Visible = True
End Select
'AsignacionOpcion()
SiguienteFolio()
'SI YA ES MOVIMIENTO REGISTRADO NO ESCONDE COLUMNA AF
If CveMovimiento > 0 Then
BloqueaEdicionEncabezado()
If UsuarioActual.CveEmpresa.Contiene(66, 13) Then
TrSubProyectoActivoFijo.Visible = True
VisualizaAF(True)
CargaSubProyectos()
End If
End If
CargaSubProyectosUsados()
InicializaBitacoraTemporal()
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
DivCodigoSeriePS.Visible = True
End If
'If IfNull(Request("CI"), -1).ToString.ToEntero > 0 Then
' ActivaConsumoInterno()
'End If
'BLOQUEA PERMISOS
BtnGuardar.Enabled = PermiteGuardar()
BtnEliminar.Enabled = PermiteEliminar()
BtnContabilizar.Enabled = PermiteContabilizar()
BtnNuevo.Enabled = PermiteCrearNuevo()
ActivaPermisoSeccionAlmacen()
If CveMovimiento > 0 Then
PermisoVerImportes()
End If
CargaTamaños()
'DdlProducto2.setEsWebService(True)
'DdlProducto2.Attributes.Add("data-metodo", "getpsusados")
CargaInicial()
End If
End Sub
Private Sub CargaInicial()
CveMovimiento = -1
CveMovimientoRelacionado = -1
TieneRelacionado = -1
TieneSalida = False
EstatusAlmacenCompra = -1
EsConsumoInterno = False
Correo = ""
FolioCorreo = ""
If IfNull(Request("Opc"), "").ToString = "S" Then
RBLOpcion.SelectedValue = "3"
DivCliente.Visible = False
End If
CreaDT()
CargaCombos()
TxtFecha.Text = Now.ToShortDateString
TxtFechaPendientes.Text = Now.ToShortDateString
RVFecha.MaximumValue = Now.ToShortDateString
InicializaClientes()
'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos
Select Case UsuarioActual.Empresa.Funcionalidad(103)
Case "1"
Case "2"
divMonedaSeccion.Visible = True
divGuia.Visible = True
End Select
'AsignacionOpcion()
SiguienteFolio()
'SI YA ES MOVIMIENTO REGISTRADO NO ESCONDE COLUMNA AF
If CveMovimiento > 0 Then
BloqueaEdicionEncabezado()
If UsuarioActual.CveEmpresa.Contiene(66, 13) Then
TrSubProyectoActivoFijo.Visible = True
VisualizaAF(True)
CargaSubProyectos()
End If
End If
CargaSubProyectosUsados()
InicializaBitacoraTemporal()
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
DivCodigoSeriePS.Visible = True
End If
'If IfNull(Request("CI"), -1).ToString.ToEntero > 0 Then
' ActivaConsumoInterno()
'End If
'BLOQUEA PERMISOS
BtnGuardar.Enabled = PermiteGuardar()
BtnEliminar.Enabled = PermiteEliminar()
BtnContabilizar.Enabled = PermiteContabilizar()
BtnNuevo.Enabled = PermiteCrearNuevo()
ActivaPermisoSeccionAlmacen()
If CveMovimiento > 0 Then
PermisoVerImportes()
End If
CargaTamaños()
'DdlProducto2.setEsWebService(True)
'DdlProducto2.Attributes.Add("data-metodo", "getpsusados")
End Sub
@@ -630,6 +628,7 @@ Partial Class Inventarios_RecepcionUsados
CveRemisionRecibida = -1
EsDistribuidor = False
DdlClientes.SelectedValueExist("-1")
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
SiguienteFolio()
@@ -654,6 +653,7 @@ Partial Class Inventarios_RecepcionUsados
If Not DdlAlmacen.Items.Contains(New ListItem("Seleccione", "-1")) Then
DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
End If
DdlAlmacen.SelectedValue = "-1"
If Not EsConsumoInterno Then
DdlAlmacen_SelectedIndexChanged(DdlAlmacen, EventArgs.Empty)
@@ -680,6 +680,8 @@ Partial Class Inventarios_RecepcionUsados
TxtRemision.Text = ""
DivRemision.Visible = False
'CargaInicial()
UpRegistroTipoCambio.Update()
UPDatos.Update()
End Sub
@@ -942,9 +944,9 @@ Partial Class Inventarios_RecepcionUsados
Exit Sub
End If
Else
Alert($"El producto no se encuentra en la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
'Else
' Alert($"El producto no se encuentra en la factura", TipoMensaje.MsgAdvertencia)
' Exit Sub
End If
End If
@@ -1138,7 +1140,7 @@ Partial Class Inventarios_RecepcionUsados
Exit For
End If
If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then
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
@@ -2046,22 +2048,12 @@ Partial Class Inventarios_RecepcionUsados
'End Sub
Private Sub CreaRemisionNC(CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer)
If ObjRemisionNC IsNot Nothing Then
ObjRemisionNC.Dispose()
ObjRemisionNC = Nothing
End If
Me.ObjRemisionNC = New Modelos.Factura(UsuarioActual)
'Dim Folio As String = ""
'Dim Serie As String = ""
'Dim ObjFolios As New ClsGralFolios()
'If ObjFolios.GetFolios("RNC", UsuarioActual.CveEmpresa) Then
' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", CveSubProyecto))
' If DT.Rows.Count > 0 Then
' Serie = DT.Rows(0)("Serie").ToString()
' Folio = DT.Rows(0)("FActual").ToString()
' End If
' DT.Dispose()
'End If
'ObjFolios.Dispose()
Me.ObjRemisionNC.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
Me.ObjRemisionNC.Serie = "-1"
Me.ObjRemisionNC.Folio = -1 'Folio.ToEntero()

View File

@@ -9197,12 +9197,17 @@ Partial Class Clientes
AgregarProductoServicio(1, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Clientes/Usados", SubTotal, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
Dim Folio As Integer = 0
Dim Folio As Integer = -1
Dim Serie As String = ""
If FolioNotaCredito(Tipo) Then
Folio = FolioNotaAcumulador
Serie = SerieNotaAcumulador
'If FolioNotaCredito(Tipo) Then
' Folio = FolioNotaAcumulador
' Serie = SerieNotaAcumulador
'End If
If ObjFactura IsNot Nothing Then
ObjFactura.Dispose()
ObjFactura = Nothing
End If
ObjFactura = New Modelos.Factura(UsuarioActual)

View File

@@ -1585,11 +1585,13 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If MsgError = "" Then
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaFacturasGenerarNC)
If Resp.CveVenta > 0 Then
NCGeneradas.Add(Resp)
Else
MsgError = "No se pudo generar la nota de credito"
If ListaFacturasGenerarNC.Count > 0 Then
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaFacturasGenerarNC)
If Resp.CveVenta > 0 Then
NCGeneradas.Add(Resp)
Else
MsgError = "No se pudo generar la nota de credito"
End If
End If
End If
End If
@@ -1911,7 +1913,7 @@ Partial Class Ventas_ClientesAbonar
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
ObjFacturaDevolucion.GenerarPDFFactura = True
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Trasac:=Trasac, ObjContPaqTransac:=ObjConta)
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=Trasac, ObjContPaqTransac:=ObjConta)
Return Resp
End Function

View File

@@ -2333,7 +2333,6 @@
<div id="DivNumeroCPCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-4">
<asp:TextBox ID="TxtCPCliente" CssClass="form-control " runat="server" MaxLength="5" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="TxtCPCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código Postal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtCPCliente.ClientID.ToString()%>">Código Postal:</label>
</div>
<div class="form-group form-md-line-input input-iconright col-xs-4">
@@ -2354,7 +2353,6 @@
</div>
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label>
</div>
</div>
@@ -2385,8 +2383,6 @@
<div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtCorreoCliente" CssClass="form-control" runat="server" MaxLength="300" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtCorreoCliente" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarCliente"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtCorreoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtCorreoCliente.ClientID.ToString()%>">Email: </label>
<i></i>
</div>

View File

@@ -5323,7 +5323,7 @@ Partial Class PV
TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}."
TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero
'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero
Else
Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia)
'cuando no está registrada, no da ajuste

View File

@@ -180,6 +180,7 @@
<asp:BoundField HeaderText="Promoción" DataField="Promocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="P.U. Promoción" DataField="PUPromocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" DataField="Clasificacion"/>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandArgument='<%# Container.DataItemIndex%>' CommandName="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
@@ -233,7 +234,7 @@
<div class="row">
<label class="col-md-3 truncate">Producto:</label>
<div class="col-md-9">
<ADS:Dropdownlost runat="server" Enabled="true" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<ADS:Dropdownlost runat="server" Enabled="true" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS"/>
</div>
</div>
<div class="row">

View File

@@ -127,6 +127,8 @@ Partial Class Ventas_Promociones
#Region " PS "
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
ChangeDdlProducto()
DdlTipoPromocion.Items.FindByValue("1").Enabled = False
DdlTipoPromocion.Items.FindByValue("3").Enabled = False
End Sub
Private Sub ChangeDdlProducto()
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
@@ -137,6 +139,10 @@ Partial Class Ventas_Promociones
DdlPS.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue)
End If
End Sub
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
DdlTipoPromocion.Items.FindByValue("1").Enabled = True
DdlTipoPromocion.Items.FindByValue("3").Enabled = True
End Sub
#End Region
@@ -219,8 +225,8 @@ Partial Class Ventas_Promociones
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
If DdlPS.SelectedValue.ToEntero <= 0 Then
Alert("Debe seleccionar un Producto/Servicio.", TipoMensaje.MsgAdvertencia)
If DdlClasificacion.SelectedValue.ToEntero <= 0 Then
Alert("Debe seleccionar una clasificacion", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -242,7 +248,7 @@ Partial Class Ventas_Promociones
Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("Clasificacion")
End If
Dr("CvePS") = DdlPS.SelectedValue
Dr("CvePS") = If(DdlPS.SelectedValue = "", "-1", DdlPS.SelectedValue)
Dr("CodigoPS") = DdlPS.SelectedText
Dr("PUAnterior") = LbPUActual.Text.ToDecimal
@@ -388,7 +394,8 @@ Partial Class Ventas_Promociones
For Each Dr As DataRow In TempDT.Rows
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero,
CveClasificacion:=If(Dr("CvePS").ToString = "", 20, Dr("CveClasificacion").ToString.ToEntero)) Then
TieneError = True
Exit For
End If
@@ -417,7 +424,7 @@ Partial Class Ventas_Promociones
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1)) Then
TieneError = True
Exit For
End If
@@ -427,7 +434,7 @@ Partial Class Ventas_Promociones
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 1").Rows
If Not ObjVentas.UpdatePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero, CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero) Then
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1)) Then
TieneError = True
Exit For
End If

View File

@@ -1,197 +1,258 @@
<%@ Page Title="SIG | Reporte de Comisiones" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComisiones.aspx.vb" Inherits="Ventas_RepComisiones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgExcel" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgExcel" />
</Triggers>
</asp:UpdatePanel>
<li>
<asp:HyperLink ID="HLModal" data-toggle="modal" data-target="#Modal" title="Ajuste Comisiones" runat="server"><i class="fa fa-pencil"></i> Ajuste comisiones</asp:HyperLink>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Comisiones Vendedores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</div>
<div class="titlefiltros caption">
<div class="row">
<label style="max-width:80px;" class="col-md-1 truncate">Vendedor:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label style="max-width:70px;" class="col-md-1 truncate">Sucursal:</label>
<div class="col-md-2" style="max-width:120px;">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label style="max-width:90px;" class="col-md-1 truncate">Fecha Inicio:</label>
<div class="col-md-2" style="max-width:140px;">
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label style="max-width:80px;" class="col-md-1 truncate">Fecha Fin:</label>
<div class="col-md-1">
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-6">
<h4>Importes expresados en moneda nacional</h4>
</div>
<div class="col-md-6" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" DataKeyNames="CveVendedor,Comision,FechaI,FechaF,ImporteAjuste" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Vendedor" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink ID="HLVendedor" Target="_blank" Text='<%# Eval("Vendedor") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Importe Venta" DataField="ImporteVenta" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:BoundField HeaderText="Nivel" DataField="Nivel" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
<%--<asp:BoundField HeaderText="Tipo Comision" DataField="TipoComisionTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:BoundField HeaderText="Comisión %" DataField="Comision" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Utilidad" DataField="Importe" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Ajuste" DataField="ImporteAjuste" Visible="false" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<%@ Page Title="SIG | Reporte de Comisiones" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComisiones.aspx.vb" Inherits="Ventas_RepComisiones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgExcel" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgExcel" />
</Triggers>
</asp:UpdatePanel>
<li>
<asp:HyperLink ID="HLModal" data-toggle="modal" data-target="#Modal" title="Ajuste Comisiones" runat="server"><i class="fa fa-pencil"></i> Ajuste comisiones</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HLPorcentaje" data-toggle="modal" data-target="#DivPorcentajeComisiones" title="Porcentaje Comisiones" runat="server"><i class="fa fa-pencil"></i> Porcentaje comisiones</asp:HyperLink>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Comisiones Vendedores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</div>
<div class="titlefiltros caption">
<div class="row">
<label style="max-width: 80px;" class="col-md-1 truncate">Vendedor:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label style="max-width: 70px;" class="col-md-1 truncate">Sucursal:</label>
<div class="col-md-2" style="max-width: 120px;">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label style="max-width: 90px;" class="col-md-1 truncate">Fecha Inicio:</label>
<div class="col-md-2" style="max-width: 140px;">
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label style="max-width: 80px;" class="col-md-1 truncate">Fecha Fin:</label>
<div class="col-md-1">
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-6">
<h4>Importes expresados en moneda nacional</h4>
</div>
<div class="col-md-6" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" DataKeyNames="CveVendedor,Comision,FechaI,FechaF,ImporteAjuste" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Vendedor" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink ID="HLVendedor" Target="_blank" Text='<%# Eval("Vendedor") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Importe Venta" DataField="ImporteVenta" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:BoundField HeaderText="Nivel" DataField="Nivel" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
<%--<asp:BoundField HeaderText="Tipo Comision" DataField="TipoComisionTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:BoundField HeaderText="Comisión %" DataField="Comision" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Utilidad" DataField="Importe" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Ajuste" DataField="ImporteAjuste" Visible="false" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField HeaderText="Importe Venta" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:BoundField HeaderText="Comisión $" DataField="ComisionGanancia" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Importe Cobrado" DataField="Cobrado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pendiente x Cobrar" DataField="Pendiente" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total al Dia" DataField="PendienteXDia" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<div class="row">
<div class="col-md-12" align="center">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button Text="Pagar Comisiones" ID="BtnPagar" OnClick="BtnPagar_Click" Visible="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea registrar el pago de comisiones?" data-btn-ok-label="si" CssClass="btn btn-primary" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel UpdateMode="Conditional" ID="UpModal" runat="server">
<ContentTemplate>
<div id="Modal" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Ajuste Comisiones</h4>
</div>
<div class="modal-body">
<div class="row">
<asp:UpdatePanel UpdateMode="Conditional" ID="UpAjuste" runat="server">
<ContentTemplate>
<label class="col-md-2 truncate">Vendedor:</label>
<div class="col-md-5">
<asp:DropDownList ID="DdlVendedorAjuste" OnSelectedIndexChanged="DdlVendedorAjuste_SelectedIndexChanged" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="DdlVendedorAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAjuste"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-2 truncate">Ajuste:</label>
<div class="col-md-3">
<asp:TextBox Text="0" ID="TxtImporteAjuste" Width="80px" runat="server" />
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars=".,-" />
<%--<asp:RangeValidator ID="RVImporteAjuste" runat="server" Type="Currency" MinimumValue="0.01" MaximumValue="999999" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Ajuste''</b> debe ser mayor a cero. Por favor especifiquelo." ControlToValidate="TxtImporteAjuste" Display="None" ValidationGroup="GrpImporteAjuste"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste1" runat="server" HighlightCssClass="vco" TargetControlID="RVImporteAjuste" Width="350px"></ajax:ValidatorCalloutExtender>--%>
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Ajuste''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpImporteAjuste"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste2" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarAjuste" OnClick="BtnGuardarAjuste_Click" runat="server" Text="Guardar Ajuste" CssClass="btn btn-primary" ValidationGroup="GrpAjuste" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:BoundField HeaderText="Comisión $" DataField="ComisionGanancia" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Importe Cobrado" DataField="Cobrado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comisión Cobrada $" DataField="ComisionCobrada" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pendiente x Cobrar" DataField="Pendiente" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total al Dia" DataField="PendienteXDia" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<div class="row">
<div class="col-md-12" align="center">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button Text="Pagar Comisiones" ID="BtnPagar" OnClick="BtnPagar_Click" Visible="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea registrar el pago de comisiones?" data-btn-ok-label="si" CssClass="btn btn-primary" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel UpdateMode="Conditional" ID="UpModal" runat="server">
<ContentTemplate>
<div id="Modal" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Ajuste Comisiones</h4>
</div>
<div class="modal-body">
<div class="row">
<asp:UpdatePanel UpdateMode="Conditional" ID="UpAjuste" runat="server">
<ContentTemplate>
<label class="col-md-2 truncate">Vendedor:</label>
<div class="col-md-5">
<asp:DropDownList ID="DdlVendedorAjuste" OnSelectedIndexChanged="DdlVendedorAjuste_SelectedIndexChanged" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="DdlVendedorAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAjuste"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-2 truncate">Ajuste:</label>
<div class="col-md-3">
<asp:TextBox Text="0" ID="TxtImporteAjuste" Width="80px" runat="server" />
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars=".,-" />
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Ajuste''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpImporteAjuste"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste2" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarAjuste" OnClick="BtnGuardarAjuste_Click" runat="server" Text="Guardar Ajuste" CssClass="btn btn-primary" ValidationGroup="GrpAjuste" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel UpdateMode="Conditional" ID="UpModalComisiones" runat="server">
<ContentTemplate>
<div id="DivPorcentajeComisiones" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Porcentaje Comisiones</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpPorcentajeComisiones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%-- <div class="row">
<label class="col-md-2 truncate">Vendedor:</label>
<div class="col-md-5">
<asp:DropDownList ID="DdlVendedorPorcentaje" AutoPostBack="true" AppendDataBoundItems="true" runat="server" OnSelectedIndexChanged="DdlVendedorPorcentaje_SelectedIndexChanged" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Todos" Value="-2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPorcentajeVendedor" runat="server" ControlToValidate="DdlVendedorPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeVendedor" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-2 truncate">Porcentaje:</label>
<div class="col-md-3">
<asp:TextBox Text="0" ID="TxtPorcentajeComision" Width="80px" runat="server" />
<label>%</label>
<ajax:FilteredTextBoxExtender ID="FTEPorcentajeComision" runat="server" TargetControlID="TxtPorcentajeComision" FilterType="Custom, Numbers" ValidChars=".,-" />
<asp:RequiredFieldValidator ID="RFVPorcentajeComision" runat="server" ControlToValidate="TxtPorcentajeComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeComision" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
<div class="row">
<label class="col-md-2 truncate">Mes:</label>
<div class="col-md-5">
<asp:DropDownList ID="DdlMes" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2 truncate">Año:</label>
<div class="col-md-3">
<asp:TextBox Text="0" ID="TxtAnio" Width="80px" runat="server" />
<ajax:FilteredTextBoxExtender ID="FTBAnio" runat="server" TargetControlID="TxtAnio" FilterType="Custom, Numbers" ValidChars="" />
<asp:RequiredFieldValidator ID="RFVAnio" runat="server" ControlToValidate="TxtAnio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Anio''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAnio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnio" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarPorcentajeComision" OnClick="BtnGuardarPorcentajeComision_Click" runat="server" Text="Guardar Porcentaje" CssClass="btn btn-primary" ValidationGroup="GrpPorcentajeComision" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -18,14 +18,16 @@ Partial Class Ventas_RepComisiones
InicializaValores()
End If
End Sub
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
TxtAnio.Text = Now.Year.ToString()
DdlMes.SelectedValueExist(Now.Month)
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
@@ -33,11 +35,13 @@ Partial Class Ventas_RepComisiones
DdlVendedorAjuste.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedorAjuste.DataBind()
End Sub
'DdlVendedorPorcentaje.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
'DdlVendedorPorcentaje.DataBind()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
@@ -69,10 +73,9 @@ Partial Class Ventas_RepComisiones
BtnPagar.Visible = False
ImgExcel.Visible = False
End If
End Sub
End Sub
#End Region
#Region " GV DATOS "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -90,11 +93,10 @@ Partial Class Ventas_RepComisiones
e.Row.FCHyperLink("HLVendedor").NavigateUrl = String.Format("/Ventas/RepComisionesDetalle.aspx?CveVendedor={0}&FI={1}&FF={2}&CveSubProyecto={3}", CveVendedorURL, If(txtFechaI.Text.Trim() = "", "-1", txtFechaI.Text.Trim()), If(txtFechaF.Text.Trim() = "", "-1", txtFechaF.Text.Trim()), DdlSubProyecto.SelectedValue.ToEntero)
End If
End Sub
End Sub
#End Region
#Region " PAGAR COMISIONES "
Protected Sub BtnPagar_Click(sender As Object, e As EventArgs)
If Not GvDatos.Rows.Count > 0 Then
@@ -153,10 +155,9 @@ Partial Class Ventas_RepComisiones
ObjComisiones.Dispose()
End Sub
End Sub
#End Region
#Region " AJUSTE "
Protected Sub DdlVendedorAjuste_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjComisiones As New ClsEsquemasComisiones
@@ -194,22 +195,69 @@ Partial Class Ventas_RepComisiones
UPDatos.Update()
End If
End Sub
End Sub
#End Region
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("ReporteComisiones_" & Now.ToShortDateString)
End Sub
End Sub
#End Region
Protected Sub BtnGuardarPorcentajeComision_Click(sender As Object, e As EventArgs)
Dim RowCierre As DataRow = Nothing
Dim TieneError As Boolean = False
Dim ObjVentas As New ClsVentas
Try
ObjVentas.IniciaTransacSQL()
Dim Mes As Integer = DdlMes.SelectedValue.ToEntero()
Dim Anio As Integer = TxtAnio.Text.ToEntero()
For Each GvRow As GridViewRow In GvDatos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.DataKey("CveVendedor").ToEntero() > 0 Then
Dim Porcentaje As Decimal = GvRow.DataKey("Comision").ToDecimal() / 100
If ObjVentas.GetCierreComisionVendedor(GvRow.DataKey("CveVendedor").ToEntero(), Mes, Anio, UsuarioActual.CveEmpresa) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
RowCierre = ObjVentas.DtResultados.Rows(0)
End If
Else
TieneError = True
End If
If RowCierre IsNot Nothing Then
TieneError = Not ObjVentas.UpdateCierreComisionVendedor(GvRow.DataKey("CveVendedor").ToEntero(), Mes, Anio, Porcentaje)
Else
TieneError = Not ObjVentas.AddCierreComisionVendedor(GvRow.DataKey("CveVendedor").ToEntero(), Mes, Anio, Porcentaje)
End If
If TieneError Then
Exit For
End If
End If
RowCierre = Nothing
End If
Next
Catch ex As Exception
TieneError = True
OnError("Ocurrió un error al asginar el porcentaje de la comisión", ex)
End Try
If TieneError Then
ObjVentas.RollBack()
Alert("Ocurrió un error al guardar el porcentaje de comisiones.", TipoMensaje.MsgError)
Else
ObjVentas.Commit()
Alert("El porcentaje de comisiones se guardó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjVentas.Dispose()
CargaDatos()
UPDatos.Update()
UpPorcentajeComisiones.Update()
End Sub
End Class

View File

@@ -126,6 +126,9 @@
<asp:HyperLink ID="HLGanancia" Target="_blank" Text='<%# Eval("ComisionGanancia", "{0:N2}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Porcentaje Pagado %" DataField="PorcentajePagado" DataFormatString="{0:N2}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comision Cobrada %" DataField="PorcentajeComision" DataFormatString="{0:N2}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comision Cobrada" DataField="ComisionCobrada" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField HeaderText="Comision Ganancia" DataField="ComisionGanancia" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />--%>
</Columns>
</asp:GridView>

View File

@@ -1308,7 +1308,7 @@
<ContentTemplate>
<div class="col-md-12">
<asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False"
DataKeyNames="CvePolizaVirtual,SerieLote,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
DataKeyNames="CvePolizaVirtual,SerieLote,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado,IdMarcaUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Código Único">
<ItemTemplate>

View File

@@ -3826,6 +3826,18 @@ Partial Class Ventas
TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2)
TxtIVA.Text = DbRowVenta("IVA").ToString.FormatoNumero(2)
TxtRetIVA.Text = DbRowVenta("RetIVA").ToString.FormatoNumero(2)
If TxtRetIVA.Text.ToDecimal() > 0 Then
TrRetIVA.Style.Add("display", "")
UsuarioActual.Empresa.MostrarRetIVA = True
If DdlTipoRetencion.SelectedValue.ToEntero() > 0 Then
DdlTipoRetencion.Visible = True
End If
If TmpDT IsNot Nothing Then
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
End If
End If
TxtRetISR.Text = DbRowVenta("RetISR").ToString.FormatoNumero(2)
TxtIEPS.Text = DbRowVenta("IEPS").ToString.FormatoNumero(2)
TrIEPS.Visible = TxtIEPS.Text.ToDouble > 0
@@ -4398,6 +4410,10 @@ Partial Class Ventas
TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2)
TxtIVA.Text = drv("IVA").ToString.FormatoNumero(2)
TxtRetIVA.Text = drv("RetIVA").ToString.FormatoNumero(2)
If TxtRetIVA.Text.ToDecimal() > 0 Then
TrRetIVA.Style.Add("display", "")
UsuarioActual.Empresa.MostrarRetIVA = True
End If
TxtRetISR.Text = drv("RetISR").ToString.FormatoNumero(2)
TxtTotal.Text = drv("Total").ToString.FormatoNumero(2)
TotalOriginal = Math.Round(drv("Total").ToString.ToDouble, 2)
@@ -4720,15 +4736,18 @@ Partial Class Ventas
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes
If ObjCliente.RetieneIVAFletes Then
TrRetIVA.Style.Add("display", "")
UsuarioActual.Empresa.MostrarRetIVA = True
If CveVenta <= 0 Then
ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes
If ObjCliente.RetieneIVAFletes Then
TrRetIVA.Style.Add("display", "")
UsuarioActual.Empresa.MostrarRetIVA = True
End If
End If
ViewState("Vendedor") = ObjCliente.Vendedor
ViewState("CtaContable") = ObjCliente.CuentaContable
ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes
@@ -9197,9 +9216,13 @@ Partial Class Ventas
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev") Or DtVentasNC IsNot Nothing Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
End If
End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then
@@ -24059,7 +24082,7 @@ Partial Class Ventas
If obj.used_product Then
Dim FechaUsado As DateTime = Row.DataKey("FechaUsado").ToString().ToDateTime()
obj.used_brand = Row.DataKey("IdModelo").ToString().Trim() 'MARCAR DEL USADO
obj.used_brand = Row.DataKey("IdMarcaUsado").ToString().Trim() 'MARCAR DEL USADO
obj.used_bci = Row.DataKey("IdBCI").ToString().Trim() 'VALOR DEL BCI
obj.used_month = FechaUsado.Month
obj.used_year = FechaUsado.Year
@@ -24208,18 +24231,20 @@ Partial Class Ventas
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
If PorcentajeRetIVA > 0 Then
TrRetIVA.Style.Add("display", "")
UsuarioActual.Empresa.MostrarRetIVA = True
DdlTipoRetencion.Visible = True
End If
GvPS.DataSource = TmpDT
GvPS.DataBind()
UpPS.Update()
End If
End If
End If
UpPS.Update()
End Sub

View File

@@ -7,10 +7,6 @@
<StartupServices>
<Service ID="{C0C07587-41A7-46C8-8FBD-3F9C8EBE2DDC}"/>
</StartupServices>
</VisualWebDeveloper>