Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -288,3 +288,5 @@ vwd.webinfo
|
||||
/A/a.aspx
|
||||
/A/a.aspx.vb
|
||||
/General/Report.rdlc
|
||||
/TmpPruebas.aspx
|
||||
/TmpPruebas.aspx.vb
|
||||
|
||||
@@ -30,6 +30,7 @@ Public Class ClsOC
|
||||
Public Property CveOrdenCompra As Integer
|
||||
Public Property CveOrdenCompraDetalle As Integer
|
||||
Public Property Folio As Integer
|
||||
Public Property Serie As String = ""
|
||||
Public Property CveIEAnticipo As Integer
|
||||
Public Property CveProveedorAnticipo As Integer
|
||||
Public Property FolioIEAnticipo As Integer
|
||||
@@ -120,6 +121,8 @@ Public Class ClsOC
|
||||
Public Property Promocion As String
|
||||
Public Property CveProveedorContacto As Integer
|
||||
Public Property NumRemision As String
|
||||
Public Property PorcentajeProntoPago As Decimal = 0
|
||||
|
||||
|
||||
Public ReadOnly Property DtResultados() As DataTable
|
||||
Get
|
||||
@@ -606,6 +609,7 @@ Public Class ClsOC
|
||||
Dim dr As DataRow = Data.Rows(0)
|
||||
_CveOrdenCompra = dr("CveOrdenCompra").ToString.ToEntero
|
||||
_Folio = dr("Folio").ToString.ToEntero
|
||||
_Serie = dr("Serie").ToString
|
||||
_CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero
|
||||
_FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero
|
||||
_ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDecimal
|
||||
@@ -688,6 +692,7 @@ Public Class ClsOC
|
||||
Promocion = IfNull(dr("Promocion"), "", dr("Promocion").ToString).ToString
|
||||
CveProveedorContacto = If(Not IsDBNull(dr("CveProveedorContacto")), dr("CveProveedorContacto").ToString.ToEntero, -1)
|
||||
NumRemision = dr("NumRemision").ToString
|
||||
PorcentajeProntoPago = dr("PorcentajeProntoPago").ToString.ToDecimal
|
||||
|
||||
Retorno = True
|
||||
ElseIf Data.Rows.Count > 0 Then
|
||||
@@ -708,7 +713,7 @@ Public Class ClsOC
|
||||
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
|
||||
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
|
||||
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
|
||||
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1) As Boolean
|
||||
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OC_OrdenesCompraAdd")
|
||||
@@ -755,6 +760,7 @@ Public Class ClsOC
|
||||
.Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
|
||||
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
|
||||
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito
|
||||
.Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
|
||||
|
||||
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
@@ -919,7 +925,7 @@ Public Class ClsOC
|
||||
Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "",
|
||||
Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1",
|
||||
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1,
|
||||
Optional CveSubProyectoEntrega As Integer = -1) As Boolean
|
||||
Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OC_OrdenesCompraUpdate")
|
||||
@@ -956,6 +962,8 @@ Public Class ClsOC
|
||||
.Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision
|
||||
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
|
||||
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega
|
||||
.Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
|
||||
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -7845,7 +7845,10 @@ Public Class ClsPaginas
|
||||
params.Add(New ReportParameter("Proyecto", If(DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0, DtDetalle.MAX("Proyecto").ToString, "")))
|
||||
End If
|
||||
params.Add(New ReportParameter("CentroCostos", If(DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0, DtDetalle.MAX("Proyecto").ToString, "")))
|
||||
params.Add(New ReportParameter("Folio", ObjOC.Folio.ToString))
|
||||
|
||||
|
||||
params.Add(New ReportParameter("Folio", If(ObjOC.Serie.Length > 0, $"{ObjOC.Serie}-{ObjOC.Folio.ToString}", ObjOC.Folio.ToString)))
|
||||
|
||||
params.Add(New ReportParameter("ProveedorNombre", ObjOC.RazonSocial))
|
||||
params.Add(New ReportParameter("ProveedorLugar", ObjOC.LugarEntrega))
|
||||
params.Add(New ReportParameter("Estatus", ObjOC.Estatus))
|
||||
|
||||
@@ -97,18 +97,24 @@ Public Class ClsValidaCFDi
|
||||
oAcuse = wsConsultaCFDI.Consulta(String.Format("?re={0}&rr={1}&tt={2}&id={3}", LRFCEmisor, LRFCReceptor, Importe, LFolioFiscal.ToUpper))
|
||||
'oAcuse = wsConsultaCFDI.Consulta("?re=LESA6211234B2&rr=GCO890418M56&tt=0000001360.000000&id=0C8BAD9C-A8C6-4A48-8FF5-0687AC6F1581")
|
||||
'Alert(oAcuse.Estado)
|
||||
If oAcuse.Estado.ToLower = "vigente" Then
|
||||
EsValida = 1
|
||||
End If
|
||||
If oAcuse.Estado.ToLower = "cancelado" Then
|
||||
EsValida = 2
|
||||
End If
|
||||
|
||||
If oAcuse.ValidacionEFOS = "100" Then
|
||||
EnListaEFOS = True
|
||||
If oAcuse IsNot Nothing AndAlso oAcuse.Estado IsNot Nothing AndAlso oAcuse.ValidacionEFOS IsNot Nothing Then
|
||||
If oAcuse.Estado.ToLower = "vigente" Then
|
||||
EsValida = 1
|
||||
End If
|
||||
If oAcuse.Estado.ToLower = "cancelado" Then
|
||||
EsValida = 2
|
||||
End If
|
||||
|
||||
If oAcuse.ValidacionEFOS = "100" Then
|
||||
EnListaEFOS = True
|
||||
Else
|
||||
EnListaEFOS = False
|
||||
End If
|
||||
Else
|
||||
EnListaEFOS = False
|
||||
EsValida = 0
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgError = "Op1. No se pudo validar la vigencia ante el SAT "
|
||||
GuardaLog(String.Format("Op1. {0}", ex.Message))
|
||||
@@ -122,7 +128,7 @@ Public Class ClsValidaCFDi
|
||||
|
||||
Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(LFolioFiscal.ToUpper, LRFCEmisor.Replace("%26", "&"), LRFCReceptor.Replace("%26", "&"), Importe, True)
|
||||
|
||||
If Vigencia IsNot Nothing Then
|
||||
If Vigencia IsNot Nothing AndAlso Vigencia.Estado IsNot Nothing AndAlso Vigencia.EsCancelable IsNot Nothing AndAlso Vigencia.EstatusCancelacion IsNot Nothing Then
|
||||
If Not Vigencia.Estado.ToUpper().Contains("NO ENCONTRADO") AndAlso Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
||||
EsValida = 1
|
||||
End If
|
||||
|
||||
@@ -5221,7 +5221,7 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer) As Boolean
|
||||
Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuarioAutorizo As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesUpdate", CommandType.StoredProcedure)
|
||||
@@ -5233,7 +5233,7 @@ Public Class ClsVentas
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
|
||||
.Add("@CveUsuarioAutorizo", SqlDbType.Int).Value = CveUsuarioAutorizo
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -452,6 +452,7 @@ Namespace Modelos
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
|
||||
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
setValues(ObjVentas.DtResultados.Rows(0))
|
||||
SetMetodoPago()
|
||||
SetMoneda()
|
||||
@@ -466,26 +467,33 @@ Namespace Modelos
|
||||
Else
|
||||
Me.VentaDesglosaIEPS = True
|
||||
End If
|
||||
|
||||
SetTotales(ObjVentas.DtResultados, ObjVentas)
|
||||
|
||||
If CargaDTDetalle Then
|
||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||
Me.DtDetalle = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
|
||||
If CargaDatosCliente Then SetCliente()
|
||||
|
||||
If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
|
||||
|
||||
If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
|
||||
|
||||
Me.DirectorioServidor = DirectorioServidor
|
||||
Timbre = New CFDITimbre
|
||||
End If
|
||||
Else
|
||||
Me.CveVenta = -1
|
||||
Me.CveEmpresa = -1
|
||||
Me.CveCliente = -1
|
||||
|
||||
ErrorList.Add("No se pudo cargar la información de la factura.")
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If CargaDatosCliente Then SetCliente()
|
||||
|
||||
If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
|
||||
|
||||
If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
|
||||
|
||||
Me.DirectorioServidor = DirectorioServidor
|
||||
Timbre = New CFDITimbre
|
||||
End Sub
|
||||
Private Sub SetTotales(dtVentas As DataTable, ObjVentas As ClsVentas)
|
||||
Dim TmpDTImpuestos As New DataTable
|
||||
@@ -6329,95 +6337,96 @@ Namespace Modelos
|
||||
'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
|
||||
If Not ErrorCancelar AndAlso DtDevoluciones IsNot Nothing AndAlso DtDevoluciones.Rows.Count > 0 Then
|
||||
For Each CveRemision As Integer In ListaRemisionesCancelar
|
||||
Dim ObjRemision As New Factura(UsuarioActual, CveRemision, UsuarioActual.CveEmpresa)
|
||||
Dim ObjRemision As New Factura(UsuarioActual, CveRemision, UsuarioActual.CveEmpresa, VerificaAlmacen:=True)
|
||||
|
||||
If ObjRemision IsNot Nothing AndAlso ObjRemision.SaldoAlmacen <> 0 Then
|
||||
If ObjRemision IsNot Nothing AndAlso ObjRemision.CveVenta > 0 Then
|
||||
|
||||
Dim SaldoAlmacenExA As Decimal = 0
|
||||
Dim SaldoAlmacenUsados As Decimal = 0
|
||||
Dim DtSaldosAlmacenRemision As DataTable = Nothing
|
||||
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
|
||||
If Not ErrorCancelar Then
|
||||
If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy()
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}")
|
||||
|
||||
Dim DtDevMovs As DataTable = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"})
|
||||
|
||||
For Each RowDevolucion As DataRow In DtDevMovs.Rows
|
||||
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
|
||||
CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero()
|
||||
|
||||
If CveAlmacen > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
|
||||
SaldoAlmacenExA = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacen}")
|
||||
End If
|
||||
|
||||
If SaldoAlmacenExA <> 0 Then
|
||||
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario, ObjConta) Then
|
||||
If ObjRemision.SaldoAlmacen <> 0 Then
|
||||
Dim SaldoAlmacenExA As Decimal = 0
|
||||
Dim SaldoAlmacenUsados As Decimal = 0
|
||||
Dim DtSaldosAlmacenRemision As DataTable = Nothing
|
||||
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
|
||||
If Not ErrorCancelar Then
|
||||
If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy()
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
|
||||
Exit For
|
||||
MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
'CANCELAR MOVIMIENTOS DE USADOS SI TIENE
|
||||
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim CveAlmacenUsado As Integer = 0
|
||||
Dim CveMovimientoUsado As Integer = 0
|
||||
Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}")
|
||||
|
||||
If ObjInventario.GetInv_Mov(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
|
||||
CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cargar los datos de devolución de usado. Por favor vuelva a intentar."
|
||||
End If
|
||||
Dim DtDevMovs As DataTable = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"})
|
||||
|
||||
If CveAlmacenUsado > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
|
||||
SaldoAlmacenUsados = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}")
|
||||
End If
|
||||
For Each RowDevolucion As DataRow In DtDevMovs.Rows
|
||||
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
|
||||
CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero()
|
||||
|
||||
If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then
|
||||
If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario, ObjConta, Contabilizable:=False) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar."
|
||||
If CveAlmacen > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
|
||||
SaldoAlmacenExA = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacen}")
|
||||
End If
|
||||
|
||||
If SaldoAlmacenExA <> 0 Then
|
||||
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario, ObjConta) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
'CANCELAR MOVIMIENTOS DE USADOS SI TIENE
|
||||
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim CveAlmacenUsado As Integer = 0
|
||||
Dim CveMovimientoUsado As Integer = 0
|
||||
|
||||
If ObjInventario.GetInv_Mov(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
|
||||
CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cargar los datos de devolución de usado. Por favor vuelva a intentar."
|
||||
End If
|
||||
|
||||
If CveAlmacenUsado > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
|
||||
SaldoAlmacenUsados = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}")
|
||||
End If
|
||||
|
||||
If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then
|
||||
If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario, ObjConta, Contabilizable:=False) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar."
|
||||
End If
|
||||
End If
|
||||
|
||||
'CANCELAR MOVIMIENTOS DE GARANTIA SI TIENE
|
||||
If Not ErrorCancelar AndAlso Not GenerarMovimientoGarantia(15, "Salida Garantía", ClsPaginas.NowADS(), ObjRemision, ObjAcum, ObjInventario, ObjConta) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
'CANCELA LOS FOLIOS DE GARANTIA
|
||||
If Not ErrorCancelar AndAlso Not ObjAcum.UpdateGarantiaCancelacion(ObjRemision.CveVenta) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al actualizar la garantía"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
If DtDevRemision IsNot Nothing Then
|
||||
DtDevRemision.Dispose()
|
||||
End If
|
||||
|
||||
'CANCELAR MOVIMIENTOS DE GARANTIA SI TIENE
|
||||
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If Not GenerarMovimientoGarantia(15, "Salida Garantía", ClsPaginas.NowADS(), ObjRemision, ObjAcum, ObjInventario, ObjConta) Then
|
||||
ErrorCancelar = True
|
||||
If DtDevMovs IsNot Nothing Then
|
||||
DtDevMovs.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
'CANCELA LOS FOLIOS DE GARANTIA
|
||||
If Not ErrorCancelar Then
|
||||
If Not ObjAcum.UpdateGarantiaCancelacion(ObjRemision.CveVenta) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al actualizar la garantía"
|
||||
End If
|
||||
End If
|
||||
|
||||
If DtDevRemision IsNot Nothing Then
|
||||
DtDevRemision.Dispose()
|
||||
End If
|
||||
|
||||
If DtDevMovs IsNot Nothing Then
|
||||
DtDevMovs.Dispose()
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cargar los datos de la remisión. Por favor vuelva a intentar."
|
||||
End If
|
||||
|
||||
If ObjRemision IsNot Nothing Then
|
||||
@@ -6978,7 +6987,7 @@ Namespace Modelos
|
||||
Dim SeCancela As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = DrMovtos("CveRem").ToString.ToEntero()))
|
||||
|
||||
If Not SeCancela Then
|
||||
Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa)
|
||||
Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDTDetalle:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=True)
|
||||
'SI LA REMISION ESTA SALDADA DEBE REVIVIR LOS MOVIMIENTOS COMPLETAMENTE O PARCIALMENTE
|
||||
If ObjRem.SaldoAlmacen >= 0 Then
|
||||
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||
|
||||
@@ -112,12 +112,25 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
FI = context.Request("start").ToDate
|
||||
FF = context.Request("end").ToDate
|
||||
|
||||
If Not GetContratos(context:=context) Then
|
||||
'Convierte el objeto de Eventos en JSON
|
||||
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
|
||||
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
|
||||
If Not GetContratos(context:=context) Then
|
||||
'Convierte el objeto de Eventos en JSON
|
||||
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
|
||||
|
||||
|
||||
'Dim settings As New Newtonsoft.Json.JsonSerializerSettings With {
|
||||
' .NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
|
||||
' .Formatting = Newtonsoft.Json.Formatting.None
|
||||
' }
|
||||
'Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events, settings)
|
||||
'context.Response.Write(sJSON)
|
||||
|
||||
Dim serializer As New Newtonsoft.Json.JsonSerializer()
|
||||
Using writer As New IO.StringWriter()
|
||||
serializer.Serialize(writer, events)
|
||||
context.Response.Write(writer.ToString())
|
||||
End Using
|
||||
|
||||
|
||||
context.Response.Write(sJSON)
|
||||
End If
|
||||
End If
|
||||
Exit Select
|
||||
|
||||
@@ -965,7 +965,7 @@ Partial Class Bancos_Creditos
|
||||
If CveCredito > 0 Then
|
||||
If ObjCredito.UpdateCreditos(CveCredito, DdlTipoCredito.SelectedValue.ToEntero, TxtReferencia.Text, TxtObservaciones.Text, -1, -1, -1, DdlTipoMoneda.SelectedValue.ToEntero, TxtFechaInicio.Text.ToString.ToDate, FechaVencimiento, TxtTasa.Text.Trim.ToDouble, TxtSobreTasa.Text.Trim.ToDouble, TxtIVA.Text.ToDouble / 100,
|
||||
TxtPlazo.Text.Trim.ToEntero, -1, TxtVehiculoValor.Text.ToString.ToDouble, TxtComisionValor.Text.ToString.ToDouble, TxtSeguroMensual.Text.ToString.ToDouble, TxtOtrosGastosValor.Text.ToString.ToDouble,
|
||||
DdlProveedores.SelectedValue.ToEntero, RBLClasificacionContable.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False),
|
||||
DdlProveedores.SelectedValue.ToEntero, RBLClasificacionContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False),
|
||||
CreditoAnticipo:=TxtVehiculoAnticipo.Text.ToDouble, ComisionAnticipo:=TxtComisionAnticipo.Text.ToDouble, SeguroAnticipo:=TxtSeguroAnticipo.Text.ToDouble, OtrosGastosAnticipo:=TxtOtrosGastosAnticipo.Text.ToDouble, FondoGarantia:=TxtFondoGarantia.Text.ToDouble, SeguroValor:=TxtSeguroValor.Text.ToDouble, TipoInteres:=ChkTipoInteres.Checked) Then
|
||||
|
||||
If RegeneraTablaAmortizacion Then
|
||||
|
||||
@@ -29,25 +29,28 @@ Partial Class Bancos_DepositosCaja
|
||||
TxtIVA.Attributes.Add("onKeyUp", "txtSumaIVA(this);")
|
||||
TxtComisionIntermediario.Attributes.Add("onKeyUp", "txtSumaTntermediario(this);")
|
||||
|
||||
|
||||
CargaCuentas()
|
||||
ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
|
||||
ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then 'quita la opción de todos
|
||||
DdlTipoDeposito.Items.Remove("-1")
|
||||
End If
|
||||
|
||||
CargaCuentas()
|
||||
ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
|
||||
ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
|
||||
ChkIntermediario.Attributes.Add("onclick", "CheckIntermediario(this);")
|
||||
ChkCuentaRetorno.Attributes.Add("onclick", "CheckRowCuenta(this);")
|
||||
BtnConsultar.Attributes.Add("onclick", "Consultar(this);")
|
||||
BtnDepositar.Attributes.Add("onclick", "Depositar(this);")
|
||||
|
||||
ChkCuentaRetorno.Attributes.Add("onclick", "CheckRowCuenta(this);")
|
||||
BtnConsultar.Attributes.Add("onclick", "Consultar(this);")
|
||||
BtnDepositar.Attributes.Add("onclick", "Depositar(this);")
|
||||
|
||||
'Dim StrEncriptPrueba As String = Encripta($"OP=DC&CveIE={2784391}&CuentaCaja={"TestCuantaCaja"}&CuentaDepo={"Test cuenta"}")
|
||||
'HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={StrEncriptPrueba}"
|
||||
|
||||
'HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={StrEncriptPrueba}"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 189 Then
|
||||
If DdlTipoPago.Items.FindByValue("-1") IsNot Nothing Then
|
||||
DdlTipoPago.Items.Remove(DdlTipoPago.Items.FindByValue("-1"))
|
||||
If DdlTipoPago.Items.FindByValue("-1") IsNot Nothing Then
|
||||
DdlTipoPago.Items.Remove(DdlTipoPago.Items.FindByValue("-1"))
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentas()
|
||||
|
||||
@@ -8,8 +8,7 @@ Imports Ionic.Zip
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Bancos_PagoElectronicoGrupos
|
||||
Inherits ClsPaginas
|
||||
Private Shared missing As Object = System.Reflection.Missing.Value
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property HeaderTexto As String
|
||||
|
||||
@@ -3502,7 +3502,7 @@ Partial Class Compras_Compras
|
||||
|
||||
ViewState("CveProveedor") = ObjProveedor.CveProveedor
|
||||
ViewState("CveTipoProveedor") = ObjProveedor.CveTipoProveedor
|
||||
|
||||
RFCProveedor = ObjProveedor.RFC
|
||||
If ObjProveedor.CveTipoProveedor = 2 Then
|
||||
LblProveedor.Text = "Acreedor:"
|
||||
Else
|
||||
@@ -13318,10 +13318,11 @@ Partial Class Compras_Compras
|
||||
dtt = dtt.FiltraParametros($"Fecha >= #{NowADS.AddMonths(-12).ToString("yyyy/MM/dd")}#")
|
||||
End If
|
||||
DDLDevolucion.DataSource = dtt
|
||||
DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
End If
|
||||
objcompras.Dispose()
|
||||
DDLDevolucion.DataBind()
|
||||
DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
UPDevolucion.Update()
|
||||
|
||||
End Sub
|
||||
@@ -14242,6 +14243,7 @@ Partial Class Compras_Compras
|
||||
HdnVCveOC.Value = ""
|
||||
HdnCveEstatusOC.Value = ""
|
||||
|
||||
Dim tmpPorcentajeProntoPago As Decimal = 0
|
||||
Dim OC As New ClsOC
|
||||
If PopUpOC Then
|
||||
Dim ArrayCveOC As String() = CvesOC.Split(New Char() {","c})
|
||||
@@ -14252,6 +14254,7 @@ Partial Class Compras_Compras
|
||||
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
|
||||
EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0)
|
||||
MetodoPagoOC = OC.DtResultados.Rows(0)("MetodoPagoOC").ToString.ToEntero
|
||||
tmpPorcentajeProntoPago = OC.DtResultados.Rows(0)("PorcentajeProntoPago").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -14268,6 +14271,11 @@ Partial Class Compras_Compras
|
||||
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
|
||||
EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0)
|
||||
MetodoPagoOC = OC.DtResultados.Rows(0)("MetodoPagoOC").ToString.ToEntero
|
||||
|
||||
If tmpPorcentajeProntoPago = 0 Then
|
||||
tmpPorcentajeProntoPago = OC.DtResultados.Rows(0)("PorcentajeProntoPago").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -14281,6 +14289,11 @@ Partial Class Compras_Compras
|
||||
PopUpOC = False
|
||||
|
||||
|
||||
If tmpPorcentajeProntoPago > 0 Then
|
||||
PorcentajeProntoPago = tmpPorcentajeProntoPago
|
||||
End If
|
||||
|
||||
|
||||
If HdnVCveOC.Value <> "" Then
|
||||
If HdnCveEstatusOC.Value = "" Then
|
||||
Alert("No se tiene especificado el siguiente estatus de la Orden(es) de Compra. Por favor verifique los estatus y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -20933,7 +20946,7 @@ Partial Class Compras_Compras
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2") Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1") Then
|
||||
|
||||
If Opcion = 1 Or OCVinculada Or DdlTipoComprobante.SelectedValue <> "Fac" Then
|
||||
Return True
|
||||
|
||||
@@ -412,7 +412,7 @@ Partial Class Contratos_Presupuestos
|
||||
CveConceptoContableNom = CveAgrupador
|
||||
End If
|
||||
|
||||
If CveClasificacion > 0 Then
|
||||
If CveClasificacion > 0 Or CveConceptoContableNom > 0 Then
|
||||
If ImporteClasi > 0 Then
|
||||
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle, CveConceptoContableNom:=CveConceptoContableNom)
|
||||
If TieneError Then
|
||||
|
||||
19
OC/OC.aspx
19
OC/OC.aspx
@@ -477,6 +477,25 @@
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="TrDescuentoEscalonado" runat="server" visible="false">
|
||||
<td><b>Descuento:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtDescuentoEscalonado" runat="server" Width="100px" Height="28px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuentoEscalonado" ValidChars="1234567890+" />
|
||||
<asp:Button runat="server" ID="BtnDescuenEscalonado" Text="Aplicar" CssClass="btn btn-primary" OnClick="BtnDescuenEscalonado_Click" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="TrDescuentoProntoPago" runat="server" visible="false">
|
||||
<td><b>Descuento Pronto Pago:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="100px" Height="28px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -6,6 +6,7 @@ Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Ajax.Utilities
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Partial Class OC_OC
|
||||
@@ -964,6 +965,11 @@ Partial Class OC_OC
|
||||
DdlSubProyectoGral.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
TrDescuentoEscalonado.Visible = True
|
||||
TrDescuentoProntoPago.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
MostrarUsuarioAsignado()
|
||||
@@ -1521,6 +1527,8 @@ Partial Class OC_OC
|
||||
TxtNumRemision.Text = objOC.NumRemision
|
||||
NumeroRemisionOriginal = objOC.NumRemision
|
||||
|
||||
TxtPorcentajeProntoPago.Text = (100 * objOC.PorcentajeProntoPago).ToString("###.00")
|
||||
|
||||
If Not IsNothing(objOC.Tipo) Then
|
||||
|
||||
Select Case objOC.Tipo.ToUpper
|
||||
@@ -2709,6 +2717,11 @@ Partial Class OC_OC
|
||||
Dim LugarEntrega As String = If(txtLugarEntrega.Text.Trim = "", "-1", txtLugarEntrega.Text.Trim)
|
||||
LugarEntrega = If(DivLugarEntrega1.Visible, LugarEntrega, If(TxtLugarEntregaDirecta.Visible, TxtLugarEntregaDirecta.Text.Trim, ""))
|
||||
|
||||
Dim PorcentajeProntoPago As Decimal = 0
|
||||
If TxtPorcentajeProntoPago.Text.ToDecimal > 0 Then
|
||||
PorcentajeProntoPago = TxtPorcentajeProntoPago.Text.ToDecimal / 100
|
||||
End If
|
||||
|
||||
'GUARDA'
|
||||
If EsNuevo Then
|
||||
|
||||
@@ -2753,7 +2766,7 @@ Partial Class OC_OC
|
||||
RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal,
|
||||
RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim,
|
||||
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
|
||||
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
|
||||
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
|
||||
|
||||
CveOrdenCompraPadre = OC.CveOrdenCompra
|
||||
If CveOrdenCompraPadre > 0 Then
|
||||
@@ -2795,7 +2808,8 @@ Partial Class OC_OC
|
||||
RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1),
|
||||
CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
|
||||
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
|
||||
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
|
||||
PorcentajeProntoPago:=PorcentajeProntoPago) Then
|
||||
CveOrdenCompra = OC.CveOrdenCompra
|
||||
CveEstatus = CboE.SelectedValue.ToEntero
|
||||
|
||||
@@ -2978,7 +2992,8 @@ Partial Class OC_OC
|
||||
LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero,
|
||||
DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1),
|
||||
Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto,
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
|
||||
PorcentajeProntoPago:=PorcentajeProntoPago) Then
|
||||
If CveProveedorOriginal <> CveProveedor Then
|
||||
If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then
|
||||
TieneError = True
|
||||
@@ -3403,8 +3418,16 @@ Partial Class OC_OC
|
||||
' Exit Function
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
If TipoOS Then Return False
|
||||
|
||||
|
||||
Dim PorcentajeProntoPago As Decimal = 0
|
||||
If TxtPorcentajeProntoPago.Text.ToDecimal > 0 Then
|
||||
PorcentajeProntoPago = TxtPorcentajeProntoPago.Text.ToDecimal / 100
|
||||
End If
|
||||
|
||||
Dim CveCotizacion As Integer = 0
|
||||
Dim CveColectiva As Integer = 0
|
||||
Dim HuboError As Boolean = False
|
||||
@@ -3452,7 +3475,7 @@ Partial Class OC_OC
|
||||
PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
|
||||
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal,
|
||||
CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
|
||||
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
|
||||
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
|
||||
|
||||
'CREA POLIZA POR CADA PROVEEDOR
|
||||
|
||||
@@ -3528,7 +3551,7 @@ Partial Class OC_OC
|
||||
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
|
||||
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
|
||||
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
|
||||
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
|
||||
|
||||
|
||||
'USA AC
|
||||
@@ -4237,14 +4260,14 @@ Partial Class OC_OC
|
||||
If CvePresupuesto > 0 And Autorizado > 0 Then
|
||||
Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado
|
||||
If Diferencia > 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{SubProyecto}</b> y la clasificación <b>{Clasificacion}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible:<br/> - Subproyecto <b>{SubProyecto}</b> <br/> - Clasificación <b>{Clasificacion}</b> <br/> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Agarra el nuevo AF si se modifico o deja el pasado
|
||||
CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
|
||||
'Agarra el nuevo AF si se modifico o deja el pasado
|
||||
CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
|
||||
Codigo = If(gvr.FCHiddenField("HdnCodigoAF").Value <> "-1", gvr.FCHiddenField("HdnCodigoAF").Value, HdnEditCodigo.Value)
|
||||
|
||||
HdnEditCveActivoFijo.Value = ""
|
||||
@@ -9289,5 +9312,65 @@ Partial Class OC_OC
|
||||
UPPDetalle.Update()
|
||||
CargaFolios()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnDescuenEscalonado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim descuentoParts As String() = TxtDescuentoEscalonado.Text.Split("+"c)
|
||||
|
||||
|
||||
For Each dRow As DataRow In DtDetalle.Rows
|
||||
|
||||
Dim PU As Decimal = dRow("Importe").ToString.ToDecimal
|
||||
Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
|
||||
Dim IVAPorcentaje As Decimal = dRow("IVAPorcentaje").ToString.ToDecimal
|
||||
Dim IEPSPSPorcentaje As Decimal = dRow("IEPSPSPorcentaje").ToString.ToDecimal
|
||||
Dim IEPSPSIVAPorcentaje As Decimal = dRow("IEPSPSIVAPorcentaje").ToString.ToDecimal
|
||||
Dim RetIVAPorcentaje As Decimal = dRow("RetIVAPorcentaje").ToString.ToDecimal
|
||||
Dim RetISRPorcentaje As Decimal = dRow("RetISRPorcentaje").ToString.ToDecimal
|
||||
|
||||
Dim TotalTemp As Decimal = (PU * Cantidad)
|
||||
Dim Descuento As Decimal = 0
|
||||
If descuentoParts.Length = 0 Then
|
||||
Descuento = 0
|
||||
Else
|
||||
|
||||
For i As Integer = 0 To descuentoParts.Length - 1
|
||||
Dim descuentoPart As Decimal = descuentoParts(i).Trim().ToDecimal
|
||||
If descuentoPart > 0 Then
|
||||
Descuento = Descuento + ((TotalTemp - Descuento) * (descuentoPart / 100))
|
||||
Else
|
||||
Continue For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Dim Total As Decimal = If(PU > 0, (PU * Cantidad) - Descuento, 0)
|
||||
|
||||
dRow("Descuento") = Descuento
|
||||
dRow("Total") = Total
|
||||
dRow("IEPSPS") = Math.Round(IEPSPSPorcentaje * Total, 2)
|
||||
dRow("IEPSPSIVA") = Math.Round(IEPSPSIVAPorcentaje * Total, 2)
|
||||
|
||||
dRow("IVA") = Math.Round(IVAPorcentaje * Total, 2)
|
||||
|
||||
dRow("RetIVA") = (RetIVAPorcentaje * Total).RoundSQL(2)
|
||||
dRow("RetISR") = (RetISRPorcentaje * Total).RoundSQL(2)
|
||||
|
||||
|
||||
Next
|
||||
|
||||
DtDetalle.AcceptChanges()
|
||||
|
||||
CalculaGenerales()
|
||||
|
||||
GvD.DataSource = DtDetalle
|
||||
GvD.DataBind()
|
||||
|
||||
UpIvas.Update()
|
||||
UPPDetalle.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ Partial Class RepContratoDetalle
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & ".pdf")
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & $"{File.Extension}")
|
||||
Response.AddHeader("Content-Length", File.Length.ToString())
|
||||
'Response.ContentType = "text/plain"
|
||||
Response.ContentType = "application/octet-stream"
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
<label class="col-md-4">Observaciones:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtObservaciones" runat="server" Width="100%" TextMode="MultiLine"
|
||||
Rows="2"></asp:TextBox>
|
||||
Rows="6"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -127,13 +127,14 @@
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="10%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="D.Venc" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
|
||||
<asp:HyperLinkField DataTextField="FacturaAplicada" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="UsuarioAutorizo" HeaderText="Autorizó" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" HeaderText="Autorizar/Rechazar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea autorizar el limite?" data-btn-ok-label="si" ID="LnkAutorizar" OnClick="LnkAutorizar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-check'></i>"></asp:LinkButton>
|
||||
|
||||
@@ -263,7 +263,7 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
End If
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.AutorizacionLimitesUpdate(CveAutorizacion, CveCliente, CveVendedor, Importe, CveEstatusAutorizacion) Then
|
||||
If ObjVentas.AutorizacionLimitesUpdate(CveAutorizacion, CveCliente, CveVendedor, Importe, CveEstatusAutorizacion, UsuarioActual.CveUsuario) Then
|
||||
Alert("El límite de crédito fue autorizado.")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
@@ -280,7 +280,7 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
Dim CveEstatusAutorizacion As Integer = 3
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.AutorizacionLimitesUpdate(CveAutorizacion, CveCliente, CveVendedor, Importe, CveEstatusAutorizacion) Then
|
||||
If ObjVentas.AutorizacionLimitesUpdate(CveAutorizacion, CveCliente, CveVendedor, Importe, CveEstatusAutorizacion, UsuarioActual.CveUsuario) Then
|
||||
Alert("El límite de crédito fue rechazado.")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
@@ -59,19 +59,21 @@ Partial Class Ventas_CatPreciosLista
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtPrecioLista.Text = GvRow.DataKey("PrecioLista").ToString
|
||||
ChkPredeterminada.Checked = GvRow.DataKey("Predeterminada") = "True"
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
ChkRestringida.Checked = CBool(GvRow.DataKey("Restringuida"))
|
||||
chkEstatus.Checked = GvRow.DataKey("Estatus") = "True"
|
||||
ChkRestringida.Checked = GvRow.DataKey("Restringuida") = "True"
|
||||
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
|
||||
Using ObjVenta As New ClsVentas
|
||||
If ObjVenta.GetPreciosListasSubProyecto(CvePrecioLista, UsuarioActual.CveEmpresa) Then
|
||||
GvSubProyectos.DataSource = ObjVenta.DtResultados.Copy()
|
||||
End If
|
||||
End Using
|
||||
GvSubProyectos.DataBind()
|
||||
If divSP.Visible Then
|
||||
Using ObjVenta As New ClsVentas
|
||||
If ObjVenta.GetPreciosListasSubProyecto(CvePrecioLista, UsuarioActual.CveEmpresa) Then
|
||||
GvSubProyectos.DataSource = ObjVenta.DtResultados.Copy()
|
||||
End If
|
||||
End Using
|
||||
GvSubProyectos.DataBind()
|
||||
End If
|
||||
|
||||
UpBodyCo.Update()
|
||||
UpFooter.Update()
|
||||
|
||||
@@ -924,6 +924,7 @@
|
||||
<asp:HiddenField ID="HdnPagado" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr align="left">
|
||||
<td><b>Estatus:</b> </td>
|
||||
<td>
|
||||
@@ -933,6 +934,13 @@
|
||||
<a class="btn default" style="display: none;" data-toggle="modal" href="#Aceptar">Aceptada</a>
|
||||
<asp:ImageButton ID="ImgGuardaEstatus" runat="server" ClientIDMode="Static" ImageUrl="/Imagenes/accept.png" Style="display: none;" />--%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left" id="TrMotivoCancelacion" visible="false" runat="server" >
|
||||
<td style="vertical-align:top"><b>Mot. Canc.:</b> </td>
|
||||
<td>
|
||||
<asp:Label ID="LblMotivoCancelacion" runat="server"></asp:Label>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left" id="trContabilizada" runat="server" visible="False">
|
||||
<td><b>Contabilizada:</b></td>
|
||||
@@ -4298,8 +4306,8 @@
|
||||
<asp:LinkButton ID="BtnAdjuntar" runat="server" Visible="false" Text="<i class='fa-upload fa' style=' color: white;'></i> Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
|
||||
<br />
|
||||
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
|
||||
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar el archivo?" data-btn-ok-label="si" />
|
||||
|
||||
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar el archivo?" data-btn-ok-label="si" />
|
||||
|
||||
<asp:LinkButton ID="BtnReemplazarAdjunto" runat="server" Visible="false" AlternateText="Reemplazar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm blue" Text="<i class='fa-upload fa' style=' color: white;'></i>" data-toggle="modal" data-target="#ModalAdjuntar" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -5031,6 +5031,8 @@ Partial Class Ventas
|
||||
BtnEliminarAdjunto.Visible = True
|
||||
BtnAdjuntar.Visible = False
|
||||
BtnReemplazarAdjunto.Visible = True
|
||||
Else
|
||||
BtnReemplazarAdjunto.Visible = True
|
||||
End If
|
||||
|
||||
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
|
||||
@@ -5080,6 +5082,12 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If CveEstatus = 5 Then
|
||||
TrMotivoCancelacion.Visible = True
|
||||
LblMotivoCancelacion.Text = DbRowVenta("MotivoCancelacion").ToString()
|
||||
End If
|
||||
|
||||
If DbRowVenta("CveVentaRelacionada").ToString().ToEntero() > 0 Then
|
||||
TrRefacturadaa.Visible = True
|
||||
HplRefacturadaEn.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", DbRowVenta("CveVentaRelacionada"))
|
||||
@@ -14101,6 +14109,11 @@ Partial Class Ventas
|
||||
CveMotivoDevolucion = DdlMotivoDevolucion.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
'FIX. ESTA VARIABLE NO DEBE TENER DATOS CUANDO ES FACTURA DE INGRESO, AFECTA LOS MOVIMIENTOS DE ALMACEN
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso factura.TipoDocto = "Ing" And CveAlmacenTraspasoDestino > 0 Then
|
||||
CveAlmacenTraspasoDestino = -1
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
|
||||
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
|
||||
@@ -15366,7 +15379,7 @@ Partial Class Ventas
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, importeMovimiento * tipoCambio, ConceptoContable, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, importeMovimiento * tipoCambio, ConceptoContable, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToString().ToEntero(), CveCliente:=row2.DataKey("CveCliente").ToString().ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
@@ -16629,6 +16642,7 @@ Partial Class Ventas
|
||||
TipoDoctoVistaPrevia = "Ing"
|
||||
End If
|
||||
|
||||
CalculaTotalesVenta(RecalculaImpuestosLocales:=False, RecalcularTotalOriginal:=False)
|
||||
CreaObjetosVenta(True, TipoDoctoVistaPrevia:=TipoDoctoVistaPrevia)
|
||||
|
||||
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
|
||||
@@ -29623,11 +29637,7 @@ Partial Class Ventas
|
||||
GvImpuestosLocales2.DataSource = ObjVentas.DtResultados
|
||||
GvImpuestosLocales2.DataBind()
|
||||
|
||||
If (NuevaFactura = 1) Then
|
||||
GvImpuestosLocales2.Enabled = True
|
||||
Else
|
||||
GvImpuestosLocales2.Enabled = False
|
||||
End If
|
||||
GvImpuestosLocales2.Enabled = True
|
||||
GvImpuestosLocales2.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user