Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2482,7 +2482,7 @@
|
||||
<div class="row" style="padding-left: 16px;">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-9">
|
||||
<asp:TextBox ID="TxtRFCCliente" Text="XAXX010101000" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="REVRFCCliente" runat="server" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardarCliente" ControlToValidate="TxtRFCCliente" ValidationExpression="[a-z,ñ,A-Z,Ñ,&]{3,4}[0-9]{2}[0-1][0-9][0-3][0-9][A-Z,0-9]?[A-Z,0-9]?[0-9,A-Z]?"></asp:RegularExpressionValidator>
|
||||
<asp:RegularExpressionValidator ID="REVRFCCliente" runat="server" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardarCliente" ControlToValidate="TxtRFCCliente" ValidationExpression="^[a-zñA-ZÑ.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
|
||||
<label for="<%= TxtRFCCliente.ClientID.ToString()%>">RFC:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3">
|
||||
|
||||
@@ -5014,7 +5014,7 @@ Partial Class PV
|
||||
If Modalidad = "A" Then
|
||||
Row("Consec") = TmpDT.MAX("Consec").ToEntero() + 1
|
||||
If Not EsCargo Then
|
||||
ConsecutivoVenta = TmpDT.MAX("Consec").ToEntero() + 1
|
||||
ConsecutivoVenta = Row("Consec").ToString.ToEntero
|
||||
End If
|
||||
ElseIf Modalidad = "U" Then
|
||||
If Not EsCargo Then
|
||||
@@ -7661,6 +7661,7 @@ Partial Class PV
|
||||
TmpDTRecepcionUsados = New DataTable
|
||||
TmpDTRecepcionUsados.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("CvePSRelacionado", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("ConsecUsado", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("ConsecRelacionado", GetType(Integer))
|
||||
TmpDTRecepcionUsados.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDTRecepcionUsados.Columns.Add("AnioVehiculo", GetType(String))
|
||||
@@ -7743,6 +7744,9 @@ Partial Class PV
|
||||
Row("PU") = DrTamanio("Cargo").ToString().ToDecimal
|
||||
Row("CveBCIUsado") = DdlBCIUsado.SelectedValue.ToEntero
|
||||
Row("CveModeloAuto") = DdlModeloAuto.SelectedValue.ToEntero
|
||||
If ListaPSCargo IsNot Nothing AndAlso ListaPSCargo.Count = 1 Then
|
||||
Row("ConsecUsado") = ListaPSCargo.FirstOrDefault().ConsecutivoUsado
|
||||
End If
|
||||
Row("ConsecRelacionado") = ConsecPSPadre
|
||||
Row("FechaUsado") = TxtFechaVigencia.Text.ToDateTime()
|
||||
Row("AnioVehiculo") = TxtAnioVehiculo.Text
|
||||
@@ -7878,6 +7882,7 @@ Partial Class PV
|
||||
End Sub
|
||||
Public Class MConceptoUsado
|
||||
Public Property Consecutivo As Integer
|
||||
Public Property ConsecutivoUsado As Integer
|
||||
Public Property CvePS As Integer
|
||||
End Class
|
||||
Private Function CalculaUsados(Consec As Integer, Optional LimpiarUsados As Boolean = True) As List(Of MConceptoUsado)
|
||||
@@ -7985,12 +7990,12 @@ Partial Class PV
|
||||
|
||||
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
||||
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
|
||||
Dim Concec = AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
||||
Dim ConsecutivoUsado As Integer = AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
||||
drowPsTamaños("CveClasificacion").ToString.ToEntero, drowPsTamaños("Clasificacion").ToString, drowPsTamaños("CvePS").ToString.ToEntero,
|
||||
drowPsTamaños("PS").ToString, "", drowPsTamaños("PU").ToString.ToDecimal, 0, -1, "", drowPsTamaños("CveSubProyecto").ToString.ToEntero,
|
||||
drowPsTamaños("SubProyecto").ToString, EsCargo:=True, ConsecPSPadre:=drowPsTamaños("ConsecPSPadre").ToString.ToEntero, EliminarDB:=CBool(drowPsTamaños("EliminarDB").ToString()))
|
||||
If Consec > 0 Then
|
||||
ListaPScargo.Add(New MConceptoUsado() With {.Consecutivo = Consec, .CvePS = drowPsTamaños("CvePS").ToString.ToEntero})
|
||||
ListaPScargo.Add(New MConceptoUsado() With {.Consecutivo = Consec, .ConsecutivoUsado = ConsecutivoUsado, .CvePS = drowPsTamaños("CvePS").ToString.ToEntero})
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -2719,15 +2719,15 @@ Partial Class Ventas
|
||||
LnkImprimirFormatoTelcel.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
DivDevAlm.Visible = True
|
||||
End If
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
End If
|
||||
'If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||
' Dim ObjInventario As New ClsInventarios
|
||||
' If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
' DivDevAlm.Visible = True
|
||||
' End If
|
||||
' End If
|
||||
' ObjInventario.Dispose()
|
||||
'End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
CargaVentaCortePorte(Me.CveVenta)
|
||||
@@ -4404,7 +4404,7 @@ Partial Class Ventas
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
|
||||
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
DtAntRelacionados = ObjVentas.DtResultados.Copy()
|
||||
DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')")
|
||||
End If
|
||||
|
||||
Dim SerieFolioPadre As String
|
||||
@@ -8401,6 +8401,12 @@ Partial Class Ventas
|
||||
Alert("La carta porte no tiene la F.Llegada definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TxtFechaLlegadaCP.Text.ToDateTime() < TxtFechaEntregaCP.Text.ToDateTime() Then
|
||||
Alert("La fecha de llegada no puede ser menor al fecha de salida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DtMercancias Is Nothing OrElse DtMercancias.Rows.Count = 0 Then
|
||||
Alert("La carta porte no tiene mercancía definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -14503,11 +14509,6 @@ Partial Class Ventas
|
||||
Filtro = "CveConcepto = 9"
|
||||
End Select
|
||||
|
||||
Dim DtExistencias As DataTable = Nothing
|
||||
If ObjInventario.GetInv_Mov(Me.CveVentaDevolucion, UsuarioActual.CveEmpresa) Then
|
||||
DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}")
|
||||
End If
|
||||
|
||||
Dim CveConceptoAlmacen As Integer = 3
|
||||
If factura.TipoDocto = "Dev" Then
|
||||
CveConceptoAlmacen = 18
|
||||
@@ -14576,6 +14577,11 @@ Partial Class Ventas
|
||||
If CveProducto > 0 Then
|
||||
'SI ES ENTRADA DEBE TENER EL COSTO DE LA SALIDA
|
||||
If CveConceptoAlmacen.Contiene(18) Then
|
||||
Dim DtExistencias As DataTable = Nothing
|
||||
If ObjInventario.GetInv_Mov(Me.CveVentaDevolucion, UsuarioActual.CveEmpresa) Then
|
||||
DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}")
|
||||
End If
|
||||
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
|
||||
If PU <= 0 Then
|
||||
ErrorList.Add("Ocurrió un error al obtener el costo.<br />")
|
||||
@@ -14985,45 +14991,6 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Select Case ConversionRemision
|
||||
Case "*"
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Next
|
||||
|
||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||
If gvr.RowType = DataControlRowType.DataRow Then
|
||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
||||
End If
|
||||
Next
|
||||
Case "/"
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Next
|
||||
|
||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||
If gvr.RowType = DataControlRowType.DataRow Then
|
||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
||||
End If
|
||||
Next
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
|
||||
Dim CartaPorte As Modelos.MSubReportData = Nothing
|
||||
|
||||
If UsuarioActual.CveEmpresa = 13 Then
|
||||
@@ -15033,47 +15000,6 @@ Partial Class Ventas
|
||||
|
||||
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False, SubReportData:=CartaPorte), "Factura", "PDF")
|
||||
|
||||
Select Case ConversionRemision
|
||||
Case "*"
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
|
||||
Next
|
||||
|
||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||
If gvr.RowType = DataControlRowType.DataRow Then
|
||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
||||
End If
|
||||
Next
|
||||
Case "/"
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Row("PU") = Math.Round(Row("PU").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
|
||||
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
|
||||
Next
|
||||
|
||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||
If gvr.RowType = DataControlRowType.DataRow Then
|
||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TipoCambioRemision, NumeroDecimales)).FormatoNumero
|
||||
End If
|
||||
Next
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -16635,150 +16561,6 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "I M A G E - B U T T O N S"
|
||||
Protected Function CancelarMovimientoInventario(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, CveVentaNueva As Integer, CveVentaVieja As Integer) As Boolean
|
||||
|
||||
'SI YA ESTA QUEMADA DE ALMACEN LA VENTA, NO SE CANCELAN LOS MOVIMIENTOS DE INVENTARIO
|
||||
If ObjInventario.GetEstatusVentaPorSurtir(CveVentaVieja) Then
|
||||
If ObjInventario.EsDevolucionVenta = 2 Then
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim DtMovimientos As DataTable
|
||||
Dim DTMovimientosDetalles As DataTable
|
||||
Dim OcurrioError As Boolean = False
|
||||
|
||||
'Verificamos que la venta tenga movimientos
|
||||
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
DtMovimientos = ObjInventario.DtResultados.FiltraParametros("CveConcepto = 3", DistinctColumns:={"CveMovimiento"})
|
||||
DTMovimientosDetalles = ObjInventario.DtResultados.FiltraParametros("CvePS > 0")
|
||||
|
||||
For Each Mov As DataRow In DtMovimientos.Rows
|
||||
If ObjInventario.GetMovimientos(Mov("CveMovimiento").ToString().ToEntero(), 3, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Dim CveAlmacen As Integer = ObjInventario.DtResultados(0)("CveAlmacen").ToString().ToEntero()
|
||||
Dim CveMoneda As Integer = ObjInventario.DtResultados(0)("CveMoneda").ToString().ToEntero()
|
||||
Dim Fecha As Date = Now
|
||||
|
||||
'Creamos el movimiento de entrada y el movimiento de salida
|
||||
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E2")
|
||||
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E3")
|
||||
|
||||
If CveMovimientoInventarioEntrada > 0 AndAlso CveMovimientoInventarioSalida > 0 Then
|
||||
|
||||
'Creamos sus detalles
|
||||
For Each MovDet As DataRow In DTMovimientosDetalles.FiltraParametros($"CveMovimiento = {Mov("CveMovimiento")}").Rows
|
||||
|
||||
Dim Cantidad As Double = MovDet("Cantidad").ToString().ToDouble
|
||||
Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero()
|
||||
Dim PU As Decimal = MovDet("PU").ToString().ToDecimal
|
||||
Dim CveProducto As Integer = MovDet("CvePS").ToString().ToEntero()
|
||||
Dim Serie As String = MovDet("Serie").ToString()
|
||||
Dim Lote As String = MovDet("Lote").ToString()
|
||||
Dim FechaCaducidad As Date = MovDet("FechaCaducidad").ToString().ToDate
|
||||
|
||||
|
||||
Dim CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
|
||||
|
||||
'Entrada
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioEntrada, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Salida
|
||||
CveVentaDetalle = ObjInventario.VentaDetallePadreGet(CveVentaDetalle).ToString().ToEntero()
|
||||
If CveVentaDetalle > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioSalida, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
'Creamos sus prepolizas
|
||||
If Not OcurrioError Then
|
||||
Dim tmpCostos As DataTable = DTMovimientosDetalles.FiltraParametros($"CveMovimiento = {Mov("CveMovimiento")}", "", {"CveClasificacion"})
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
Dim ValorInventario As Decimal = 0
|
||||
|
||||
For Each RowInv As DataRow In tmpCostos.Rows
|
||||
ValorInventario = DTMovimientosDetalles.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL()
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
|
||||
If ValorInventario <> 0 Then
|
||||
'Entrada
|
||||
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveDevolucion, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventarioEntrada, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||
'Salida
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventarioSalida, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If OcurrioError Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero()
|
||||
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundSQL()
|
||||
|
||||
If ValorInventario <> 0 Then
|
||||
'Entrada
|
||||
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveDevolucion, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimientoInventarioEntrada, ImporteMX:=ValorInventario) Then
|
||||
'Salida
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ValorInventario, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimientoInventarioSalida, ImporteMX:=ValorInventario) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Else
|
||||
'Si no tiene Movimientos de Salida no ocupamos mas
|
||||
Return Not OcurrioError
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Return Not OcurrioError
|
||||
End Function
|
||||
Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi, ByRef ObjBancos As ClsBancos) As Boolean
|
||||
Dim IDPoliza As Integer = -1
|
||||
Dim CvePrePoliza As Integer
|
||||
@@ -20067,41 +19849,6 @@ Partial Class Ventas
|
||||
|
||||
Return MovDTCuadrados
|
||||
End Function
|
||||
Private Function SalidaEntradaAlmacen(ByRef ObjInventario As ClsInventarios, CveRemision As Integer, ByRef ObjConta As ClsContabilidad) As Boolean
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim DtMovimientos As DataTable
|
||||
Dim DtMovimientosDetalles As DataTable
|
||||
|
||||
'Obtenemos los movimientos detalle
|
||||
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
DtMovimientos = ObjInventario.DtResultados.FiltraParametros("", DistinctColumns:={"CveMovimiento"})
|
||||
DtMovimientosDetalles = ObjInventario.DtResultados.FiltraParametros("CvePS > 0")
|
||||
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
|
||||
'Obtenemos los Movimientos de salida
|
||||
If ObjInventario.GetMovimientos(dr("CveMovimiento").ToString().ToEntero(), 3, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim CveAlmacenSalida As Integer = ObjInventario.DtResultados(0)("CveAlmacen").ToString().ToEntero()
|
||||
Dim CveMoneda As Integer = ObjInventario.DtResultados(0)("CveMoneda").ToString().ToEntero()
|
||||
|
||||
'Le damos entrada
|
||||
If Not GenerarMovimientoAlmacen(ObjInventario, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}"), CveAlmacenSalida, 2, CveMoneda, CveRemision) > 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return Not OcurrioError
|
||||
End Function
|
||||
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = False,
|
||||
Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer
|
||||
Dim OcurrioError As Boolean = False
|
||||
@@ -20219,7 +19966,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
'If ValorInventario <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -20233,7 +19980,7 @@ Partial Class Ventas
|
||||
|
||||
If Not OcurrioError Then
|
||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
@@ -22664,6 +22411,10 @@ Partial Class Ventas
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||
DivDevAlm.Visible = True
|
||||
TieneAlmacen = True
|
||||
End If
|
||||
CargaGVInv(ObjInv.DtResultados)
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user