This commit is contained in:
Antonio Gonzalez
2020-03-21 13:43:14 -07:00
7 changed files with 204 additions and 174 deletions

View File

@@ -1727,19 +1727,16 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable
Get Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder Dim Str As New StringBuilder
Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) Str.Append("1=1 AND ")
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable GlobalDTAlmacen = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else
GlobalDTAlmacen = DirectCast(Application("GlobalDTAlmacen"), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
@@ -1748,18 +1745,16 @@ Public Class ClsPaginas
End Property End Property
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1, Optional CveEstatus As Integer = 1) As DataTable Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1, Optional CveEstatus As Integer = 1) As DataTable
Get Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder Dim Str As New StringBuilder
Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa) If CveEmpresa <> -1 Then Str.AppendFormat("CveUsuario = {0} AND CveEmpresa = {1} ", CveUsuario, CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacenUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacenUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacenUsuarios = Dv.ToTable GlobalDTAlmacenUsuarios = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else
GlobalDTAlmacenUsuarios = DirectCast(Application("GlobalDTAlmacenUsuarios"), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)

View File

@@ -240,7 +240,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Panel ID="PnlDetallePagos" runat="server"> <asp:Panel ID="PnlDetallePagos" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound"> <asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="float: right; width: 95%;" DataKeyNames="IdCtaContable, CveCuenta,Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns> <Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" /> <asp:BoundField DataField="ConceptoContable" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto"> <asp:TemplateField HeaderText="Concepto">

View File

@@ -601,7 +601,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
If ddlProveedor.SelectedValue.ToEntero > 0 Then If ddlProveedor.SelectedValue.ToEntero > 0 Then
If ObjInventarios.ComprasPendientesAlmacenGet(ddlProveedor.SelectedValue.ToEntero, MinFecha.ToShortDateString.ToDate, UsuarioActual.CveEmpresa) Then If ObjInventarios.ComprasPendientesAlmacenGet(ddlProveedor.SelectedValue.ToEntero, MinFecha.ToShortDateString.ToDate, UsuarioActual.CveEmpresa) Then
Dim FiltroTemporal = If(UsuarioActual.CveEmpresa = 119, "AND TipoDocto IN ('Fac','NC')", "AND TipoDocto IN ('Fac')") Dim FiltroTemporal = If(UsuarioActual.CveEmpresa = 119, "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')")
DdlFolio.DataSource = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}") DdlFolio.DataSource = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}")
Else Else
Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError) Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError)

View File

@@ -1921,6 +1921,9 @@ Partial Class Inventarios_RecepcionEntrega
Exit For Exit For
End If End If
Next Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al obtener los registros"
End If End If
If ErrorMovInv Then Exit For If ErrorMovInv Then Exit For
Next Next
@@ -2001,7 +2004,7 @@ Partial Class Inventarios_RecepcionEntrega
TextoError = "No se pudo generar el movimiento de entrada correctamente" TextoError = "No se pudo generar el movimiento de entrada correctamente"
ErrorMovInv = True ErrorMovInv = True
Else Else
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then
ErrorMovInv = True ErrorMovInv = True
@@ -2009,6 +2012,9 @@ Partial Class Inventarios_RecepcionEntrega
Exit For Exit For
End If End If
Next Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
End If End If
End If End If

View File

@@ -1599,7 +1599,7 @@
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server"> <div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption"> <div class="caption">
<i class="fa fa-dropbox"></i>Salida Almacen <i class="fa fa-dropbox"></i><asp:Literal ID="LltSalidaAlmacen" runat="server" Text="Salida Almacen"></asp:Literal>
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse"></a> <a href="javascript:;" class="collapse"></a>

View File

