Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2204,6 +2204,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim UsaComplementariaClientes As Boolean = True
|
Dim UsaComplementariaClientes As Boolean = True
|
||||||
|
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
|
||||||
|
|
||||||
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
||||||
Dim dtt As DataTable = ObjConta.DtResultados
|
Dim dtt As DataTable = ObjConta.DtResultados
|
||||||
@@ -3797,6 +3798,18 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
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")
|
||||||
|
If CveMovimientoSalida > 0 Then
|
||||||
|
|
||||||
|
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return OcurrioError
|
Return OcurrioError
|
||||||
@@ -4058,6 +4071,129 @@ Namespace Modelos
|
|||||||
'Return Not OcurrioError
|
'Return Not OcurrioError
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function GenerarMovimientoAlmacenServicioDomicilio(ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura, DtInventario As DataTable, CveAlmacen As Integer, CveConcepto As Integer, CveMoneda As Integer, CveVenta As Integer, Modulo As String, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1) As Integer
|
||||||
|
Dim OcurrioError As Boolean = False
|
||||||
|
|
||||||
|
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConcepto, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:=Modulo, CveMovimientoRelacionado:=CveMovimientoRelacionado)
|
||||||
|
|
||||||
|
If CveMovimientoInventario <= 0 Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||||
|
Else
|
||||||
|
Dim Mensaje As String = ""
|
||||||
|
Dim i As Integer = 0
|
||||||
|
Dim Cantidad As Double
|
||||||
|
Dim CveUnidad As Integer
|
||||||
|
Dim CveProducto As Integer
|
||||||
|
Dim Existencia As Double
|
||||||
|
'Dim Pu As Double
|
||||||
|
'DtInv.Clone()
|
||||||
|
|
||||||
|
Dim DtEquivalencias As DataTable
|
||||||
|
For Each Dr As DataRow In DtInventario.Rows
|
||||||
|
CveProducto = Dr("CvePS").ToString.ToEntero
|
||||||
|
CveUnidad = Dr("CveUM").ToString.ToEntero
|
||||||
|
Cantidad = Dr("Cantidad").ToString.ToDouble
|
||||||
|
|
||||||
|
If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Se deben especificar las Series de los productos de almacén")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then
|
||||||
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||||
|
If Existencia < Cantidad Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa = 1 Then
|
||||||
|
DtEquivalencias = New DataTable
|
||||||
|
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
|
||||||
|
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
|
||||||
|
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
|
||||||
|
|
||||||
|
'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
|
||||||
|
If CveUnidadBase <> CveUnidad Then
|
||||||
|
' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
|
||||||
|
Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble
|
||||||
|
CveUnidad = CveUnidadBase
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveProducto > 0 Then
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
i = i + 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN
|
||||||
|
If MovimientoPrePoliza AndAlso Not OcurrioError Then
|
||||||
|
Dim DtCostos As DataTable = Nothing
|
||||||
|
Dim ValorInventario As Decimal = 0
|
||||||
|
Dim TotalCosto As Decimal = 0
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
|
||||||
|
DtCostos = ObjInventario.DtResultados
|
||||||
|
TotalCosto = DtCostos.SUMD("Total").RoundSQL()
|
||||||
|
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
|
Dim IdCtaContable As Integer = 0
|
||||||
|
Dim CveCuenta As Integer = 0
|
||||||
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
|
Dim cont As Integer = 1
|
||||||
|
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||||
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
|
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
|
||||||
|
TotalCostoAcumulado += ValorInventario
|
||||||
|
|
||||||
|
'cuando es el último movimiento y hay diferencias en los importes
|
||||||
|
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
|
||||||
|
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString)
|
||||||
|
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
|
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
|
If ValorInventario <> 0 Then
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, False, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
cont += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero
|
||||||
|
|
||||||
|
If TotalCosto <> 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, True, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
factura.Inv_CveMovimiento = CveMovimientoInventario
|
||||||
|
factura.Inv_ValorInventario = ValorInventario
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return CveMovimientoInventario
|
||||||
|
End Function
|
||||||
Private Sub GuardarVentaEstimaciones(ByRef factura As Modelos.Factura, ObjContr As ClsContratos)
|
Private Sub GuardarVentaEstimaciones(ByRef factura As Modelos.Factura, ObjContr As ClsContratos)
|
||||||
'debe de ser por contrato el movimiento
|
'debe de ser por contrato el movimiento
|
||||||
If factura.CveContratoSecciones.Length > 0 Then
|
If factura.CveContratoSecciones.Length > 0 Then
|
||||||
@@ -5785,6 +5921,7 @@ Namespace Modelos
|
|||||||
Public Property CvePedido2 As Integer = -1
|
Public Property CvePedido2 As Integer = -1
|
||||||
Public Property CveAlmacenTraspasoOrigen As Integer = -1
|
Public Property CveAlmacenTraspasoOrigen As Integer = -1
|
||||||
Public Property CveAlmacenTraspasoDestino As Integer = -1
|
Public Property CveAlmacenTraspasoDestino As Integer = -1
|
||||||
|
Public Property CveAlmacenServicioDomicilio As Integer = -1
|
||||||
Public Property EsDevolucionVenta As Integer = -1
|
Public Property EsDevolucionVenta As Integer = -1
|
||||||
Public Property EsInterno As Integer = -1
|
Public Property EsInterno As Integer = -1
|
||||||
Public Property CveEmpresaCRM As Integer = -1
|
Public Property CveEmpresaCRM As Integer = -1
|
||||||
|
|||||||
@@ -4382,186 +4382,185 @@ Partial Class Bancos_IE
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Banc As New ClsBancos
|
|
||||||
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL())
|
|
||||||
|
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
|
||||||
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjAC.IniciaTransacSQL()
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Dim ErrorCancelar = False
|
Dim ErrorCancelar = False
|
||||||
Dim MensajeError = ""
|
Dim MensajeError = ""
|
||||||
Dim IdPolizaNueva = -1
|
Dim IdPolizaNueva = -1
|
||||||
Dim FolioPolizaNueva = -1
|
Dim FolioPolizaNueva = -1
|
||||||
|
|
||||||
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then
|
Dim Banc As New ClsBancos
|
||||||
|
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL())
|
||||||
|
|
||||||
If ObjAC Is Nothing Then
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
|
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
||||||
|
Try
|
||||||
|
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
ObjAC.IniciaTransacSQL()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al iniciar la contabilización", ex)
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
End Try
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
End If
|
||||||
Dim dt As DataTable
|
|
||||||
If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
|
|
||||||
dt = ObjAC.DtResultados
|
|
||||||
|
|
||||||
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
|
Try
|
||||||
If dt.Rows(0)("FechaPol").ToString.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then
|
||||||
IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaCancelacion.Text.ToDate)
|
|
||||||
If IdPolizaNueva > 0 Then
|
|
||||||
FolioPolizaNueva = ObjAC.Folio
|
|
||||||
|
|
||||||
'CREA POLIZA NEGATIVA
|
If ObjAC Is Nothing Then
|
||||||
For Each dr As DataRow In dt.Rows
|
ErrorCancelar = True
|
||||||
If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaCancelacion.Text.ToDate, "") Then
|
End If
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al crear poliza negativa"
|
If Not ErrorCancelar Then
|
||||||
Exit For
|
Dim dt As DataTable
|
||||||
|
If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
|
||||||
|
dt = ObjAC.DtResultados
|
||||||
|
|
||||||
|
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
|
||||||
|
If dt.Rows(0)("FechaPol").ToString.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
||||||
|
IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaCancelacion.Text.ToDate)
|
||||||
|
If IdPolizaNueva > 0 Then
|
||||||
|
FolioPolizaNueva = ObjAC.Folio
|
||||||
|
|
||||||
|
'CREA POLIZA NEGATIVA
|
||||||
|
For Each dr As DataRow In dt.Rows
|
||||||
|
If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaCancelacion.Text.ToDate, "") Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al crear poliza negativa"
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
'AJUSTA POLIZA
|
||||||
|
If Not ErrorCancelar Then
|
||||||
|
If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al ajustar poliza negativa"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
|
||||||
|
|
||||||
'AJUSTA POLIZA
|
'CANCELA IE
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
|
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al cancelar IE"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
|
If ObjAC.RemovePoliza(IDPoliza) Then
|
||||||
|
If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Error al ajustar poliza negativa"
|
MensajeError = "Error al desvincular poliza."
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al eliminar poliza."
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorCancelar Then
|
||||||
|
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al desbloquear prepoliza."
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'CANCELA IE
|
'CANCELA IE
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Error al cancelar IE"
|
MensajeError = "Error al cancelar IE"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
MensajeError = "Error al contabilizar poliza"
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al obtener la poliza"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjAC.RemovePoliza(IDPoliza) Then
|
Else
|
||||||
If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al desvincular poliza."
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al eliminar poliza."
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
||||||
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
Dim GeneraCancelacionEnCero As Boolean = False
|
||||||
ErrorCancelar = True
|
If TxtFechaCancelacion.Text.ToDate <= TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero
|
||||||
MensajeError = "Error al desbloquear prepoliza."
|
GeneraCancelacionEnCero = True
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
'CANCELA IE
|
Dim TipoMovimiento As Integer = 1
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar IE"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
|
||||||
ErrorCancelar = True
|
GeneraCancelacionEnCero = False
|
||||||
MensajeError = "Error al contabilizar poliza"
|
TipoMovimiento = 2
|
||||||
End If
|
End If
|
||||||
|
Dim CvePrePolizaCancelacion As Integer = 0
|
||||||
|
|
||||||
|
If Not GeneraCancelacionEnCero Then
|
||||||
|
'CANCELA IE MES ANTERIOR
|
||||||
|
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
||||||
|
If CvePrePolizaCancelacion <= 0 Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al cancelar IE MES ANTERIOR"
|
||||||
|
Else
|
||||||
|
'DEBE GENERAR UNA NUEVA POLIZA
|
||||||
|
IDPoliza = -1
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorCancelar = True
|
'CANCELA IE MES ACTUAL
|
||||||
MensajeError = "Error al obtener la poliza"
|
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
||||||
|
If CvePrePolizaCancelacion <= 0 Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al cancelar IE MES ACTUAL"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
||||||
|
|
||||||
' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then
|
||||||
Dim GeneraCancelacionEnCero As Boolean = False
|
ErrorCancelar = True
|
||||||
If TxtFechaCancelacion.Text.ToDate <= TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero
|
MensajeError = "Error al contabilizar poliza"
|
||||||
GeneraCancelacionEnCero = True
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
Dim TipoMovimiento As Integer = 1
|
|
||||||
|
|
||||||
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
|
|
||||||
GeneraCancelacionEnCero = False
|
|
||||||
TipoMovimiento = 2
|
|
||||||
End If
|
|
||||||
Dim CvePrePolizaCancelacion As Integer = 0
|
|
||||||
|
|
||||||
If Not GeneraCancelacionEnCero Then
|
|
||||||
'CANCELA IE MES ANTERIOR
|
|
||||||
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
|
||||||
If CvePrePolizaCancelacion <= 0 Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar IE MES ANTERIOR"
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
'CANCELA IE MES ACTUAL
|
|
||||||
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
|
||||||
If CvePrePolizaCancelacion <= 0 Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar IE MES ACTUAL"
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
|
||||||
|
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al contabilizar poliza"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
||||||
If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
|
If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
|
||||||
If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
|
If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar complemento de pago"
|
|
||||||
Else
|
|
||||||
Dim FolioCancelado = $"{TxtFolio.Text}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
|
|
||||||
If Not Banc.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then
|
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Error al actualizar complemento de pago"
|
MensajeError = "Error al cancelar complemento de pago"
|
||||||
|
Else
|
||||||
|
Dim FolioCancelado = $"{TxtFolio.Text}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
|
||||||
|
If Not Banc.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al actualizar complemento de pago"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
|
|
||||||
Dim ErrorCancelarComplemento As Boolean = True
|
Dim ErrorCancelarComplemento As Boolean = True
|
||||||
|
|
||||||
If CancelarComplemento Then
|
If CancelarComplemento Then
|
||||||
Dim ObjCancelacion As New Timbrado
|
Dim ObjCancelacion As New Timbrado
|
||||||
'Dim ObjBanco As New ClsBancos
|
'Dim ObjBanco As New ClsBancos
|
||||||
|
|
||||||
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||||
|
|
||||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||||
CargaComplementosPago()
|
|
||||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
|
||||||
ErrorCancelarComplemento = False
|
|
||||||
Alert("El complemento se cancelo correctamente.")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
|
||||||
|
|
||||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
|
||||||
CargaComplementosPago()
|
CargaComplementosPago()
|
||||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||||
ErrorCancelarComplemento = False
|
ErrorCancelarComplemento = False
|
||||||
@@ -4569,49 +4568,62 @@ Partial Class Bancos_IE
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||||
|
|
||||||
|
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||||
|
CargaComplementosPago()
|
||||||
|
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||||
|
ErrorCancelarComplemento = False
|
||||||
|
Alert("El complemento se cancelo correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
|
||||||
ErrorCancelarComplemento = False
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorCancelarComplemento Then
|
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
|
||||||
Banc.Commit()
|
|
||||||
Dim Msg As New StringBuilder
|
|
||||||
|
|
||||||
If CancelarComplemento Then
|
|
||||||
Msg.Append("El movimiento bancario y su complemento quedaron cancelados exitosamente.")
|
|
||||||
Else
|
Else
|
||||||
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
ErrorCancelarComplemento = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva)
|
If Not ErrorCancelarComplemento Then
|
||||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
|
|
||||||
|
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||||
|
Banc.Commit()
|
||||||
|
Dim Msg As New StringBuilder
|
||||||
|
|
||||||
|
If CancelarComplemento Then
|
||||||
|
Msg.Append("El movimiento bancario y su complemento quedaron cancelados exitosamente.")
|
||||||
|
Else
|
||||||
|
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva)
|
||||||
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
|
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||||
|
Banc.RollBack()
|
||||||
|
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
|
GuardaLog(MensajeError + " | CANCELAR IE")
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||||
Banc.RollBack()
|
Banc.RollBack()
|
||||||
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
GuardaLog(MensajeError + " | CANCELAR IE")
|
GuardaLog(MensajeError + " | CANCELAR IE")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrio un error al cancelar", ex)
|
||||||
Else
|
End Try
|
||||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
|
||||||
Banc.RollBack()
|
|
||||||
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
||||||
GuardaLog(MensajeError + " | CANCELAR IE")
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||||
Banc.Dispose()
|
Banc.Dispose()
|
||||||
@@ -6649,7 +6661,7 @@ Partial Class Bancos_IE
|
|||||||
GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'")
|
GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'")
|
||||||
|
|
||||||
DdlTipoTransaccionCancelacion.Items.Clear()
|
DdlTipoTransaccionCancelacion.Items.Clear()
|
||||||
DdlTipoTransaccionCancelacion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo ='{TipoMovto}'")
|
DdlTipoTransaccionCancelacion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo ='{TipoMovto}' AND Estatus = 1")
|
||||||
DdlTipoTransaccionCancelacion.DataBind()
|
DdlTipoTransaccionCancelacion.DataBind()
|
||||||
DdlTipoTransaccionCancelacion.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
DdlTipoTransaccionCancelacion.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
||||||
|
|
||||||
|
|||||||
@@ -583,8 +583,15 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
HLFolio.Text = DtDatos.Rows(0)("SerieFolio").ToString()
|
HLFolio.Text = DtDatos.Rows(0)("SerieFolio").ToString()
|
||||||
If UsuarioActual.TienePermisoProceso(201) Then
|
If UsuarioActual.TienePermisoProceso(201) Then
|
||||||
HLFolio.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={CveVenta}"
|
HLFolio.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={CveVenta}"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'filtra los Almacenes de domicilio
|
||||||
|
If DtDatos.Rows(0)("ServicioDomicilio").ToString() = "True" Then
|
||||||
|
StrAlmacenes = String.Format("{0} AND Almacen like '%Domicilio%' ", StrAlmacenes)
|
||||||
|
Else
|
||||||
|
StrAlmacenes = String.Format("{0} AND NOT (Almacen like '%Domicilio%') ", StrAlmacenes)
|
||||||
|
End If
|
||||||
|
|
||||||
LbObservaciones.Text = DtDatos.Rows(0)("Observaciones").ToString()
|
LbObservaciones.Text = DtDatos.Rows(0)("Observaciones").ToString()
|
||||||
LbObservacionesAlmacen.Text = DtDatos.Rows(0)("ObservacionesAlmacen").ToString()
|
LbObservacionesAlmacen.Text = DtDatos.Rows(0)("ObservacionesAlmacen").ToString()
|
||||||
CveVentaSurtir = CveVenta
|
CveVentaSurtir = CveVenta
|
||||||
@@ -3064,8 +3071,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Dim CveMovimientoEntrada As Integer
|
Dim CveMovimientoEntrada As Integer
|
||||||
Dim FolioEntrada As Integer
|
Dim FolioEntrada As Integer
|
||||||
Dim ErrorMovInv As Boolean
|
Dim ErrorMovInv As Boolean
|
||||||
Dim DtDetalle As New DataTable
|
Dim DtDetalle As New DataTable
|
||||||
Dim DtDetalleLote As New DataTable
|
|
||||||
Dim TextoError = ""
|
Dim TextoError = ""
|
||||||
|
|
||||||
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
|
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
|
||||||
@@ -3175,7 +3181,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
|
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
|
||||||
|
|
||||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
'DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
||||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
||||||
@@ -3183,17 +3189,17 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
|
'ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
|
||||||
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
' For Each Dr1 As DataRow In DtDetalleLote.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:="", Lote:=Dr1("Lote").ToString(), FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:="", Lote:=Dr1("Lote").ToString(), FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
' TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
Else 'NORMAL
|
Else 'NORMAL
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, -1, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, -1, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
||||||
Exit For
|
Exit For
|
||||||
@@ -3219,12 +3225,8 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If CveMovimientoEntrada > 0 Then
|
If CveMovimientoEntrada > 0 Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
Dim CveSeccionAlmacen As Integer = -1
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
'If CBool(Dr("AplicaSeccion")) Then
|
|
||||||
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
|
|
||||||
'Else
|
|
||||||
' CveSeccionAlmacen = -1
|
|
||||||
'End If
|
|
||||||
CveSeccionAlmacen = -3
|
CveSeccionAlmacen = -3
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UppEntrega" UpdateMode="Conditional">
|
<asp:UpdatePanel runat="server" ID="UppEntrega" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento, AplicaLote, AplicaCaducidad" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
|
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento, AplicaLote, AplicaCaducidad,PS" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||||
<%--<HeaderTemplate>
|
<%--<HeaderTemplate>
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false"></asp:TextBox>
|
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false" Style="text-align:right;"></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
GvD.Columns(6).Visible = ObjInv.DtResultados.MAX("Serie") <> ""
|
GvD.Columns(6).Visible = ObjInv.DtResultados.MAX("Serie") <> ""
|
||||||
GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("Lote") <> ""
|
GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("AplicaLote") = "True" 'MAX("Lote") <> ""
|
||||||
GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
|
GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("AplicaCaducidad") = "True" 'MAX("FechaCaducidad").ToDate > MinFecha
|
||||||
GvD.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
GvD.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||||
|
|
||||||
ObjInv.Dispose()
|
ObjInv.Dispose()
|
||||||
@@ -141,10 +141,11 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
Dim Lote As String = "-1"
|
Dim Lote As String = "-1"
|
||||||
Dim FechaCaducidad As Date = MinFecha
|
Dim FechaCaducidad As Date = MinFecha
|
||||||
If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie")
|
If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie")
|
||||||
If gvr.DataKey("Lote") <> "" Then Lote = gvr.DataKey("Lote")
|
If gvr.DataKey("AplicaLote") = "True" Then Lote = gvr.FCTextBox("TxtLote").Text ' gvr.DataKey("Lote")
|
||||||
If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
|
If gvr.DataKey("AplicaCaducidad") = "True" Then FechaCaducidad = gvr.FCTextBox("TxtFechaCaducidad").Text.todate ' gvr.DataKey("Lote")
|
||||||
|
'If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
|
||||||
|
|
||||||
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie, Lote, FechaCaducidad, gvr.DataKey("PS"))
|
||||||
If Not Valido Then
|
If Not Valido Then
|
||||||
Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia)
|
Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -273,7 +274,7 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean
|
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date, PS As String) As Boolean
|
||||||
Dim Retorno = True
|
Dim Retorno = True
|
||||||
|
|
||||||
Dim Inv As New ClsInventarios
|
Dim Inv As New ClsInventarios
|
||||||
@@ -283,9 +284,9 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
|
|
||||||
If Existencia - Cantidad < 0 Then
|
If Existencia - Cantidad < 0 Then
|
||||||
If Existencia < 0 Then
|
If Existencia < 0 Then
|
||||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("No hay existencia del producto: ", PS), TipoMensaje.MsgAdvertencia)
|
||||||
Else
|
Else
|
||||||
Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("Solo hay en existencia: {0} en el producto: {1}", Existencia, PS), TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -326,6 +326,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaInicial()
|
Private Sub CargaInicial()
|
||||||
|
ConsecutivoVenta = 0
|
||||||
CveMovimiento = -1
|
CveMovimiento = -1
|
||||||
CveMovimientoRelacionado = -1
|
CveMovimientoRelacionado = -1
|
||||||
TieneRelacionado = -1
|
TieneRelacionado = -1
|
||||||
@@ -2255,7 +2256,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
'VALIDA PROMOCIONES Y EXISTENCIAS
|
'VALIDA PROMOCIONES Y EXISTENCIAS
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
|
||||||
Me.ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
|
Me.ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
@@ -2573,8 +2574,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
Dim Obs As String = SbBCI.ToString()
|
Dim Obs As String = SbBCI.ToString()
|
||||||
|
|
||||||
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
|
If AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
|
||||||
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
|
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) Then
|
||||||
|
ConsecutivoVenta += 1
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -2966,6 +2970,9 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Dim CargoActual As Double = 0
|
Dim CargoActual As Double = 0
|
||||||
|
|
||||||
Dim Row As DataRow = Nothing
|
Dim Row As DataRow = Nothing
|
||||||
|
|
||||||
|
ConsecutivoVenta += 1
|
||||||
|
|
||||||
Row = TmpDTAjustes.NewRow
|
Row = TmpDTAjustes.NewRow
|
||||||
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
||||||
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
||||||
@@ -2981,7 +2988,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Row("TipoComprobante") = 1
|
Row("TipoComprobante") = 1
|
||||||
Row("Comprobante") = TxtPoliza.Text
|
Row("Comprobante") = TxtPoliza.Text
|
||||||
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
||||||
Row("ConsecutivoVenta") = TxtConsecutivoAjuste.Text.ToEntero()
|
Row("ConsecutivoVenta") = ConsecutivoVenta
|
||||||
Row("CvePS") = DdlPSAjuste.SelectedValue
|
Row("CvePS") = DdlPSAjuste.SelectedValue
|
||||||
Row("PS") = DdlPSAjuste.SelectedText
|
Row("PS") = DdlPSAjuste.SelectedText
|
||||||
Row("CveVenta") = -1
|
Row("CveVenta") = -1
|
||||||
|
|||||||
@@ -1938,8 +1938,9 @@
|
|||||||
|
|
||||||
<asp:Panel ID="PanelBloqueo" runat="server" CssClass="modalPopup" align="center" Style="display: none">
|
<asp:Panel ID="PanelBloqueo" runat="server" CssClass="modalPopup" align="center" Style="display: none">
|
||||||
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
|
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
|
||||||
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align:center">
|
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align: center">
|
||||||
<td colspan="2"><asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i> Acceso Restringido"/></td>
|
<td colspan="2">
|
||||||
|
<asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i> Acceso Restringido" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1"> </td>
|
<td colspan="1"> </td>
|
||||||
@@ -1950,7 +1951,7 @@
|
|||||||
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
||||||
</td>
|
</td>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password" ></asp:TextBox>
|
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -2896,17 +2897,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-9">
|
<div class="col-md-12">
|
||||||
<div class="row">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<div class="col-md-12">
|
<asp:DropDownList ID="DdlMarcaPSAjuste" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
|
||||||
<asp:DropDownList ID="DdlMarcaPSAjuste" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
|
</asp:DropDownList>
|
||||||
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
|
<label for="<%= DdlMarcaPSAjuste.ClientID.ToString()%>">Marca:</label>
|
||||||
</asp:DropDownList>
|
|
||||||
<label for="<%= DdlMarcaPSAjuste.ClientID.ToString()%>">Marca:</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-9">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
|
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
|
||||||
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
|
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
|
||||||
|
|||||||
@@ -1264,6 +1264,9 @@ Partial Class PV
|
|||||||
DdlMarcaPS.DataBind()
|
DdlMarcaPS.DataBind()
|
||||||
DdlMarcaPSAjuste.DataBind()
|
DdlMarcaPSAjuste.DataBind()
|
||||||
|
|
||||||
|
DdlMarcaPS.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||||
|
DdlMarcaPSAjuste.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||||
|
|
||||||
UpModalVenta.Update()
|
UpModalVenta.Update()
|
||||||
UpAjuste.Update()
|
UpAjuste.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -3519,20 +3522,32 @@ Partial Class PV
|
|||||||
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
|
||||||
|
|
||||||
'VALIDA ENTREGA POR ADELANTADO
|
'VALIDA ENTREGA POR ADELANTADO
|
||||||
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
|
||||||
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
|
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
|
||||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||||
|
If ObjFactura.ServicioDomicilio Then
|
||||||
|
ObjFactura.CveAlmacenServicioDomicilio = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||||
|
ObjFactura.DtInventario = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||||
|
End If
|
||||||
|
|
||||||
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
|
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
|
||||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||||
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
|
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
|
'SI LA SUCURSAL NO TIENE SERVICIO A DOMICILIO
|
||||||
|
If ObjFactura.ServicioDomicilio AndAlso ObjFactura.CveAlmacenServicioDomicilio <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||||
|
ObjFactura.ErrorList.Add("No existe un almacen configurado como 'Servicio a Domicilio' en esta sucursal.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -754,6 +754,12 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr align="left" id="TrServicioDomicilio" runat="server" visible="false">
|
||||||
|
<td><b>Servicio a Domicilio:</b> </td>
|
||||||
|
<td>
|
||||||
|
activado
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -4012,6 +4012,10 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CBool(DbRowVenta("ServicioDomicilio")) Then
|
||||||
|
TrServicioDomicilio.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
'CargaDetalle
|
'CargaDetalle
|
||||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||||
TmpDT = ObjVentas.DtResultados
|
TmpDT = ObjVentas.DtResultados
|
||||||
@@ -12976,8 +12980,10 @@ Partial Class Ventas
|
|||||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim IdCtaContable As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
Dim CveCuenta As Integer = 0
|
||||||
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
|
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim TotalCostoAcumulado As Decimal = 0
|
|
||||||
Dim cont As Integer = 1
|
Dim cont As Integer = 1
|
||||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
@@ -12995,12 +13001,18 @@ Partial Class Ventas
|
|||||||
'If ValorInventario <> 0 Then
|
'If ValorInventario <> 0 Then
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
'End If
|
'End If
|
||||||
cont += 1
|
cont += 1
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'AJUSTA EL TOTAL
|
||||||
|
If Math.Abs(TotalCostoAcumulado - TotalCosto) = 0.01 Then
|
||||||
|
TotalCosto = TotalCostoAcumulado
|
||||||
|
End If
|
||||||
|
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
||||||
|
|
||||||
'If TotalCosto <> 0 Then
|
'If TotalCosto <> 0 Then
|
||||||
@@ -23186,7 +23198,7 @@ Partial Class Ventas
|
|||||||
Dim ObjBancos As New ClsBancos
|
Dim ObjBancos As New ClsBancos
|
||||||
|
|
||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveRol = 1 Then
|
||||||
GvComplementoPagos.Columns(8).Visible = True
|
GvComplementoPagos.Columns(7).Visible = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user