Local
This commit is contained in:
@@ -13,7 +13,8 @@ Public Class CFDITimbre
|
||||
Public Property RetencionesLocales As List(Of CFDIRetencionesLocales)
|
||||
Public Property TrasladosLocales As List(Of CFDITrasladosLocales)
|
||||
Public Property Nomina As CFDINomina
|
||||
Public Property ComplementoPagos As CFDIComplementoPagos
|
||||
Public Property ComplementoPagos As CFDIComplementoPago
|
||||
Public Property ComplementoPagos20 As CFDIComplementoPagos20
|
||||
Public Property Complementos As CFDIComplementos
|
||||
Public Property Timbrado As Boolean
|
||||
Public Property IStimbreFiniquito As Boolean
|
||||
@@ -115,7 +116,8 @@ Public Class CFDITimbre
|
||||
Receptor = New CFDIReceptor
|
||||
RetencionesLocales = New List(Of CFDIRetencionesLocales)
|
||||
TrasladosLocales = New List(Of CFDITrasladosLocales)
|
||||
ComplementoPagos = New CFDIComplementoPagos
|
||||
ComplementoPagos = New CFDIComplementoPago
|
||||
ComplementoPagos20 = New CFDIComplementoPagos20
|
||||
Complementos = New CFDIComplementos
|
||||
End Sub
|
||||
|
||||
@@ -437,7 +439,111 @@ End Class
|
||||
|
||||
|
||||
<Serializable>
|
||||
Public Class CFDIComplementoPagos
|
||||
Public Class CFDIComplementoPagos20
|
||||
|
||||
Public Property TotalTrasladosBaseExento As Decimal = 0
|
||||
Public Property TotalRetencionesIVA As Decimal = 0
|
||||
Public Property TotalRetencionesISR As Decimal = 0
|
||||
Public Property ComplementoPagos As List(Of CFDIComplementoPago)
|
||||
|
||||
Public ReadOnly Property MontoTotalPagos As Decimal
|
||||
Get
|
||||
Return (From c In ComplementoPagos Select c.Monto * c.TipoCambioP).Sum()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalTrasladosBaseIVA0 As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.0 Select c.BaseMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalTrasladosImpuestoIVA0 As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.0 Select c.ImporteMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalTrasladosBaseIVA8 As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.BaseMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalTrasladosImpuestoIVA8 As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.ImporteMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalTrasladosBaseIVA16 As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.BaseMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalTrasladosImpuestoIVA16 As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.ImporteMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property TotalRetencionesIEPS As Decimal
|
||||
Get
|
||||
Dim Ret As Decimal = 0
|
||||
For Each cfd As CFDIComplementoPago In ComplementoPagos
|
||||
Ret = Ret + ((From c In cfd.Retenciones Where c.Impuesto = "003" Select c.ImporteMN).Sum() * cfd.TipoCambioP)
|
||||
Next
|
||||
Return Ret.RoundSQL()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
|
||||
ComplementoPagos = New List(Of CFDIComplementoPago)
|
||||
|
||||
End Sub
|
||||
|
||||
'Public ReadOnly Property Totales As CFDIComplementoPagosTotales
|
||||
' Get
|
||||
' Dim tRetorno As New CFDIComplementoPagosTotales
|
||||
' tRetorno.MontoTotalPagos = (From c In DocumentosRelacionados Select c.ImpPagadoMN).Sum()
|
||||
|
||||
' tRetorno.TotalTrasladosBaseIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.BaseMN).Sum()
|
||||
' tRetorno.TotalTrasladosBaseIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.BaseMN).Sum()
|
||||
' tRetorno.TotalTrasladosBaseIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.BaseMN).Sum()
|
||||
|
||||
' tRetorno.TotalTrasladosImpuestoIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Importe).Sum()
|
||||
' tRetorno.TotalTrasladosImpuestoIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.ImporteMN).Sum()
|
||||
' tRetorno.TotalTrasladosImpuestoIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.ImporteMN).Sum()
|
||||
|
||||
' tRetorno.TotalRetencionesIEPS = (From c In Retenciones Where c.Impuesto = "003" Select c.ImporteMN).Sum()
|
||||
|
||||
' Return tRetorno
|
||||
' End Get
|
||||
'End Property
|
||||
End Class
|
||||
|
||||
|
||||
<Serializable>
|
||||
Public Class CFDIComplementoPago
|
||||
Public Property FechaPago As Date
|
||||
Public Property FormaDePagoP As String = ""
|
||||
Public Property MonedaP As String = ""
|
||||
@@ -455,24 +561,24 @@ Public Class CFDIComplementoPagos
|
||||
Public Property SelloPago As String = ""
|
||||
Public Property DocumentosRelacionados As List(Of CFDIComplementoPagosDocsRelacionados)
|
||||
Public Property Impuestos As List(Of CFDIConceptosImpuestos)
|
||||
Public ReadOnly Property Totales As CFDIComplementoPagosTotales
|
||||
Get
|
||||
Dim tRetorno As New CFDIComplementoPagosTotales
|
||||
tRetorno.MontoTotalPagos = (From c In DocumentosRelacionados Select c.ImpPagadoMN).Sum()
|
||||
'Public ReadOnly Property Totales As CFDIComplementoPagosTotales
|
||||
' Get
|
||||
' Dim tRetorno As New CFDIComplementoPagosTotales
|
||||
' tRetorno.MontoTotalPagos = (From c In DocumentosRelacionados Select c.ImpPagadoMN).Sum()
|
||||
|
||||
tRetorno.TotalTrasladosBaseIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.BaseMN).Sum()
|
||||
tRetorno.TotalTrasladosBaseIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.BaseMN).Sum()
|
||||
tRetorno.TotalTrasladosBaseIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.BaseMN).Sum()
|
||||
' tRetorno.TotalTrasladosBaseIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.BaseMN).Sum()
|
||||
' tRetorno.TotalTrasladosBaseIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.BaseMN).Sum()
|
||||
' tRetorno.TotalTrasladosBaseIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.BaseMN).Sum()
|
||||
|
||||
tRetorno.TotalTrasladosImpuestoIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Importe).Sum()
|
||||
tRetorno.TotalTrasladosImpuestoIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.ImporteMN).Sum()
|
||||
tRetorno.TotalTrasladosImpuestoIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.ImporteMN).Sum()
|
||||
' tRetorno.TotalTrasladosImpuestoIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Importe).Sum()
|
||||
' tRetorno.TotalTrasladosImpuestoIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.ImporteMN).Sum()
|
||||
' tRetorno.TotalTrasladosImpuestoIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.ImporteMN).Sum()
|
||||
|
||||
tRetorno.TotalRetencionesIEPS = (From c In Retenciones Where c.Impuesto = "003" Select c.ImporteMN).Sum()
|
||||
' tRetorno.TotalRetencionesIEPS = (From c In Retenciones Where c.Impuesto = "003" Select c.ImporteMN).Sum()
|
||||
|
||||
Return tRetorno
|
||||
End Get
|
||||
End Property
|
||||
' Return tRetorno
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public ReadOnly Property TotalImpuestosRetenidos As Decimal
|
||||
Get
|
||||
|
||||
@@ -3921,7 +3921,7 @@ Public Class ClsGenerales
|
||||
|
||||
Public Function UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, CveEmpresa As Integer,
|
||||
Optional FechaLlegada As DateTime = MinFecha, Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1, Optional Distancia As Integer = -1,
|
||||
Optional CveConfigAutoTransporte As Integer = -1) As Boolean
|
||||
Optional CveConfigAutoTransporte As Integer = -1, Optional FolioReferencia As String = "-1", Optional Referencia As String = "-1", Optional CveSubProyecto As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_EntregaAlmacenRutaUpdate")
|
||||
|
||||
@@ -3941,6 +3941,9 @@ Public Class ClsGenerales
|
||||
.Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2
|
||||
.Add("@Distancia", SqlDbType.Int).Value = Distancia
|
||||
.Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte
|
||||
.Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
|
||||
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -5875,6 +5875,27 @@ Public Class ClsInventarios
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "JAM - POG"
|
||||
Public Function GetJAM_BASF_POG(Fecha As Date) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_JAM_BASF_POG")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region " IDisposable Support "
|
||||
' IDisposable
|
||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||
|
||||
@@ -859,7 +859,6 @@ Public Class ClsNominas
|
||||
DataAdapter("PA_Nom_NominasDetallesRemove")
|
||||
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveNominaDetalle", SqlDbType.Int).Value = CveNominaDetalle
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
@@ -1063,12 +1062,15 @@ Public Class ClsNominas
|
||||
End Function
|
||||
|
||||
|
||||
Public Function RemoveNom_Nominas(CveNomina As Integer) As Boolean
|
||||
Public Function RemoveNom_Nominas(CveNomina As Integer, EliminarTodo As Boolean, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Nom_NominasRemove")
|
||||
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveNomina", SqlDbType.Int).Value = CveNomina
|
||||
'
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@EliminarTodo", SqlDbType.Int).Value = If(EliminarTodo, 1, 0)
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -3826,9 +3826,9 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then
|
||||
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1")
|
||||
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", True, ObjConta)
|
||||
If CveMovimientoSalida > 0 Then
|
||||
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
|
||||
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", True, ObjConta, CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
@@ -6211,7 +6211,7 @@ Namespace Modelos
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
|
||||
Private Function CancelarMovimientosRemision(CveRemision As Integer, CveAlmacen As Integer, CveAlmacenDestino As Integer, DtMovDetalle As DataTable, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios) As Boolean
|
||||
Private Function CancelarMovimientosRemision(CveRemision As Integer, CveAlmacen As Integer, CveAlmacenDestino As Integer, DtMovDetalle As DataTable, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Boolean
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
|
||||
Dim CveMovimientoSalidaDevRem As Integer = 0
|
||||
@@ -6219,13 +6219,14 @@ Namespace Modelos
|
||||
|
||||
Dim CveMovimientoEntradaDevRem As Integer = 0
|
||||
Dim FolioMovimientoEntradaDevRem As Integer = 0
|
||||
Dim Fecha As DateTime = Now
|
||||
|
||||
'SALIDA DE (ENTREGA POR ADELANTADO)
|
||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1")
|
||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1")
|
||||
FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||
|
||||
'ENTRADA A (ALMACEN GENERAL)
|
||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR2")
|
||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR2")
|
||||
FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||
|
||||
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||
@@ -6271,11 +6272,29 @@ Namespace Modelos
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim ValorInventario As Decimal = DtEntradaDetalle.SUMD("Total")
|
||||
Dim EsContabilizable As Boolean = False
|
||||
Dim Concepto As String = "Cancelación"
|
||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancExAR1", 74, DtEntradaDetalle.SUMD("Total"), DtEntradaDetalle.SUMD("Total"), 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorInventario, Concepto, 68, Concepto, Fecha, 0, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoSalidaDevRem, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario, Concepto, 68, Concepto, Fecha, 0, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoEntradaDevRem, ImporteMX:=ValorInventario, Contabilizable:=EsContabilizable) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveRemision) Then
|
||||
ErrorCancelar = True
|
||||
@@ -10355,6 +10374,7 @@ Namespace Modelos
|
||||
Public Property CveCliente As Integer
|
||||
Public Property Nombre As String
|
||||
Public Property NombreComercial As String
|
||||
Public Property RegimenSociedad As String
|
||||
Public Property Codigo As String
|
||||
Public Property Direccion As String
|
||||
Public Property NoExt As String
|
||||
|
||||
@@ -1097,19 +1097,23 @@ Public Class Timbrado
|
||||
|
||||
'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre
|
||||
If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count
|
||||
Timbre.ComplementoPagos.CtaOrdenante = CuentaPago
|
||||
Timbre.ComplementoPagos.CtaBeneficiario = CuentaBeneficiario
|
||||
Timbre.ComplementoPagos.FechaPago = FechaPago
|
||||
Timbre.ComplementoPagos.FormaDePagoP = FormaPago
|
||||
Timbre.ComplementoPagos.MonedaP = MonedaPago
|
||||
Timbre.ComplementoPagos.Monto = Monto.RoundSQL
|
||||
Timbre.ComplementoPagos.TipoCambioP = TipoCambioP
|
||||
|
||||
Dim docPago As New CFDIComplementoPago
|
||||
|
||||
docPago.CtaOrdenante = CuentaPago
|
||||
docPago.CtaBeneficiario = CuentaBeneficiario
|
||||
docPago.FechaPago = FechaPago
|
||||
docPago.FormaDePagoP = FormaPago
|
||||
docPago.MonedaP = MonedaPago
|
||||
docPago.Monto = Monto.RoundSQL
|
||||
docPago.TipoCambioP = TipoCambioP
|
||||
|
||||
|
||||
Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago, ObjetoImpuesto As String
|
||||
Dim VentaImportePago, VentaImportePagoMN, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, VentaTipoCambioMN, PorcentajeIVA, PorcentajeIEPS As Decimal
|
||||
Dim VentaImportePago, VentaImportePagoMN, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, PorcentajeIVA, PorcentajeIEPS, Equivalencia As Decimal
|
||||
Dim VentaNumParcialidad As Integer
|
||||
|
||||
|
||||
If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As Data.DataRow In dttpagos.Rows
|
||||
@@ -1131,11 +1135,14 @@ Public Class Timbrado
|
||||
'' si la moneda es igual, se omite el tipo de cambio de la venta
|
||||
If MonedaPago = VentaAbreviaturaSAT Then
|
||||
VentaTipoCambio = 1
|
||||
VentaTipoCambioMN = 1
|
||||
Equivalencia = 1
|
||||
'condiciones especiales para el pago en pesos, facturas en moneda extranjera
|
||||
ElseIf MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then
|
||||
VentaTipoCambioMN = VentaTipoCambio
|
||||
VentaTipoCambio = (1 / VentaTipoCambio).RoundSQL(6)
|
||||
VentaTipoCambio = VentaTipoCambio.RoundSQL(6)
|
||||
Equivalencia = (1 / VentaTipoCambio).RoundSQL(6)
|
||||
ElseIf MonedaPago = "USD" AndAlso VentaAbreviaturaSAT <> "USD" Then
|
||||
VentaTipoCambio = VentaTipoCambio.RoundSQL(6)
|
||||
Equivalencia = VentaTipoCambio
|
||||
End If
|
||||
|
||||
' For Each drr As Data.DataRow In DtFacturasPagadas.Rows
|
||||
@@ -1145,11 +1152,11 @@ Public Class Timbrado
|
||||
.MonedaDR = VentaAbreviaturaSAT,
|
||||
.MetodoDePagoDR = VentaMetodoPago,
|
||||
.ImpPagado = VentaImportePago,
|
||||
.ImpPagadoMN = (VentaImportePago / VentaTipoCambio).RoundSQL,
|
||||
.ImpPagadoMN = (VentaImportePago * TipoCambioP).RoundSQL,
|
||||
.ImpSaldoInsoluto = VentaImporteSaldoInsoluto,
|
||||
.ImpSaldoAnt = VentaImporteSaldoAnterior,
|
||||
.TipoCambioDR = VentaTipoCambio,
|
||||
.EquivalenciaDR = VentaTipoCambio,
|
||||
.EquivalenciaDR = Equivalencia,
|
||||
.NumParcialidad = VentaNumParcialidad,
|
||||
.ObjetoImpuesto = ObjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)}
|
||||
|
||||
@@ -1160,17 +1167,18 @@ Public Class Timbrado
|
||||
.TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal,
|
||||
.Impuesto = drp("TipoImpuesto").ToString,
|
||||
.Importe = drp("Importe").ToString().ToDecimal.RoundSQL,
|
||||
.BaseMN = (drp("Base").ToString.ToDecimal / VentaTipoCambio).RoundSQL(6),
|
||||
.ImporteMN = (drp("Importe").ToString.ToDecimal * VentaTipoCambio).RoundSQL(6)
|
||||
.BaseMN = (drp("Base").ToString.ToDecimal / Equivalencia).RoundSQL(2),
|
||||
.ImporteMN = (drp("Importe").ToString.ToDecimal / Equivalencia).RoundSQL(2)
|
||||
}
|
||||
)
|
||||
|
||||
Next
|
||||
|
||||
Timbre.ComplementoPagos.DocumentosRelacionados.Add(doc)
|
||||
docPago.DocumentosRelacionados.Add(doc)
|
||||
|
||||
Next
|
||||
|
||||
Timbre.ComplementoPagos20.ComplementoPagos.Add(docPago)
|
||||
|
||||
End If
|
||||
'If drr("IVA").ToString.ToDouble > 0 Then
|
||||
@@ -4113,24 +4121,24 @@ Public Class Timbrado
|
||||
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales()
|
||||
'Totales Generales
|
||||
|
||||
Totales.MontoTotalPagos = ObjCFDITimbre.ComplementoPagos.Totales.MontoTotalPagos.RoundSQL
|
||||
Totales.MontoTotalPagos = ObjCFDITimbre.ComplementoPagos20.MontoTotalPagos.RoundSQL
|
||||
|
||||
Totales.TotalTrasladosBaseIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16.RoundSQL
|
||||
Totales.TotalTrasladosBaseIVA16 = ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseIVA16.RoundSQL
|
||||
Totales.TotalTrasladosBaseIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0
|
||||
Totales.TotalTrasladosImpuestoIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16.RoundSQL
|
||||
Totales.TotalTrasladosImpuestoIVA16 = ObjCFDITimbre.ComplementoPagos20.TotalTrasladosImpuestoIVA16.RoundSQL
|
||||
Totales.TotalTrasladosImpuestoIVA16Specified = Totales.TotalTrasladosImpuestoIVA16 > 0
|
||||
|
||||
Totales.TotalTrasladosBaseIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8.RoundSQL
|
||||
Totales.TotalTrasladosBaseIVA8 = ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseIVA8.RoundSQL
|
||||
Totales.TotalTrasladosBaseIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0
|
||||
Totales.TotalTrasladosImpuestoIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA8.RoundSQL
|
||||
Totales.TotalTrasladosImpuestoIVA8 = ObjCFDITimbre.ComplementoPagos20.TotalTrasladosImpuestoIVA8.RoundSQL
|
||||
Totales.TotalTrasladosImpuestoIVA8Specified = Totales.TotalTrasladosImpuestoIVA8 > 0
|
||||
|
||||
Totales.TotalTrasladosBaseIVA0 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0.RoundSQL
|
||||
Totales.TotalTrasladosBaseIVA0 = ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseIVA0.RoundSQL
|
||||
Totales.TotalTrasladosBaseIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
|
||||
Totales.TotalTrasladosImpuestoIVA0 = 0
|
||||
Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0 ' si hay base > 0, debe de ponerse aunque sea en cero
|
||||
If ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS > 0 Then
|
||||
Totales.TotalRetencionesIEPS = ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS.RoundSQL
|
||||
If ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS > 0 Then
|
||||
Totales.TotalRetencionesIEPS = ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS.RoundSQL
|
||||
Totales.TotalRetencionesIEPSSpecified = True
|
||||
Else
|
||||
Totales.TotalRetencionesIEPSSpecified = False
|
||||
@@ -4214,7 +4222,7 @@ Public Class Timbrado
|
||||
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.ImporteMN
|
||||
x += 1
|
||||
Next
|
||||
End If
|
||||
@@ -5066,88 +5074,92 @@ Public Class Timbrado
|
||||
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
|
||||
|
||||
cfdi.Pago20Totales(ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIVA,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesISR,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA8,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA0,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseExento,
|
||||
ObjCFDITimbre.ComplementoPagos.Totales.MontoTotalPagos)
|
||||
|
||||
cfdi.Pago20(ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"),
|
||||
ObjCFDITimbre.ComplementoPagos.FormaDePagoP,
|
||||
ObjCFDITimbre.ComplementoPagos.MonedaP,
|
||||
ObjCFDITimbre.ComplementoPagos.TipoCambioP,
|
||||
ObjCFDITimbre.ComplementoPagos.Monto,
|
||||
ObjCFDITimbre.ComplementoPagos.NumOperacion,
|
||||
ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaOrd,
|
||||
ObjCFDITimbre.ComplementoPagos.NomBancoOrdExt,
|
||||
ObjCFDITimbre.ComplementoPagos.CtaOrdenante,
|
||||
ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaBen,
|
||||
ObjCFDITimbre.ComplementoPagos.CtaBeneficiario,
|
||||
ObjCFDITimbre.ComplementoPagos.TipoCadPago,
|
||||
ObjCFDITimbre.ComplementoPagos.CertPago,
|
||||
ObjCFDITimbre.ComplementoPagos.CadPago,
|
||||
ObjCFDITimbre.ComplementoPagos.SelloPago)
|
||||
cfdi.Pago20Totales(ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIVA,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalRetencionesISR,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseIVA16,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosImpuestoIVA16,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseIVA8,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosImpuestoIVA8,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseIVA0,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosImpuestoIVA0,
|
||||
ObjCFDITimbre.ComplementoPagos20.TotalTrasladosBaseExento,
|
||||
ObjCFDITimbre.ComplementoPagos20.MontoTotalPagos)
|
||||
|
||||
For Each docp As CFDIComplementoPago In ObjCFDITimbre.ComplementoPagos20.ComplementoPagos
|
||||
|
||||
cfdi.Pago20(docp.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"),
|
||||
docp.FormaDePagoP,
|
||||
docp.MonedaP,
|
||||
docp.TipoCambioP,
|
||||
docp.Monto,
|
||||
docp.NumOperacion,
|
||||
docp.RfcEmisorCtaOrd,
|
||||
docp.NomBancoOrdExt,
|
||||
docp.CtaOrdenante,
|
||||
docp.RfcEmisorCtaBen,
|
||||
docp.CtaBeneficiario,
|
||||
docp.TipoCadPago,
|
||||
docp.CertPago,
|
||||
docp.CadPago,
|
||||
docp.SelloPago)
|
||||
|
||||
|
||||
If ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0 Then
|
||||
If docp.DocumentosRelacionados.Count > 0 Then
|
||||
|
||||
For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados
|
||||
cfdi.Pago20DoctoRelacionado(doc.IdDocumento,
|
||||
doc.Serie,
|
||||
doc.Folio,
|
||||
doc.MonedaDR,
|
||||
doc.EquivalenciaDR,
|
||||
doc.NumParcialidad,
|
||||
doc.ImpSaldoAnt,
|
||||
doc.ImpPagado,
|
||||
doc.ImpSaldoInsoluto,
|
||||
doc.ObjetoImpuesto)
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
For Each doc As CFDIComplementoPagosDocsRelacionados In docp.DocumentosRelacionados
|
||||
cfdi.Pago20DoctoRelacionado(doc.IdDocumento,
|
||||
doc.Serie,
|
||||
doc.Folio,
|
||||
doc.MonedaDR,
|
||||
doc.EquivalenciaDR,
|
||||
doc.NumParcialidad,
|
||||
doc.ImpSaldoAnt,
|
||||
doc.ImpPagado,
|
||||
doc.ImpSaldoInsoluto,
|
||||
doc.ObjetoImpuesto)
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
|
||||
''retenciones
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
|
||||
If docimp.TrasladooRetencion = "R" Then
|
||||
cfdi.Pago20RetencionDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe)
|
||||
End If
|
||||
j += 1
|
||||
Next
|
||||
''retenciones
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
|
||||
If docimp.TrasladooRetencion = "R" Then
|
||||
cfdi.Pago20RetencionDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe)
|
||||
End If
|
||||
j += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
''traslados
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
|
||||
If docimp.TrasladooRetencion = "T" Then
|
||||
cfdi.Pago20TrasladoDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe)
|
||||
End If
|
||||
j += 1
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
''traslados
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
|
||||
If docimp.TrasladooRetencion = "T" Then
|
||||
cfdi.Pago20TrasladoDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe)
|
||||
End If
|
||||
j += 1
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
If (docp.Retenciones).Count > 0 Then
|
||||
For Each Ret As CFDIRetenciones In docp.Retenciones
|
||||
cfdi.Pago20RetencionP(Ret.Impuesto, Ret.ImporteMN)
|
||||
Next
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
|
||||
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
|
||||
cfdi.Pago20RetencionP(Ret.Impuesto, Ret.ImporteMN)
|
||||
Next
|
||||
If docp.Traslados.Count > 0 Then
|
||||
For Each Tra As CFDITraslados In (docp.Traslados)
|
||||
cfdi.Pago20TrasladoP(Tra.BaseMN, Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota, Tra.ImporteMN)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
|
||||
|
||||
For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
|
||||
cfdi.Pago20TrasladoP(Tra.BaseMN, Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota, Tra.ImporteMN)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -2205,7 +2205,7 @@ Partial Class Compras_Compras
|
||||
If DIOTCveTipoOperacion.Contiene(0, 3) Then ' 85 - Otros
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1"))
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.F.", "2"))
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.M.", "3"))
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("General", "6"))
|
||||
End If
|
||||
|
||||
|
||||
@@ -1865,6 +1865,11 @@ Partial Class PopUpVerFactura
|
||||
Dim SelloCFDi As String = ""
|
||||
Dim SelloSAT As String = ""
|
||||
Dim TipoDocto As String = ""
|
||||
Dim PermisoSCTR1 As String = ""
|
||||
Dim PermisoSCTR2 As String = ""
|
||||
Dim ConfATR1 As String = ""
|
||||
Dim ConfATR2 As String = ""
|
||||
|
||||
|
||||
Dim ObjInv As New ClsGenerales
|
||||
|
||||
@@ -1875,6 +1880,14 @@ Partial Class PopUpVerFactura
|
||||
SerieFolio = Dr("SerieFolio").ToString
|
||||
Telefono = Dr("FiguraTelefono").ToString
|
||||
TipoDocto = Dr("TipoDocto").ToString
|
||||
|
||||
If UsuarioActual.CveEmpresa = 13 Then
|
||||
PermisoSCTR1 = Dr("PermisoSCTR1").ToString
|
||||
PermisoSCTR2 = Dr("PermisoSCTR2").ToString
|
||||
ConfATR1 = Dr("ConfATR1").ToString
|
||||
ConfATR2 = Dr("ConfATR2").ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -2244,9 +2257,18 @@ Partial Class PopUpVerFactura
|
||||
|
||||
params.Add(New ReportParameter("RemolquePlaca1", RemolquePlaca1))
|
||||
params.Add(New ReportParameter("RemolqueSubtimo1", RemolqueSubtimo1))
|
||||
|
||||
params.Add(New ReportParameter("RemolquePlaca2", RemolquePlaca2))
|
||||
params.Add(New ReportParameter("RemolqueSubtimo2", RemolqueSubtimo2))
|
||||
|
||||
If UsuarioActual.CveEmpresa = 13 Then
|
||||
params.Add(New ReportParameter("PermisoSCTRemolque1", PermisoSCTR1))
|
||||
params.Add(New ReportParameter("PermisoSCTRemolque2", PermisoSCTR2))
|
||||
params.Add(New ReportParameter("ConfATR1", ConfATR1))
|
||||
params.Add(New ReportParameter("ConfATR2", ConfATR2))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' [@CertificadoContribuyente]
|
||||
'[@CadenaOriginal]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -452,7 +452,7 @@
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<Format>#,0</Format>
|
||||
<Format>#,0.00</Format>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
@@ -1744,9 +1744,51 @@
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Permiso SCT:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!PermisoSCTRemolque1.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Config. Vehicular:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!ConfATR1.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox38</rd:DefaultName>
|
||||
<Top>4.01548cm</Top>
|
||||
<Top>3.95198cm</Top>
|
||||
<Left>0.06623cm</Left>
|
||||
<Height>0.35631cm</Height>
|
||||
<Width>9.62118cm</Width>
|
||||
@@ -1809,9 +1851,51 @@
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Permiso SCT:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!PermisoSCTRemolque2.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Config. Vehicular:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!ConfATR2.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox38</rd:DefaultName>
|
||||
<Top>4.01548cm</Top>
|
||||
<Top>3.95198cm</Top>
|
||||
<Left>9.72269cm</Left>
|
||||
<Height>0.35631cm</Height>
|
||||
<Width>10.7292cm</Width>
|
||||
@@ -4002,7 +4086,7 @@
|
||||
<PrintOnLastPage>true</PrintOnLastPage>
|
||||
<ReportItems>
|
||||
<Line Name="Line1">
|
||||
<Top>0.03522cm</Top>
|
||||
<Top>0.03521cm</Top>
|
||||
<Left>0.06623cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>20.38566cm</Width>
|
||||
@@ -4032,7 +4116,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox13</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>0.71425cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>1.55632cm</Width>
|
||||
@@ -4066,7 +4150,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>2.27057cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>4.96223cm</Width>
|
||||
@@ -4101,7 +4185,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox13</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>7.33864cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>2.84562cm</Width>
|
||||
@@ -4136,7 +4220,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>10.18425cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>4.68641cm</Width>
|
||||
@@ -4170,7 +4254,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.14458cm</Top>
|
||||
<Top>0.14457cm</Top>
|
||||
<Left>14.99343cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>4.04906cm</Width>
|
||||
@@ -4202,7 +4286,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.68813cm</Top>
|
||||
<Top>0.68812cm</Top>
|
||||
<Left>0.71425cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>6.21751cm</Width>
|
||||
@@ -4685,6 +4769,30 @@
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="PermisoSCTRemolque1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="PermisoSCTRemolque2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="ConfATR1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="ConfATR2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
</ReportParameters>
|
||||
<Language>es-MX</Language>
|
||||
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
|
||||
|
||||
@@ -1266,7 +1266,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim TieneError = False
|
||||
|
||||
Dim ObjConta As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC) Then
|
||||
ObjConta = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjConta.IniciaTransacSQL()
|
||||
End If
|
||||
@@ -1803,7 +1803,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Case 30
|
||||
CveConceptoContable = 181
|
||||
TipoMovtoOtro = False
|
||||
tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
If UsuarioActual.Empresa.Funcionalidad(342).ToEntero > 0 Then
|
||||
IdCtaContableOtro = UsuarioActual.Empresa.Funcionalidad(342).ToEntero
|
||||
End If
|
||||
@@ -3350,9 +3350,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
DdlAlmacen.DataBind()
|
||||
Dim dttA As DataTable = Nothing
|
||||
dttA = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 14)
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
dttA.Merge(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1))
|
||||
End If
|
||||
dttA.Merge(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1))
|
||||
|
||||
DdlAlmacen.DataSource = dttA 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' DdlAlmacen.SelectedValue = "-1"
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
|
||||
|
||||
<asp:GridView ID="gvR" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvR_RowDataBound"
|
||||
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyecto,Estatus,CveTimbre"
|
||||
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyecto,Estatus,CveTimbre,CveCliente,FolioReferencia,Referencia"
|
||||
EmptyDataText="No se encontraron registros"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
|
||||
@@ -738,12 +738,14 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
|
||||
int CveDireccionOrigen = GvRow.DataKey("CveDireccionOrigen").ToEntero();
|
||||
int CveClienteEnvio = -1;
|
||||
string NombreCliente = "";
|
||||
ClsClientes ObjClientes = new ClsClientes();
|
||||
DataTable DtTempDirecciones = new DataTable();
|
||||
|
||||
if (ObjClientes.DireccionEnvioGet(CveDireccionOrigen, -1, -1))
|
||||
{
|
||||
CveClienteEnvio = ObjClientes.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero();
|
||||
CveClienteEnvio = ObjClientes.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero();
|
||||
NombreCliente = ObjClientes.DtResultados.FiltroPrimeroValor("NombreCliente");
|
||||
|
||||
if (ObjClientes.DireccionEnvioGet(-1, CveClienteEnvio, -1))
|
||||
{
|
||||
@@ -756,8 +758,12 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
DdlmodalRecoleccionDireccion.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||
DdlmodalRecoleccionDireccion.SelectedValueExist(CveDireccionOrigen);
|
||||
|
||||
//DdlModalRecoleccionCliente.SelectedValueExist(CveClienteEnvio);
|
||||
DdlModalRecoleccionCliente.SelectedValue = CveClienteEnvio.ToString();
|
||||
DdlModalRecoleccionCliente.SelectedText = NombreCliente;
|
||||
|
||||
DdlSubProyectoRecoleccion.SelectedValueExist(GvRow.DataKey("CveSubProyecto"));
|
||||
TxtFolioReferencia.Text = GvRow.DataKey("FolioReferencia");
|
||||
TxtReferencia.Text = GvRow.DataKey("Referencia");
|
||||
|
||||
CargaDatosRecoleccionDetallePS();
|
||||
|
||||
@@ -778,7 +784,14 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
DdlModalRecoleccionUnidad.Items.Clear();
|
||||
DdlModalRecoleccionUnidad.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||
DdlProducto2.txtValue.Value = "";
|
||||
DdlProducto2.txtText.Value = "";
|
||||
DdlProducto2.txtText.Value = "";
|
||||
|
||||
DdlSubProyectoRecoleccion.SelectedValueExist("-1");
|
||||
DdlModalRecoleccionCliente.SelectedValue = "-1";
|
||||
DdlModalRecoleccionCliente.SelectedText = "Seleccione";
|
||||
|
||||
TxtFolioReferencia.Text = "";
|
||||
TxtReferencia.Text = "";
|
||||
|
||||
DTRecoleccion.Rows.Clear();
|
||||
GvModalPSRecoleccion.DataSource = DTRecoleccion;
|
||||
@@ -843,7 +856,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcesoOK = ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen, DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa);
|
||||
ProcesoOK = ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen, DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, DdlChoferRec.SelectedValue.ToEntero(), DdlUnidadRec.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa,FolioReferencia:TxtFolioReferencia.Text,Referencia: TxtReferencia.Text,CveSubProyecto: DdlSubProyectoRecoleccion.SelectedValue.ToEntero());
|
||||
}
|
||||
|
||||
if (ProcesoOK)
|
||||
|
||||
@@ -577,8 +577,9 @@
|
||||
<asp:HyperLink ID="HypXml" ToolTip="Formato xml" Visible="false" CssClass="btn btn-circle btn- btn-xs blue mysmallbtn" NavigateUrl="#" runat="server"><i class="fa fa-file-o"></i></asp:HyperLink>
|
||||
<asp:HyperLink ID="HypPDF" ToolTip="Formato Timbre" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Visible="false" NavigateUrl="#" runat="server"><i class="fa fa-file-pdf-o"></i></asp:HyperLink>
|
||||
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm btn-xs blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="Imgdesautorizar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="Imgdesautorizar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la autorizacion?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la nómina?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -871,6 +872,9 @@
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:LinkButton ID="LnkMostrarocultarConceptos" CssClass="btn yellow-gold" OnClick="LnkMostrarocultarConceptos_Click" runat="server">Mostrar/ocultar</asp:LinkButton>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a onclick="$('#C_BtnImprimirsobrerecibo').click()" class="btn yellow-gold">Imprimir</a>
|
||||
</div>
|
||||
@@ -939,7 +943,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlImporteD" runat="server" Text='<%# Eval("ImporteD", "${0:N}") %>' Style="word-break: break-all; display: inline-block;"></asp:Label>
|
||||
<asp:Label ID="LtlImporteD" runat="server" Text='<%# string.Format("{0}{1}",(Eval("CveSistemaD").ToString()=="20"? "-" :""),Eval("ImporteD", "${0:N}")) %>' Style="word-break: break-all; display: inline-block;"></asp:Label>
|
||||
<asp:LinkButton ID="LnkImporteD" OnClick="LnkConcepto_Click" runat="server"></asp:LinkButton>
|
||||
<div style="display: inline-block; width: 29px;">
|
||||
<asp:LinkButton ID="LnkImporteDxCalculo" OnClick="LnkImportexCalculo_Click" runat="server" CssClass="btn btn-circle btn-sm btn-xs btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el importe fijo?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
|
||||
@@ -1339,6 +1339,32 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
}
|
||||
}
|
||||
|
||||
protected void Imgdesautorizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
|
||||
//LinkButton lnk = (LinkButton)sender;
|
||||
//GridViewRow gvRow = (GridViewRow)lnk.NamingContainer;
|
||||
//int CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
|
||||
//int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
|
||||
bool continuar = true;
|
||||
|
||||
using (ClsNominas Nom = new ClsNominas())
|
||||
{
|
||||
Nom.IniciaTransacSQL();
|
||||
//AutorizaNom_Nominas
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve,false, UsuarioActual.CveUsuario)))
|
||||
{
|
||||
|
||||
Nom.Commit();
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
Alert("La nomina a sido desautorizada", TipoMensaje.MsgInformacion);
|
||||
cargaDatos();
|
||||
|
||||
}
|
||||
}
|
||||
protected void ImgDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
|
||||
@@ -1352,7 +1378,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
Nom.IniciaTransacSQL();
|
||||
//AutorizaNom_Nominas
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve)))
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve,true,UsuarioActual.CveUsuario )))
|
||||
{
|
||||
|
||||
Nom.Commit();
|
||||
@@ -2005,7 +2031,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
cargaDatos();
|
||||
cargaBitacora();
|
||||
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(SRMostrarFormulas);
|
||||
UpModalConceptos.Update();
|
||||
}
|
||||
protected void cargaasistenciaSR(string orden = "")
|
||||
@@ -2705,7 +2731,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
cargaDatos();
|
||||
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(SRMostrarFormulas);
|
||||
UpModalConceptos.Update();
|
||||
|
||||
RegistraScript("$('#ModalUpConcepto').modal('hide');");
|
||||
@@ -2952,7 +2978,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
cargaDatos();
|
||||
cargaBitacora();
|
||||
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(SRMostrarFormulas);
|
||||
UpModalConceptos.Update();
|
||||
|
||||
RegistraScript("$('#ModalUpConcepto').modal('hide');");
|
||||
@@ -3048,7 +3074,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
LblSRSbc.Text = SalarioDiarioIMSS;
|
||||
|
||||
#endregion
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(true);
|
||||
CargaFonacot();
|
||||
#region "Infonavit"
|
||||
{
|
||||
@@ -3225,12 +3251,26 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
#endregion
|
||||
|
||||
public void cargasobrericiboconceptos()
|
||||
protected void LnkMostrarocultarConceptos_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
cargasobrericiboconceptos(!SRMostrarFormulas);
|
||||
}
|
||||
protected bool SRMostrarFormulas
|
||||
{
|
||||
get
|
||||
{
|
||||
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 ");
|
||||
DataTable dtded = dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 AND CveSistema NOT IN(101)");
|
||||
if (ViewState["SRMostrarFormulas"] == null) { return false; }
|
||||
else { return (bool)ViewState["SRMostrarFormulas"]; }
|
||||
}
|
||||
|
||||
set { ViewState["SRMostrarFormulas"] = value; }
|
||||
}
|
||||
public void cargasobrericiboconceptos(Boolean MostrarFormulas )
|
||||
{
|
||||
SRMostrarFormulas = MostrarFormulas;
|
||||
{
|
||||
DataTable dtper = dtConceptos.FiltraParametros(string.Format("Tipo IN ('P') AND EsPadre = 1 {0}",(MostrarFormulas?"": " AND SoloVisible=0")));
|
||||
DataTable dtded = dtConceptos.FiltraParametros(string.Format("Tipo IN ('D') AND EsPadre = 1 AND CveSistema NOT IN(101) {0}", (MostrarFormulas ? "" : " AND SoloVisible=0")));
|
||||
dtper.Columns.Add("BorradoLogico", typeof(int));
|
||||
dtded.Columns.Add("BorradoLogico", typeof(int));
|
||||
|
||||
@@ -3391,6 +3431,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoP = Concepto;
|
||||
nConcepto.NoConceptoP = Codigo;
|
||||
nConcepto.ImporteP = Importe;
|
||||
nConcepto.isOnlyBisibleP = row["SoloVisible"].ToString().ToEntero();
|
||||
nConcepto.CveSistemaP = row["CveSistema"].ToString().ToEntero();
|
||||
|
||||
nConcepto.ValorP = dtempleados.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
if (maxded > i)
|
||||
@@ -3405,6 +3448,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoD = Concepto;
|
||||
nConcepto.NoConceptoD = Codigo;
|
||||
nConcepto.ImporteD = Importe;
|
||||
nConcepto.CveSistemaD = row["CveSistema"].ToString().ToEntero();
|
||||
nConcepto.isOnlyBisibleD = row["SoloVisible"].ToString().ToEntero();
|
||||
nConcepto.ValorD = dtempleados.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
lconc.Add(nConcepto);
|
||||
@@ -3452,6 +3497,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dtCon.Columns.Add(new DataColumn("EstatusD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isEditedD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isOnlyBisibleD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaP", typeof(int)));
|
||||
foreach (NConcepto itc in lconc)
|
||||
{
|
||||
DataRow dr = dtCon.NewRow();
|
||||
@@ -3473,6 +3520,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dr["EstatusD"] = itc.EstatusD;
|
||||
dr["isEditedD"] = itc.isEditedD;
|
||||
dr["isOnlyBisibleD"] = itc.isOnlyBisibleD;
|
||||
dr["CveSistemaD"] = itc.CveSistemaD;
|
||||
dr["CveSistemaP"] = itc.CveSistemaP;
|
||||
dtCon.Rows.Add(dr);
|
||||
}
|
||||
dtCon.AcceptChanges();
|
||||
@@ -3555,7 +3604,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreRecibo.rdlc");
|
||||
}
|
||||
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null, Content_Disposition: "Inline");
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null);
|
||||
}
|
||||
protected void BtnGuardarInfornavit_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -3598,6 +3647,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
public int isSavedP { get; set; }
|
||||
public int isEditedP { get; set; }
|
||||
public int isOnlyBisibleP { get; set; }
|
||||
public int CveSistemaP { get; set; }
|
||||
|
||||
|
||||
public string NoConceptoD { get; set; }
|
||||
@@ -3610,7 +3660,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
public int isSavedD { get; set; }
|
||||
public int isEditedD { get; set; }
|
||||
public int isOnlyBisibleD { get; set; }
|
||||
|
||||
public int CveSistemaD { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3624,6 +3675,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
public int EstatusO { get; set; }
|
||||
public int isEditedO { get; set; }
|
||||
public int isOnlyBisibleO { get; set; }
|
||||
public int CveSistemaO { get; set; }
|
||||
}
|
||||
|
||||
int CveConceptoPolgvc, CveConceptoDolgvc;
|
||||
@@ -5918,7 +5970,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
//AutorizaNom_Nominas
|
||||
foreach (DataRow drow in dtr.Rows)
|
||||
{
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(drow["CveNomina"].ToString().ToEntero())))
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(drow["CveNomina"].ToString().ToEntero(),false,UsuarioActual.CveUsuario)))
|
||||
{
|
||||
|
||||
}
|
||||
@@ -6530,6 +6582,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoP = Concepto;
|
||||
nConcepto.NoConceptoP = Codigo;
|
||||
nConcepto.ImporteP = Importe;
|
||||
nConcepto.CveSistemaP = row["CveSistema"].ToString().ToEntero();
|
||||
nConcepto.ValorP = dtempleadosSimula.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
if (maxded > i)
|
||||
@@ -6544,6 +6597,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoD = Concepto;
|
||||
nConcepto.NoConceptoD = Codigo;
|
||||
nConcepto.ImporteD = Importe;
|
||||
nConcepto.CveSistemaD = row["CveSistema"].ToString().ToEntero();
|
||||
nConcepto.ValorD = dtempleadosSimula.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
lconc.Add(nConcepto);
|
||||
@@ -6591,6 +6645,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dtCon.Columns.Add(new DataColumn("EstatusD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isEditedD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isOnlyBisibleD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaP", typeof(int)));
|
||||
foreach (NConcepto itc in lconc)
|
||||
{
|
||||
DataRow dr = dtCon.NewRow();
|
||||
@@ -6612,6 +6668,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dr["EstatusD"] = itc.EstatusD;
|
||||
dr["isEditedD"] = itc.isEditedD;
|
||||
dr["isOnlyBisibleD"] = itc.isOnlyBisibleD;
|
||||
dr["CveSistemaD"] = itc.CveSistemaD;
|
||||
dr["CveSistemaP"] = itc.CveSistemaP;
|
||||
dtCon.Rows.Add(dr);
|
||||
}
|
||||
dtCon.AcceptChanges();
|
||||
@@ -6686,7 +6744,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreRecibo.rdlc");
|
||||
}
|
||||
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null, Content_Disposition: "Inline");
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null);
|
||||
}
|
||||
protected void DdlTipoPeriodoSim_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
@@ -8589,4 +8647,5 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -4461,7 +4461,7 @@ Partial Class PV
|
||||
If CvePS.Contiene(402917, 402918) Then
|
||||
PUPromocion = 40D
|
||||
End If
|
||||
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
||||
PUModificado = Math.Round(PUPromocion / (1 + PorcentajeIVA), 6)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -907,7 +907,7 @@ Partial Class RepVentaDetalle
|
||||
TipoDocto = "Dev"
|
||||
End Select
|
||||
|
||||
pathPDF = Server.MapPath(String.Format("~/Empresas/{0}/PDF/{1}/{2}.pdf", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
|
||||
pathPDF = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, TipoDocto, gvr.DataKey("SerieFolio").ToString)
|
||||
|
||||
If IO.File.Exists(pathPDF) Then
|
||||
'NO AGREGAR ARCHIVOS REPETIDOS
|
||||
@@ -924,27 +924,6 @@ Partial Class RepVentaDetalle
|
||||
Response.ContentType = "application/zip"
|
||||
Response.End()
|
||||
End Sub
|
||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
|
||||
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||
Dim File As Byte() = Nothing
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
|
||||
Dim response = httpClient.SendAsync(request).Result
|
||||
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||
File = response.Content.ReadAsByteArrayAsync().Result
|
||||
End If
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
File = Nothing
|
||||
OnError("Ocurrió un error al descargar la factura", ex)
|
||||
End Try
|
||||
|
||||
Return File
|
||||
End Function
|
||||
|
||||
Private Sub BtnDescargarXML_Click(sender As Object, e As EventArgs) Handles BtnDescargarXML.Click
|
||||
Dim pathXML As String
|
||||
@@ -973,7 +952,7 @@ Partial Class RepVentaDetalle
|
||||
TipoDocto = "Dev"
|
||||
End Select
|
||||
|
||||
pathXML = Server.MapPath(String.Format("~/Empresas/{0}/XML/{1}/{2}.xml", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
|
||||
pathXML = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, TipoDocto, gvr.DataKey("SerieFolio").ToString)
|
||||
|
||||
If IO.File.Exists(pathXML) Then
|
||||
'NO AGREGAR ARCHIVOS REPETIDOS
|
||||
@@ -990,6 +969,27 @@ Partial Class RepVentaDetalle
|
||||
Response.ContentType = "application/zip"
|
||||
Response.End()
|
||||
End Sub
|
||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
|
||||
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||
Dim File As Byte() = Nothing
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
|
||||
Dim response = httpClient.SendAsync(request).Result
|
||||
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||
File = response.Content.ReadAsByteArrayAsync().Result
|
||||
End If
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
File = Nothing
|
||||
OnError("Ocurrió un error al descargar la factura", ex)
|
||||
End Try
|
||||
|
||||
Return File
|
||||
End Function
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
If DtVentas IsNot Nothing Then
|
||||
|
||||
@@ -478,17 +478,23 @@ Partial Class Ventas_RepVentas
|
||||
If Anio > 0 AndAlso Mes > 0 Then
|
||||
Dim lastDayOfMonth = DateTime.DaysInMonth(Anio, Mes)
|
||||
|
||||
Dim Dia As Integer = FechaFRef.Day
|
||||
Dim DiaFinal As Integer = FechaFRef.Day
|
||||
|
||||
If e.Row.DBCampo("Mes").ToEntero() <> FechaFRef.Month Then
|
||||
Dia = lastDayOfMonth
|
||||
If Mes <> FechaFRef.Month Then
|
||||
DiaFinal = lastDayOfMonth
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Mes").ToEntero() <> FechaIRef.Month Then
|
||||
'VERIFICAR LA FECHA DE INICIO DEL MES DE CONSULTA
|
||||
If Mes <> FechaIRef.Month Then
|
||||
FechaInicial = New DateTime(Anio, Mes, 1).ToString("dd/MM/yyyy")
|
||||
Else
|
||||
'SI ES EL MISMO MES DE FECHA DE INICIO TOMAR LA FECHA DE INICIO COMO REFERENCIA
|
||||
If Mes = FechaIRef.Month AndAlso Anio = FechaIRef.Year Then
|
||||
FechaInicial = FechaIRef.ToString("dd/MM/yyyy")
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim FechaFinalRef = New DateTime(Anio, Mes, Dia)
|
||||
Dim FechaFinalRef = New DateTime(Anio, Mes, DiaFinal)
|
||||
|
||||
'ASIGNAR LA FECHA FINAL DEL GRUPO, SI ES MENOR A LA FECHA DEL FILTRO
|
||||
If FechaF <> "-1" Then
|
||||
|
||||
@@ -2630,6 +2630,7 @@ Partial Class Ventas
|
||||
End If
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
DdlMoneda.SelectedValueExist(2)
|
||||
CambiaMoneda()
|
||||
Using ObjVentas As New ClsNominas
|
||||
If ObjVentas.EmbarqueManifiestoGet(-1, -1, -1, Request("CveEmbarqueManifiesto").ToString().ToEntero()) And ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString())
|
||||
@@ -2695,9 +2696,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'PERMISO PARA CANCELAR PEDIDO
|
||||
If GvInv.Rows.Count = 0 Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped") And Not CveEstatus = 14 Then
|
||||
@@ -3276,70 +3274,69 @@ Partial Class Ventas
|
||||
HlFacturasRelaciondas.Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
|
||||
If Not CveVenta > 0 Then
|
||||
'LbDescargarExcel.Visible = True
|
||||
HlAgregarExcel.Visible = True
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
' IPP 15 Julio 2017 - ERA FALSE
|
||||
ImgAntiPend.Visible = False
|
||||
UpPS.Update()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
|
||||
TxtFolio.Enabled = False
|
||||
TxtFecha.Enabled = False
|
||||
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
|
||||
If Not CveVenta > 0 Then
|
||||
'LbDescargarExcel.Visible = True
|
||||
HlAgregarExcel.Visible = True
|
||||
End If
|
||||
ImgFecha.Visible = False
|
||||
End If
|
||||
|
||||
'condición temporal por implementación JAM. usuario FernandaRomo
|
||||
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
' IPP 15 Julio 2017 - ERA FALSE
|
||||
ImgAntiPend.Visible = False
|
||||
UpPS.Update()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
|
||||
TxtFolio.Enabled = False
|
||||
TxtFecha.Enabled = False
|
||||
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
End If
|
||||
ImgFecha.Visible = False
|
||||
End If
|
||||
|
||||
'condición temporal por implementación JAM. usuario FernandaRomo
|
||||
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
|
||||
TxtFecha.Enabled = True
|
||||
ImgFecha.Visible = True
|
||||
End If
|
||||
TxtFecha.Enabled = True
|
||||
ImgFecha.Visible = True
|
||||
|
||||
BloqueaCondiconesPago()
|
||||
|
||||
BloqueaClasificaciones()
|
||||
|
||||
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
BtnModalAddPS.Enabled = False
|
||||
End If
|
||||
|
||||
MostrarOpcionesPaqueteria()
|
||||
|
||||
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
||||
|
||||
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
|
||||
' BtnEmitirImprimir.Visible = True
|
||||
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
|
||||
'End If
|
||||
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
trRotacion.Visible = True
|
||||
trRotacionlbl.Visible = True
|
||||
trAlineacion.Visible = True
|
||||
trAlineacionlbl.Visible = True
|
||||
|
||||
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
|
||||
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
|
||||
UPObservaciones.Update()
|
||||
End If
|
||||
|
||||
End If
|
||||
TxtFecha.Enabled = True
|
||||
|
||||
BloqueaCondiconesPago()
|
||||
|
||||
BloqueaClasificaciones()
|
||||
|
||||
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
BtnModalAddPS.Enabled = False
|
||||
End If
|
||||
MostrarOpcionesPaqueteria()
|
||||
|
||||
|
||||
|
||||
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
||||
|
||||
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
|
||||
' BtnEmitirImprimir.Visible = True
|
||||
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
|
||||
'End If
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
trRotacion.Visible = True
|
||||
trRotacionlbl.Visible = True
|
||||
trAlineacion.Visible = True
|
||||
trAlineacionlbl.Visible = True
|
||||
|
||||
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
|
||||
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
|
||||
UPObservaciones.Update()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BloqueaClasificaciones()
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
@@ -5239,8 +5236,11 @@ Partial Class Ventas
|
||||
TxtFech3.ReadOnly = True : ImgFech3.Enabled = False
|
||||
ChkConvertirDoctoPesos.Enabled = False
|
||||
ChkConvertirDolares.Enabled = False
|
||||
TxtTipoCambio.Enabled = False
|
||||
TxtTipoCambioDlls.Enabled = False
|
||||
|
||||
TxtTipoCambio.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
TxtTipoCambioDlls.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
TxtTipoCambio.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
TxtTipoCambioDlls.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
|
||||
'Condiciones de Pago
|
||||
RBLPago.Enabled = False
|
||||
@@ -8017,7 +8017,7 @@ Partial Class Ventas
|
||||
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero()
|
||||
TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text
|
||||
TmpDT.Rows(e.RowIndex)("Cantidad") = Cantidad
|
||||
TmpDT.Rows(e.RowIndex)("Obs") = GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim
|
||||
TmpDT.Rows(e.RowIndex)("Obs") = GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.TrimEnd
|
||||
TmpDT.Rows(e.RowIndex)("TiempoEntrega") = GvPS.Rows(e.RowIndex).FCTextBox("TxtTiempoEntrega").Text.Trim
|
||||
TmpDT.Rows(e.RowIndex)("PU") = PU
|
||||
TmpDT.Rows(e.RowIndex)("Descuento") = ObjDescuento.ImporteDescuento
|
||||
@@ -8376,6 +8376,37 @@ Partial Class Ventas
|
||||
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DdlChofer.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DdlUnidadCamion.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtDistancia.Text.Trim) Then
|
||||
Alert("La carta porte no tiene la distancia definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFechaEntregaCP.Text.Trim) Then
|
||||
Alert("La carta porte no tiene la F.Salida definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFechaLlegadaCP.Text.Trim) Then
|
||||
Alert("La carta porte no tiene la F.Llegada definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DtMercancias Is Nothing OrElse DtMercancias.Rows.Count = 0 Then
|
||||
Alert("La carta porte no tiene mercancía definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DvConfiguracionVeiculo.Visible Then
|
||||
If DdlConfigAuto.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("La carta porte no tiene la configuración definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
|
||||
@@ -9327,46 +9358,58 @@ Partial Class Ventas
|
||||
idCuentaContabilizacion = 10
|
||||
End If
|
||||
|
||||
If AutoConta Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
Try
|
||||
If AutoConta Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
Else
|
||||
Alert("Ocurrió un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
End If
|
||||
Else
|
||||
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al contabilizar la factura", ex)
|
||||
End Try
|
||||
|
||||
Else
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
End If
|
||||
End If
|
||||
|
||||
'RMF, cuando es pedido, se manda autorización.
|
||||
If ObjFactura.TipoDocto.Contiene("PA") Then
|
||||
Try
|
||||
'RMF, cuando es pedido, se manda autorización.
|
||||
If ObjFactura.TipoDocto.Contiene("PA") Then
|
||||
|
||||
Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
||||
Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
|
||||
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
||||
Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
||||
Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
GVAnticipos.DataBind()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al mandar las notificaciones de autorización", ex)
|
||||
End Try
|
||||
|
||||
Try
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
|
||||
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
||||
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el embarque", ex)
|
||||
End Try
|
||||
|
||||
Try
|
||||
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
|
||||
@@ -9374,7 +9417,7 @@ Partial Class Ventas
|
||||
Directory.CreateDirectory(DirectoriArchivoXML)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
OnError("Ocurrió un error al generar el directorio de xml", ex)
|
||||
End Try
|
||||
|
||||
|
||||
@@ -9412,31 +9455,35 @@ Partial Class Ventas
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
|
||||
If AplicaFEMSA Then
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
End If
|
||||
|
||||
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
|
||||
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
||||
If Not RespCartaPorte.TieneError Then
|
||||
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
||||
Else
|
||||
DebeTimbrar = False
|
||||
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
If DebeTimbrar Then
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
End If
|
||||
Try
|
||||
If AplicaFEMSA Then
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
End If
|
||||
|
||||
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
|
||||
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
||||
If Not RespCartaPorte.TieneError Then
|
||||
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
||||
Else
|
||||
DebeTimbrar = False
|
||||
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
If DebeTimbrar Then
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el timbrado", ex)
|
||||
End Try
|
||||
|
||||
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
|
||||
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
|
||||
ObjTimbrado = Nothing
|
||||
|
||||
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
||||
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas IsNot Nothing AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
||||
Try
|
||||
For Each NCGenerada In ListaNotasCreditoGeneradas
|
||||
If NCGenerada.Timbre IsNot Nothing Then
|
||||
@@ -9467,45 +9514,55 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'CANCELAR FACTURA ANTERIOR
|
||||
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
||||
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
|
||||
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
||||
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
||||
Try
|
||||
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
||||
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
|
||||
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
||||
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cancelar la factura anterior.", ex)
|
||||
End Try
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'VERIFICAR 100% AVANCE A IMPORTE Y CANTIDAD
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
||||
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
Try
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
||||
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjContr.DtResultados.Rows.Count > 0 Then
|
||||
If ObjContr.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
|
||||
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
||||
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
||||
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
||||
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
||||
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
||||
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
||||
|
||||
If PorcentajeAvance >= 100 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
||||
If PorcentajeAvance >= 100 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
||||
End If
|
||||
Else
|
||||
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
||||
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
||||
|
||||
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
||||
|
||||
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
||||
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
||||
|
||||
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
||||
|
||||
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al notificar el avance.", ex)
|
||||
End Try
|
||||
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
@@ -9521,7 +9578,8 @@ Partial Class Ventas
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
||||
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
@@ -9538,7 +9596,7 @@ Partial Class Ventas
|
||||
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
@@ -9566,7 +9624,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'AUTO DESCARGAR PDF
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 1) Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(72) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
|
||||
End If
|
||||
@@ -9670,11 +9728,16 @@ Partial Class Ventas
|
||||
|
||||
MensajeAlert.Clear()
|
||||
|
||||
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
||||
RBLPago.SelectedValue = "1"
|
||||
LimpiaEscondeContado()
|
||||
BtnEmitirImprimir.Visible = False
|
||||
ObjFactura = Nothing
|
||||
Try
|
||||
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
||||
RBLPago.SelectedValue = "1"
|
||||
LimpiaEscondeContado()
|
||||
BtnEmitirImprimir.Visible = False
|
||||
ObjFactura = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al limpiar los datos", ex)
|
||||
End Try
|
||||
|
||||
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
@@ -11572,7 +11635,7 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||
Else
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.NombreComercial
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad
|
||||
End If
|
||||
Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP
|
||||
End If
|
||||
@@ -15011,19 +15074,14 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "¡ P D F R E P O R T V I E W E R !"
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, CveVenta As Integer, UsuarioActual As Usuario, strURLHOST As String)
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String)
|
||||
'GUARDA PDF
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
Dim Factura As Modelos.Factura
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
Dim ObjetoPDF As Byte() = DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||
|
||||
If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then
|
||||
PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0"))
|
||||
End If
|
||||
DescargarFactura(Factura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el PDF", ex)
|
||||
End Try
|
||||
@@ -15031,7 +15089,6 @@ Partial Class Ventas
|
||||
Dim ErrorCorreo As Boolean = False
|
||||
|
||||
If EnviaCorreo Then
|
||||
Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
If Factura IsNot Nothing Then
|
||||
'MANDA CORREO
|
||||
If EnviaCorreo Then
|
||||
@@ -16376,7 +16433,8 @@ Partial Class Ventas
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
||||
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
@@ -18103,7 +18161,7 @@ Partial Class Ventas
|
||||
If CvePS.Contiene(402917, 402918) Then
|
||||
PUPromocion = 40D
|
||||
End If
|
||||
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
||||
PUModificado = Math.Round(PUPromocion / (1 + PorcentajeIVA), 6)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -18145,7 +18203,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
|
||||
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
||||
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
|
||||
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
||||
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
|
||||
ImporteProntoPago:=ObjDescuento.ImporteProntoPago)
|
||||
@@ -21681,6 +21739,15 @@ Partial Class Ventas
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
||||
TrConversionTipoCambio.Visible = True
|
||||
End Select
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Enabled = True
|
||||
TxtTipoCambioDlls.Enabled = True
|
||||
TxtTipoCambio.ReadOnly = False
|
||||
TxtTipoCambioDlls.ReadOnly = False
|
||||
End If
|
||||
|
||||
|
||||
UpPS.Update()
|
||||
|
||||
If CveCliente > 0 Then
|
||||
@@ -25445,37 +25512,42 @@ Partial Class Ventas
|
||||
'1 = TODO FINO
|
||||
'2 = ERROR
|
||||
'3 = SIN CELULAR - PROBLEMA CON EL CELULAR
|
||||
|
||||
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
If Mensaje = "" Then Return 0
|
||||
|
||||
Dim Celular As String = ""
|
||||
|
||||
Try
|
||||
Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Catch ex As Exception
|
||||
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
If Mensaje = "" Then Return 0
|
||||
|
||||
Dim Celular As String = ""
|
||||
|
||||
Try
|
||||
Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
If Celular.Length <> 10 Then Return 3
|
||||
|
||||
'ARMA MENSAJE
|
||||
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
||||
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
||||
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
||||
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
||||
If Mensaje = "" Then Return 2
|
||||
|
||||
Dim ObjMensaje As New ClsTecnoMovil
|
||||
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
||||
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
||||
End If
|
||||
Return 1
|
||||
Else
|
||||
Return 2
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el SMS", ex)
|
||||
Return 0
|
||||
End Try
|
||||
|
||||
If Celular.Length <> 10 Then Return 3
|
||||
|
||||
'ARMA MENSAJE
|
||||
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
||||
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
||||
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
||||
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
||||
If Mensaje = "" Then Return 2
|
||||
|
||||
Dim ObjMensaje As New ClsTecnoMovil
|
||||
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
||||
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
||||
End If
|
||||
Return 1
|
||||
Else
|
||||
Return 2
|
||||
End If
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
@@ -31305,6 +31377,8 @@ Partial Class Ventas
|
||||
' BtnCrearApartirDe.Visible = False
|
||||
'End If
|
||||
|
||||
Dim FolioOriginal As String = TxtFolio.Text
|
||||
|
||||
HdnCveVenta.Value = ""
|
||||
|
||||
BtnCrearApartirDe.Visible = False '[IPP-2Novimebre2018] REEMPLAZA LO COMENTADO ARRIBA
|
||||
@@ -31504,6 +31578,30 @@ Partial Class Ventas
|
||||
HabilitarControlesCartaPorte(True)
|
||||
End If
|
||||
|
||||
If DivAdjuntar.Visible Then
|
||||
Dim FolioNuevo As String = TxtFolio.Text
|
||||
If FolioNuevo <> FolioOriginal Then
|
||||
If Adjunto <> "" Then
|
||||
Adjunto = ""
|
||||
BtnArchivoAdjunto.Text = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
BtnEliminarAdjunto.Visible = False
|
||||
BtnAdjuntar.Visible = True
|
||||
|
||||
tdAdjuntar.Style.Item("display") = "block"
|
||||
tdAdjunto.Style.Item("display") = "none"
|
||||
Else
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
Else
|
||||
DivAdjuntar.Visible = False
|
||||
End If
|
||||
UpAdjuntar.Update()
|
||||
Else
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
UpnTools.Update()
|
||||
UpCliente.Update()
|
||||
UpParametros.Update()
|
||||
@@ -34662,6 +34760,7 @@ Partial Class Ventas
|
||||
If DrPS IsNot Nothing Then
|
||||
CveUM = drPSFlete("CveUnidadMedida").ToString().ToEntero()
|
||||
CveClasificacion = drPSFlete("CveClasificacion").ToString().ToEntero()
|
||||
UnidadMedida = drPSFlete("UnidadMedida").ToString()
|
||||
End If
|
||||
|
||||
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||
|
||||
@@ -508,6 +508,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user