@@ -6245,7 +6245,7 @@ Partial Class Ventas
End If End If
If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then
If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero
e.Row.FCCheckBox("cbInv").Visible = False e.Row.FCCheckBox("cbInv").Visible = False
End If End If
@@ -10997,9 +10997,9 @@ Partial Class Ventas
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Try Try
If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem", "Dev") Then
If RemisionesLista.Count > 0 Then If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
For Each CveRemision As Integer In RemisionesLista For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal 'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then
@@ -11011,8 +11011,28 @@ Partial Class Ventas
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim Filtro As String = ""
Select Case factura.TipoDocto
Case "Ing", "Ped"
Filtro = "CveConcepto IN (3,40)"
Case "Dev"
Filtro = "CveConcepto IN (3,40)"
Case Else
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
End If
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1") Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1")
If CveMovimientoInventario <= 0 Then If CveMovimientoInventario <= 0 Then
OcurrioError = True OcurrioError = True
@@ -11024,8 +11044,7 @@ Partial Class Ventas
Dim CveUnidad As Integer Dim CveUnidad As Integer
Dim CveProducto As Integer Dim CveProducto As Integer
Dim Existencia As Double Dim Existencia As Double
'Dim Pu As Double Dim PU As Decimal = 0
'DtInv.Clone()
Dim DtEquivalencias As DataTable Dim DtEquivalencias As DataTable
@@ -11042,7 +11061,7 @@ Partial Class Ventas
Exit For Exit For
End If End If
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString.ToEntero < 1 Then If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString.ToEntero < 1 Then
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then If Existencia < Cantidad Then
OcurrioError = True OcurrioError = True
@@ -11066,7 +11085,17 @@ Partial Class Ventas
End If End If
If CveProducto > 0 Then If CveProducto > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, -1, SerieLote:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then 'SI ES ENTRADA DEBE TENER EL COSTO DE LA SALIDA
If CveConceptoAlmacen.Contiene(18) Then
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 />")
OcurrioError = True
Exit For
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />") ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For Exit For
@@ -11078,6 +11107,7 @@ Partial Class Ventas
End If End If
End If End If
PU = 0
i = i + 1 i = i + 1
Next Next
@@ -11086,6 +11116,15 @@ Partial Class Ventas
Dim DtCostos As DataTable = Nothing Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0 Dim ValorInventario As Decimal = 0
Dim TotalCosto As Decimal = 0 Dim TotalCosto As Decimal = 0
Dim TipoMovto68 As Boolean = True
Dim TipoMovto69 As Boolean = False
If CveConceptoAlmacen.Contiene(18) Then
TipoMovto68 = False
TipoMovto69 = True
End If
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados DtCostos = ObjInventario.DtResultados
TotalCosto = DtCostos.SUMD("Total").RoundSQL TotalCosto = DtCostos.SUMD("Total").RoundSQL
@@ -11110,7 +11149,7 @@ Partial Class Ventas
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If ValorInventario <> 0 Then 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 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
@@ -11120,15 +11159,16 @@ Partial Class Ventas
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
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 If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, 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 OcurrioError = True
End If End If
End If End If
factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario
End If End If
factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario
End If End If
End If End If
@@ -17651,17 +17691,17 @@ Partial Class Ventas
End Sub End Sub
Private Function ValidaPagosContado() As Boolean Private Function ValidaPagosContado() As Boolean
Dim Retorno = False Dim Retorno = False
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO 'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso Total > 0 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < Total Then
@@ -17682,8 +17722,8 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < Total Then
@@ -22200,47 +22240,34 @@ Partial Class Ventas
'AGREGAR LOS USADOS EN LA DEVOLUCION 'AGREGAR LOS USADOS EN LA DEVOLUCION
CalculaUsados(DtUsados) CalculaUsados(DtUsados)
'If DtUsados IsNot Nothing AndAlso DtUsados.Rows.Count > 0 Then
' Dim DtPSVenta As DataTable = TmpDT.Copy()
' For Each Row As DataRow In DtPSVenta.Rows
' Dim RowCargo As DataRow = DTTamanios.FiltroPrimero($"CveTamaño = { Row("CveTamaño").ToString.ToEntero } ")
' If RowCargo IsNot Nothing Then
' Dim CvePSCargo As Integer = RowCargo("CvePSCargo").ToString.ToEntero
' For Each RowUsado As DataRow In DtUsados.FiltraParametros($"CvePS = {CvePSCargo}").Rows
' 'If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
' 'End If
' Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
' Dim Descuento As Decimal = Cantidad * RowUsado("Descuento").ToString.ToDecimal / RowUsado("Cantidad").ToString.ToDecimal
' Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
' Dim Total As Decimal = (Cantidad * PU)
' Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
' Dim ImporteIVA As Decimal = TotalImpuestos * RowUsado("PorcentajeIVA").ToString.ToDecimal
' Dim ImporteRetIVA As Decimal = TotalImpuestos * RowUsado("PorcentajeRetIVA").ToString.ToDecimal
' Dim ImporteRetISR As Decimal = TotalImpuestos * RowUsado("PorcentajeRetISR").ToString.ToDecimal
' Dim ImporteIEPS As Decimal = TotalImpuestos * RowUsado("PorcentajeIEPS").ToString.ToDecimal
' AgregaTempDT(TmpDT, RowUsado("CvePS").ToString.ToEntero, RowUsado("PS").ToString, RowUsado("Codigo").ToString, RowUsado("CodigoPS").ToString,
' RowUsado("CveTipoPS").ToString.ToEntero, RowUsado("CveTipoInvPS").ToString.ToEntero,
' RowUsado("CveUM").ToString.ToEntero, RowUsado("UM").ToString, RowUsado("CveClasificacion").ToString.ToEntero,
' RowUsado("Clasificacion").ToString, RowUsado("CveProyecto").ToString.ToEntero, RowUsado("Proyecto").ToString,
' RowUsado("CveSubProyecto").ToString.ToEntero, RowUsado("SubProyecto").ToString,
' RowUsado("Obs").ToString, Cantidad, PU, RowUsado("PorcentajeIVA").ToString.ToDecimal, ImporteIVA,
' RowUsado("PorcentajeRetIVA").ToString.ToDecimal, ImporteRetIVA,
' RowUsado("PorcentajeRetISR").ToString.ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString.ToDecimal,
' ImporteIEPS, -1, Descuento, Total, "", "", -1, -1,
' RowUsado("SATClaveProdServ").ToString, RowUsado("SATClaveUM").ToString, -1, RowUsado("CveVentaDetalle").ToString.ToEntero, -1, -1, -1, -1)
' Next
' End If
' Next
'End If
TrTipoRelacion.Visible = True TrTipoRelacion.Visible = True
DdlTiposRelacion.SelectedValueExist("3") DdlTiposRelacion.SelectedValueExist("3")
LimpiaDocumentoDEV() LimpiaDocumentoDEV()
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
DivAlmacen.Visible = True
LltSalidaAlmacen.Text = "Devolución Almacen"
Dim DTAlmacen As DataTable
ddlAlmacen.Items.Clear()
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}")
ddlAlmacen.DataSource = DTAlmacen
If DTAlmacen Is Nothing Or DTAlmacen.Rows.Count = 0 Then
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
ddlAlmacen.SelectedValue = "-1"
End If
ddlAlmacen.DataBind()
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}").Rows.Count > 0 Then
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
GvInv.Columns(0).Visible = True
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
CargaGVInv(DtInv)
End If
CambiaTipoDocto() CambiaTipoDocto()
CargaNC(CveVenta) CargaNC(CveVenta)
CalculaTotalesVenta() CalculaTotalesVenta()
@@ -24243,15 +24270,15 @@ Partial Class Ventas
Dim Retorno As Boolean = True Dim Retorno As Boolean = True
If UsuarioActual.CveEmpresa = 141 Then If UsuarioActual.CveEmpresa = 141 Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then Dim Total As Decimal = TxtTotal.Text.ToDecimal()
If Not PermiteCredito AndAlso ((DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0) Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = False Retorno = False
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < Total Then

View File

@@ -30,6 +30,8 @@