Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -4542,7 +4542,7 @@ Namespace Modelos
|
||||
If Not SeCancela Then
|
||||
Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa)
|
||||
|
||||
If True Then ' ObjRem.SaldoAlmacen = 0
|
||||
If ObjRem.SaldoAlmacen = 0 Then
|
||||
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||
|
||||
If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
||||
@@ -4613,6 +4613,7 @@ Namespace Modelos
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
ObjRem.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -140,12 +140,14 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" id="trNotificar" runat="server" visible="False">
|
||||
<label class="col-md-2">Notificar:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtNotificarA" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="400px" Rows="2" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="trCuentaDeposito" runat="server" visible="False">
|
||||
<label class="col-md-2">Cuenta Depósito:</label>
|
||||
<div class="col-md-10">
|
||||
|
||||
@@ -816,7 +816,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
Dim Conta As ClsContPAQi = Nothing
|
||||
Dim IDPoliza As Integer = 0
|
||||
Dim MsgError As String = ""
|
||||
Dim CveIE As Integer
|
||||
Dim CveIE As Integer = -1
|
||||
Dim CveIEInsertado As Integer = -1
|
||||
Dim FolioIE As String = ""
|
||||
|
||||
@@ -925,7 +925,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
|
||||
If MsgError = "" Then
|
||||
'MENSAJE IE
|
||||
If CveIE Then
|
||||
If CveIE > 0 Then
|
||||
MensajeAlert.AppendFormat("<br/><br/>Folio Bancario: <b><a href = ""/Bancos/IE.aspx?CveIE={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CveIE, FolioIE)
|
||||
Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()")
|
||||
Else
|
||||
|
||||
@@ -1465,8 +1465,6 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'VALIDA CANTIDAD DE SALIDA
|
||||
Dim Cantidad As Decimal = 0.0D
|
||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||
@@ -2214,122 +2212,123 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
' SE REALIZARA AL MOMENTO DE CANCELAR LA FACTURA {
|
||||
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
||||
If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||
Dim DtDevRem As New DataTable
|
||||
Dim DtMovtosDev As New DataTable
|
||||
Dim CveAlmacenTraspasoDestinoDevRem = -1
|
||||
|
||||
Dim CveVentaDetalleRem = -1
|
||||
Dim CantidadDevolver As Decimal = 0
|
||||
Dim CantidadRem As Decimal = 0
|
||||
'If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||
' Dim DtDevRem As New DataTable
|
||||
' Dim DtMovtosDev As New DataTable
|
||||
' Dim CveAlmacenTraspasoDestinoDevRem = -1
|
||||
|
||||
'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0")
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
' Dim CveVentaDetalleRem = -1
|
||||
' Dim CantidadDevolver As Decimal = 0
|
||||
' Dim CantidadRem As Decimal = 0
|
||||
|
||||
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtMovtosDev = ObjInventario.DtResultados
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
' 'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||
' If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||
' DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0")
|
||||
' Else
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then
|
||||
' 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||
' If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
' DtMovtosDev = ObjInventario.DtResultados
|
||||
' Else
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows
|
||||
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||
If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión."
|
||||
Exit For
|
||||
End If
|
||||
' If Not ErrorMovInv Then
|
||||
' If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then
|
||||
|
||||
'SALIDA GENERAL
|
||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
||||
FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||
' For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows
|
||||
' CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||
' If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
'ENTRADA ADELANTADO
|
||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero)
|
||||
FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||
' 'SALIDA GENERAL
|
||||
' CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
||||
' FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||
|
||||
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión."
|
||||
Exit For
|
||||
End If
|
||||
' 'ENTRADA ADELANTADO
|
||||
' CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero)
|
||||
' FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||
|
||||
' If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
|
||||
'SALIDA POR TRAPASO DE GENERAL
|
||||
For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
||||
CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
||||
CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
||||
'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble
|
||||
'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then
|
||||
' 'SALIDA POR TRAPASO DE GENERAL
|
||||
' For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
||||
' CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
||||
' CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
||||
' 'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble
|
||||
' 'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then
|
||||
|
||||
If Not CveVentaDetalleRem > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión."
|
||||
Exit For
|
||||
End If
|
||||
' If Not CveVentaDetalleRem > 0 Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
If ErrorMovInv Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' If ErrorMovInv Then
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
If ErrorMovInv Then
|
||||
Exit For
|
||||
End If
|
||||
' If ErrorMovInv Then
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
||||
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
||||
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
If ErrorMovInv Then
|
||||
Exit For
|
||||
End If
|
||||
' If ErrorMovInv Then
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén"
|
||||
Exit For
|
||||
End If
|
||||
' Else
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén"
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
|
||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
||||
TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar."
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
' If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
||||
' TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar."
|
||||
' ErrorMovInv = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar."
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
End If
|
||||
' Next
|
||||
' End If
|
||||
' Else
|
||||
' TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar."
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
'End If
|
||||
'}
|
||||
|
||||
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
||||
If Not ErrorMovInv And EsDevolucionVenta = 1 Then
|
||||
|
||||
@@ -16765,6 +16765,21 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ObjCliente.Dispose()
|
||||
|
||||
RecargaGlobalCliente()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RecargaGlobalCliente()
|
||||
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
|
||||
Hilo.Start()
|
||||
End Sub
|
||||
Private Sub GeneraGlobalDTCliente()
|
||||
Dim Objclientes As New ClsClientes
|
||||
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
|
||||
Application("GlobalDTCliente") = Objclientes.DtResultados
|
||||
End If
|
||||
Objclientes.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Reference in New Issue
Block a user