Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3964,11 +3964,12 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/General/CatModelos.aspx".ToUpper(), 710)
|
PaginaDict.Add("/General/CatModelos.aspx".ToUpper(), 710)
|
||||||
PaginaDict.Add("/General/CatRinTamanios.aspx".ToUpper(), 711)
|
PaginaDict.Add("/General/CatRinTamanios.aspx".ToUpper(), 711)
|
||||||
PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712)
|
PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712)
|
||||||
PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038)
|
PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038)
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
#Region "GPS"
|
#Region "GPS"
|
||||||
PaginaDict.Add("/GPS/RepTemperatura.aspx".ToUpper(), 681)
|
PaginaDict.Add("/GPS/RepTemperatura.aspx".ToUpper(), 681)
|
||||||
|
PaginaDict.Add("/GPS/FacturasSims.aspx".ToUpper(), 8401)
|
||||||
PaginaDict.Add("/GPS/VehiculoTrama.aspx".ToUpper(), 682)
|
PaginaDict.Add("/GPS/VehiculoTrama.aspx".ToUpper(), 682)
|
||||||
PaginaDict.Add("/GPS/DashboardGPS.aspx".ToUpper(), -1)
|
PaginaDict.Add("/GPS/DashboardGPS.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/GPS/WizardModelo.aspx".ToUpper(), 458)
|
PaginaDict.Add("/GPS/WizardModelo.aspx".ToUpper(), 458)
|
||||||
|
|||||||
@@ -3858,6 +3858,13 @@ Namespace Modelos
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.SaldoAmortizado > 0 Then
|
||||||
|
Retorno.Mensaje = "La factura no se puede cancelar debido a que esta amortizada."
|
||||||
|
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End If
|
||||||
|
|
||||||
'SI LA REMISION ESTA FACTURADA NO SE PUEDE CANCELAR
|
'SI LA REMISION ESTA FACTURADA NO SE PUEDE CANCELAR
|
||||||
If ObjFactura.TipoDocto = "Rem" Then
|
If ObjFactura.TipoDocto = "Rem" Then
|
||||||
Dim ObjV As New ClsVentas
|
Dim ObjV As New ClsVentas
|
||||||
@@ -4283,11 +4290,6 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
|
|
||||||
If Not GeneraMovimientosVirtuales(CveVenta, ObjInventario) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
'UTILIZA LA DEVOLUCION YA REALIZADA
|
'UTILIZA LA DEVOLUCION YA REALIZADA
|
||||||
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
@@ -4298,6 +4300,12 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
|
||||||
|
If Not GeneraMovimientosVirtuales(CveVenta, ObjInventario) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
|
||||||
|
End If
|
||||||
|
|
||||||
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
||||||
If Not ErrorCancelar AndAlso RevivirRemisiones Then
|
If Not ErrorCancelar AndAlso RevivirRemisiones Then
|
||||||
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
|
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
|
||||||
@@ -5057,6 +5065,8 @@ Namespace Modelos
|
|||||||
Public Property SaldoVentaDevolucion As Decimal
|
Public Property SaldoVentaDevolucion As Decimal
|
||||||
Public Property Saldo As Decimal
|
Public Property Saldo As Decimal
|
||||||
Public Property SaldoAlmacen As Decimal
|
Public Property SaldoAlmacen As Decimal
|
||||||
|
Public Property SaldoAnticipo As Decimal
|
||||||
|
Public Property SaldoAmortizado As Decimal
|
||||||
Public Property CvePAC As Integer
|
Public Property CvePAC As Integer
|
||||||
Public Property CveAnticipo As Integer
|
Public Property CveAnticipo As Integer
|
||||||
Public Property RemisionesLista As List(Of Integer)
|
Public Property RemisionesLista As List(Of Integer)
|
||||||
|
|||||||
@@ -157,6 +157,20 @@
|
|||||||
<asp:Literal ID="LtlTotalVentas" runat="server" Text='<%# Eval("VentasCorte", "{0:N2}") %>'></asp:Literal>
|
<asp:Literal ID="LtlTotalVentas" runat="server" Text='<%# Eval("VentasCorte", "{0:N2}") %>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||||
|
<HeaderTemplate>
|
||||||
|
<asp:Label Text="N.C." runat="server" CausesValidation="false"> </asp:Label>
|
||||||
|
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlNotasCredito" runat="server" Text='<%# Eval("NotasCredito", "{0:N2}") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
<asp:Label Text="Ventas Credito" runat="server" CausesValidation="false"> </asp:Label>
|
<asp:Label Text="Ventas Credito" runat="server" CausesValidation="false"> </asp:Label>
|
||||||
|
|||||||
@@ -291,7 +291,7 @@
|
|||||||
|
|
||||||
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
|
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
|
||||||
|
|
||||||
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,NoDeducible,IVADeducible,IVANoDeducible">
|
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
|
|||||||
@@ -81,23 +81,22 @@ Partial Class Inicio
|
|||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveRol = 1 Then
|
||||||
divInd.Visible = True
|
divInd.Visible = True
|
||||||
CargaSubProyectos()
|
CargaSubProyectos()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(271) Then MuestraVentasPUE()
|
'Ventas no timbradas por centro de costo
|
||||||
|
If UsuarioActual.TienePermisoProceso(208) Then MuestraNoTimbradasCentroCosto()
|
||||||
|
|
||||||
|
'Reporte facaturas pendientes por autorizar Oscar 2016-07-06
|
||||||
|
If UsuarioActual.TienePermisoProceso(158) Then
|
||||||
|
RegistraScript("$( document ).ready(function() { AbrirVentana('/Compras/PopUpFacturasPendientesAutorizar.aspx');});", "repFacturas")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.TienePermisoProceso(271) Then MuestraVentasPUE()
|
||||||
If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE()
|
If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE()
|
||||||
|
|
||||||
Dim EsDEV = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString.Contains("Desarrollo2017")
|
Dim EsDEV = Not UsuarioActual.Empresa.FacturaProduccion
|
||||||
If Not EsDEV Then
|
If Not EsDEV Then
|
||||||
If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100) Then MuestraInconsistencias() '100
|
If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100) Then MuestraInconsistencias() '100
|
||||||
End If
|
|
||||||
|
|
||||||
'Ventas no timbradas por centro de costo
|
|
||||||
If UsuarioActual.TienePermisoProceso(208) Then MuestraNoTimbradasCentroCosto()
|
|
||||||
|
|
||||||
|
|
||||||
'Reporte facaturas pendientes por autorizar Oscar 2016-07-06
|
|
||||||
If UsuarioActual.TienePermisoProceso(158) Then
|
|
||||||
RegistraScript("$( document ).ready(function() { AbrirVentana('/Compras/PopUpFacturasPendientesAutorizar.aspx');});", "repFacturas")
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD
|
'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD
|
||||||
|
|||||||
@@ -2261,10 +2261,38 @@ Partial Class Inventarios_RecepcionEntrega
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'QUEMAR REMISIONES
|
||||||
|
If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||||
|
Dim DtDevRem As New DataTable
|
||||||
|
|
||||||
|
'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 Then
|
||||||
|
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows
|
||||||
|
If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString.ToEntero, 2) Then
|
||||||
|
TextoError = "Ocurrió un error al hacer la devolución 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
|
||||||
|
|
||||||
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
||||||
If Not ErrorMovInv And EsDevolucionVenta = 1 Then
|
If Not ErrorMovInv And EsDevolucionVenta = 1 Then
|
||||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then
|
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then
|
||||||
TextoError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al hacer la devolución. Por favor vuelva a intentar."
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ Partial Class RH_CatPersonalRequerido
|
|||||||
CargaProyectos()
|
CargaProyectos()
|
||||||
CargaTurno()
|
CargaTurno()
|
||||||
|
|
||||||
|
CargaDepartamento()
|
||||||
|
|
||||||
ReqProyectoDdl.SelectedValueExist(-1)
|
ReqProyectoDdl.SelectedValueExist(-1)
|
||||||
ReqSubProyectoDdl.SelectedValueExist(-1)
|
ReqSubProyectoDdl.SelectedValueExist(-1)
|
||||||
ReqTurnoDdl.SelectedValueExist(-1)
|
ReqTurnoDdl.SelectedValueExist(-1)
|
||||||
|
|||||||
@@ -1988,8 +1988,6 @@ Partial Class PV
|
|||||||
CalculaTotalesVenta()
|
CalculaTotalesVenta()
|
||||||
|
|
||||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||||
'JJMQ 20160506: Se agrego para la validacion de pago de contado.
|
|
||||||
'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
|
|
||||||
|
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -3071,7 +3069,7 @@ Partial Class PV
|
|||||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||||
|
|
||||||
TmpDT.Columns.Add("PUOriginal", GetType(Decimal))
|
TmpDT.Columns.Add("PUOriginal", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("ConsecPSPadre", GetType(Integer))
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -3264,7 +3262,8 @@ Partial Class PV
|
|||||||
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
||||||
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
||||||
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False) As Integer
|
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False,
|
||||||
|
Optional ConsecPSPadre As Integer = -1) As Integer
|
||||||
|
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
If Not CvePS > 0 Then
|
If Not CvePS > 0 Then
|
||||||
@@ -3427,6 +3426,10 @@ Partial Class PV
|
|||||||
Row("CuentaPredial") = CuentaPredial
|
Row("CuentaPredial") = CuentaPredial
|
||||||
Row("EsCargo") = EsCargo
|
Row("EsCargo") = EsCargo
|
||||||
|
|
||||||
|
If EsCargo AndAlso ConsecPSPadre >= 0 Then
|
||||||
|
Row("ConsecPSPadre") = ConsecPSPadre
|
||||||
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 119 Then
|
If UsuarioActual.CveEmpresa = 119 Then
|
||||||
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
|
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
|
||||||
|
|
||||||
@@ -5213,8 +5216,6 @@ Partial Class PV
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
Try
|
Try
|
||||||
|
|
||||||
|
|
||||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
|
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
|
||||||
Dim CveMarca As Integer = -1
|
Dim CveMarca As Integer = -1
|
||||||
|
|
||||||
@@ -5570,177 +5571,148 @@ Partial Class PV
|
|||||||
CalculaTotalesVenta()
|
CalculaTotalesVenta()
|
||||||
End Sub
|
End Sub
|
||||||
Private Function CalculaUsados(Consec As Integer) As List(Of Integer)
|
Private Function CalculaUsados(Consec As Integer) As List(Of Integer)
|
||||||
|
If Modalidad = "U" Then
|
||||||
'If Modalidad = "U" Then
|
EliminarUsados(Consec)
|
||||||
' EliminarUsados(Consec)
|
End If
|
||||||
'End If
|
|
||||||
|
|
||||||
Dim ListaPScargo As New List(Of Integer)
|
Dim ListaPScargo As New List(Of Integer)
|
||||||
|
|
||||||
Dim DTTamanios As New DataTable
|
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
||||||
|
|
||||||
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
|
||||||
|
|
||||||
DTTamanios = ObjAcum.DtResultados
|
|
||||||
Dim DTCvePSCostos = ObjAcum.DtResultados.FiltraParametros("", "", {"CvePSCargo"})
|
|
||||||
|
|
||||||
|
|
||||||
Dim CveUnidadMedidaPSA As Integer = -1
|
Dim CveUnidadMedidaPSA As Integer = -1
|
||||||
Dim UnidadMedidaPSA As String = "Unidad"
|
Dim UnidadMedidaPSA As String = "Unidad"
|
||||||
Dim CveClacificacionPSA As Integer = -1
|
Dim CveClacificacionPSA As Integer = -1
|
||||||
|
|
||||||
Dim ClacificacionPSA As String = ""
|
Dim ClacificacionPSA As String = ""
|
||||||
|
|
||||||
Dim CveSubProyectoPSA As Integer = -1
|
Dim CveSubProyectoPSA As Integer = -1
|
||||||
Dim SubProyectoPSA As String = ""
|
Dim SubProyectoPSA As String = ""
|
||||||
|
|
||||||
Dim PSPSA As String = ""
|
Dim PSPSA As String = ""
|
||||||
|
|
||||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||||
|
|
||||||
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
||||||
DTPSTemp.Columns.Add("CveUnidadMedida", GetType(Integer))
|
DTPSTemp.Columns.Add("CveUnidadMedida", GetType(Integer))
|
||||||
DTPSTemp.Columns.Add("UnidadMedida", GetType(String))
|
DTPSTemp.Columns.Add("UnidadMedida", GetType(String))
|
||||||
DTPSTemp.Columns.Add("CveClacificacion", GetType(Integer))
|
DTPSTemp.Columns.Add("CveClacificacion", GetType(Integer))
|
||||||
DTPSTemp.Columns.Add("Clacificacion", GetType(String))
|
DTPSTemp.Columns.Add("Clacificacion", GetType(String))
|
||||||
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
||||||
DTPSTemp.Columns.Add("PS", GetType(String))
|
DTPSTemp.Columns.Add("PS", GetType(String))
|
||||||
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
||||||
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
|
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("ConsecPSPadre", GetType(Integer))
|
||||||
|
|
||||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||||
For Each DrowPartidas As DataRow In TmpDT.Select($"Consec = {Consec}")
|
For Each DrowPartidas As DataRow In TmpDT.Select($"Consec = {Consec}")
|
||||||
|
|
||||||
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
|
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
|
||||||
|
|
||||||
If CveTamanioTemp > 0 Then
|
If CveTamanioTemp > 0 Then
|
||||||
|
|
||||||
Dim DTTamanioTemp As New DataTable
|
Dim DTTamanioTemp As New DataTable
|
||||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString.ToEntero
|
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
CveSubProyectoPSA = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
CveSubProyectoPSA = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
||||||
SubProyectoPSA = DrowPartidas("SubProyecto").ToString
|
SubProyectoPSA = DrowPartidas("SubProyecto").ToString
|
||||||
|
|
||||||
If ObjProductosServicios.GetPS(CvePsTemp, -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
CveUnidadMedidaPSA = ObjProductosServicios.CveUnidadMedida
|
|
||||||
CveClacificacionPSA = ObjProductosServicios.CveClasificacion
|
|
||||||
UnidadMedidaPSA = ObjProductosServicios.DtResultados.FiltroPrimeroValor("UnidadMedida")
|
|
||||||
PSPSA = ObjProductosServicios.PS
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", " Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
|
||||||
Else
|
|
||||||
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", Orderby:="Clasificacion")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
|
||||||
|
|
||||||
|
|
||||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
|
||||||
|
|
||||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
|
||||||
|
|
||||||
If (dRowUpdate("CvePS").ToString.ToEntero = CvePsTemp) Then
|
|
||||||
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString.ToDecimal + DrowPartidas("Cantidad").ToString.ToDecimal
|
|
||||||
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString.ToDecimal + ImporteCargo
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
DTPSTemp.AcceptChanges()
|
|
||||||
|
|
||||||
Else
|
|
||||||
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
|
||||||
|
|
||||||
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString.ToDecimal
|
|
||||||
dRowNuevo("PU") = Cargo
|
|
||||||
dRowNuevo("CveUnidadMedida") = CveUnidadMedidaPSA
|
|
||||||
dRowNuevo("UnidadMedida") = UnidadMedidaPSA
|
|
||||||
dRowNuevo("CveClacificacion") = CveClacificacionPSA
|
|
||||||
dRowNuevo("Clacificacion") = ClacificacionPSA
|
|
||||||
dRowNuevo("CvePS") = CvePsTemp
|
|
||||||
dRowNuevo("PS") = PSPSA
|
|
||||||
|
|
||||||
dRowNuevo("CveSubProyecto") = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
|
||||||
dRowNuevo("SubProyecto") = DrowPartidas("SubProyecto").ToString
|
|
||||||
|
|
||||||
DTPSTemp.Rows.Add(dRowNuevo)
|
|
||||||
DTPSTemp.AcceptChanges()
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
If ObjProductosServicios.GetPS(CvePsTemp, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
CveUnidadMedidaPSA = ObjProductosServicios.CveUnidadMedida
|
||||||
|
CveClacificacionPSA = ObjProductosServicios.CveClasificacion
|
||||||
|
UnidadMedidaPSA = ObjProductosServicios.DtResultados.FiltroPrimeroValor("UnidadMedida")
|
||||||
|
PSPSA = ObjProductosServicios.PS
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
|
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", " Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||||
|
Else
|
||||||
|
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", Orderby:="Clasificacion")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||||
|
|
||||||
|
|
||||||
|
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||||
|
|
||||||
|
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||||
|
|
||||||
|
If (dRowUpdate("CvePS").ToString.ToEntero = CvePsTemp) Then
|
||||||
|
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString.ToDecimal + DrowPartidas("Cantidad").ToString.ToDecimal
|
||||||
|
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString.ToDecimal + ImporteCargo
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
DTPSTemp.AcceptChanges()
|
||||||
|
|
||||||
|
Else
|
||||||
|
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
||||||
|
|
||||||
|
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString.ToDecimal
|
||||||
|
dRowNuevo("PU") = Cargo
|
||||||
|
dRowNuevo("CveUnidadMedida") = CveUnidadMedidaPSA
|
||||||
|
dRowNuevo("UnidadMedida") = UnidadMedidaPSA
|
||||||
|
dRowNuevo("CveClacificacion") = CveClacificacionPSA
|
||||||
|
dRowNuevo("Clacificacion") = ClacificacionPSA
|
||||||
|
dRowNuevo("CvePS") = CvePsTemp
|
||||||
|
dRowNuevo("PS") = PSPSA
|
||||||
|
|
||||||
|
dRowNuevo("CveSubProyecto") = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
||||||
|
dRowNuevo("SubProyecto") = DrowPartidas("SubProyecto").ToString
|
||||||
|
dRowNuevo("ConsecPSPadre") = Consec
|
||||||
|
|
||||||
|
DTPSTemp.Rows.Add(dRowNuevo)
|
||||||
|
DTPSTemp.AcceptChanges()
|
||||||
End If
|
End If
|
||||||
Next
|
|
||||||
ObjProductosServicios.Dispose()
|
|
||||||
|
|
||||||
Dim ModalidadBack = Modalidad
|
|
||||||
'CAMBIA LA MODALIDAD PARA AGREGAR LOS PS CARGO
|
|
||||||
If Modalidad = "U" Then
|
|
||||||
Modalidad = "A"
|
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
|
ObjProductosServicios.Dispose()
|
||||||
|
|
||||||
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
Dim ModalidadBack = Modalidad
|
||||||
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
|
'CAMBIA LA MODALIDAD PARA AGREGAR LOS PS CARGO
|
||||||
Dim Concec = AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
If Modalidad = "U" Then
|
||||||
|
Modalidad = "A"
|
||||||
|
End If
|
||||||
|
|
||||||
|
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,
|
||||||
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").ToString, drowPsTamaños("CvePS").ToString.ToEntero,
|
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").ToString, drowPsTamaños("CvePS").ToString.ToEntero,
|
||||||
drowPsTamaños("PS").ToString, "", drowPsTamaños("PU").ToString.ToDecimal, 0, -1, "", drowPsTamaños("CveSubProyecto").ToString.ToEntero,
|
drowPsTamaños("PS").ToString, "", drowPsTamaños("PU").ToString.ToDecimal, 0, -1, "", drowPsTamaños("CveSubProyecto").ToString.ToEntero,
|
||||||
drowPsTamaños("SubProyecto").ToString, EsCargo:=True)
|
drowPsTamaños("SubProyecto").ToString, EsCargo:=True, ConsecPSPadre:=drowPsTamaños("ConsecPSPadre").ToString.ToEntero)
|
||||||
If Consec > 0 Then
|
If Consec > 0 Then
|
||||||
ListaPScargo.Add(drowPsTamaños("CvePS").ToString.ToEntero)
|
ListaPScargo.Add(drowPsTamaños("CvePS").ToString.ToEntero)
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
Next
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
Modalidad = ModalidadBack
|
Modalidad = ModalidadBack
|
||||||
End If
|
|
||||||
ObjAcum.Dispose()
|
|
||||||
|
|
||||||
Return ListaPScargo
|
Return ListaPScargo
|
||||||
End Function
|
End Function
|
||||||
Private Sub EliminarUsados(Consec As Integer)
|
Private Sub EliminarUsados(Consec As Integer)
|
||||||
Dim DTTamanios As New DataTable
|
|
||||||
|
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
'ELIMINAR EL USADO EXTRAS
|
||||||
|
For Each drow As DataRow In TmpDT.Select($"ConsecPSPadre ={Consec}")
|
||||||
|
drow.Delete()
|
||||||
|
Next
|
||||||
|
|
||||||
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
'ELIMINAR LOS USADOS QUE SE MANDAN A RECEPCION
|
||||||
|
For Each drow As DataRow In TmpDT.Select($"Consec ={Consec}")
|
||||||
DTTamanios = ObjAcum.DtResultados
|
For Each RowRecepcionUsados As DataRow In TmpDTRecepcionUsados.Rows
|
||||||
Dim DTCvePSCostos = ObjAcum.DtResultados.FiltraParametros("", "", {"CvePSCargo"})
|
If (RowRecepcionUsados("CvePSRelacionado").ToString() = drow("CvePS").ToString()) Then
|
||||||
|
RowRecepcionUsados.Delete()
|
||||||
If Not TmpDT.Columns.Contains("Eliminar") Then
|
End If
|
||||||
TmpDT.Columns.Add("Eliminar", GetType(Integer))
|
|
||||||
End If
|
|
||||||
|
|
||||||
For Each drow As DataRow In TmpDT.FiltraParametros($"Consec ={Consec}").Rows
|
|
||||||
For Each drow2 As DataRow In DTCvePSCostos.Rows
|
|
||||||
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
|
|
||||||
drow("Eliminar") = 1
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
Next
|
Next
|
||||||
|
Next
|
||||||
|
|
||||||
Dim TmpDTView As New DataView(TmpDT)
|
TmpDT.AcceptChanges()
|
||||||
TmpDTView.RowFilter = "Eliminar = 1"
|
TmpDTRecepcionUsados.AcceptChanges()
|
||||||
|
|
||||||
For Each dRowEliminar As DataRowView In TmpDTView
|
|
||||||
For Each RowRecepcionUsados As DataRow In TmpDTRecepcionUsados.Rows
|
|
||||||
If (RowRecepcionUsados("CvePS").ToString() = dRowEliminar("CvePS").ToString()) Then
|
|
||||||
RowRecepcionUsados.Delete()
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
dRowEliminar.Delete()
|
|
||||||
Next
|
|
||||||
|
|
||||||
TmpDT.AcceptChanges()
|
|
||||||
TmpDTRecepcionUsados.AcceptChanges()
|
|
||||||
|
|
||||||
End If
|
|
||||||
ObjAcum.Dispose()
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
@@ -4292,7 +4292,7 @@ Partial Class Ventas
|
|||||||
Retorno = True
|
Retorno = True
|
||||||
|
|
||||||
Else
|
Else
|
||||||
CveVenta = -1
|
ViewState("CveVenta") = -1
|
||||||
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -9121,7 +9121,12 @@ Partial Class Ventas
|
|||||||
'Si es devolucion se agregan a la tabla de Vta_VentasDetalleDevolucion
|
'Si es devolucion se agregan a la tabla de Vta_VentasDetalleDevolucion
|
||||||
If factura.AplicaDevolucion Then
|
If factura.AplicaDevolucion Then
|
||||||
If Not ObjVentas.AddVentaDetalleDevolucion(Row("CveVentaDetalle").ToString.ToEntero, ObjVentas.CveVentaDetalle, Row("Cantidad").ToString.ToDouble) Then
|
If Not ObjVentas.AddVentaDetalleDevolucion(Row("CveVentaDetalle").ToString.ToEntero, ObjVentas.CveVentaDetalle, Row("Cantidad").ToString.ToDouble) Then
|
||||||
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolucion.")
|
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
|
||||||
|
End If
|
||||||
|
If ErrorList.Count = 0 Then
|
||||||
|
If Not ObjEventos.AddEventoBitacora(String.Format("Se aplicó una devolución en Folio: <a href=""/Ventas/Ventas.aspx?CveVenta={0}"" target=""_blank"">{1}</a>", factura.CveVenta, factura.SerieFolio), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaDevolucion) Then
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar la bitacora de devolución.")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -23173,6 +23178,8 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'CUANDO ES CREAR APARTIR DE SE LIMPIAN FUNCIONALIDADES DE DOCUMENTOS YA REGISTRADOS
|
'CUANDO ES CREAR APARTIR DE SE LIMPIAN FUNCIONALIDADES DE DOCUMENTOS YA REGISTRADOS
|
||||||
BtnGenerarRemision.Visible = False
|
BtnGenerarRemision.Visible = False
|
||||||
|
BtnEditarRemision.Visible = False
|
||||||
|
BtnPermisoEditarRemision.Visible = False
|
||||||
BtnPermisoEditarCotizacion.Visible = False
|
BtnPermisoEditarCotizacion.Visible = False
|
||||||
BtnEditarCotizacion.Visible = False
|
BtnEditarCotizacion.Visible = False
|
||||||
BtnGenerarOS.Visible = False
|
BtnGenerarOS.Visible = False
|
||||||
@@ -23480,154 +23487,136 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
Private Sub CalculaUsados()
|
Private Sub CalculaUsados()
|
||||||
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then
|
||||||
|
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
|
||||||
|
|
||||||
|
Dim DTCvePSCostos As DataTable
|
||||||
|
DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
||||||
|
|
||||||
|
If Not TmpDT.Columns.Contains("Eliminar") Then
|
||||||
|
TmpDT.Columns.Add("Eliminar", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each drow As DataRow In TmpDT.Rows
|
||||||
|
For Each drow2 As DataRow In DTCvePSCostos.Rows
|
||||||
|
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
|
||||||
|
drow("Eliminar") = 1
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim TmpDTView As New DataView(TmpDT)
|
||||||
|
TmpDTView.RowFilter = "Eliminar = 1"
|
||||||
|
|
||||||
|
For Each dRowEliminar As DataRowView In TmpDTView
|
||||||
|
dRowEliminar.Delete()
|
||||||
|
Next
|
||||||
|
|
||||||
|
TmpDT.AcceptChanges()
|
||||||
|
If ViewState("CargoUsado").ToString = "False" Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim CveUnidadMedidaPSA As Integer = -1
|
||||||
|
Dim UnidadMedidaPSA As String = "Unidad"
|
||||||
|
Dim CveClacificacionPSA As Integer = -1
|
||||||
|
|
||||||
|
Dim ClacificacionPSA As String = ""
|
||||||
|
|
||||||
|
Dim CveSubProyectoPSA As Integer = -1
|
||||||
|
Dim SubProyectoPSA As String = ""
|
||||||
|
|
||||||
|
Dim PSPSA As String = ""
|
||||||
|
|
||||||
|
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||||
|
'AgregarProductoServicio(1, CveUnidadMedidaPSA, UnidadMedidaPSA, CveClacificacionPSA, ClacificacionPSA, CvePSPSA, PSPSA, "", ImporteCargo, 0, -1, "", CveSubProyectoPSA, SubProyectoPSA)
|
||||||
|
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("CveUnidadMedida", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("UnidadMedida", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("CveClacificacion", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("Clacificacion", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("PS", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
||||||
|
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
|
||||||
|
|
||||||
|
For Each DrowPartidas As DataRow In TmpDT.Rows
|
||||||
|
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
|
||||||
|
|
||||||
|
If CveTamanioTemp > 0 Then
|
||||||
|
|
||||||
|
Dim DTTamanioTemp As New DataTable
|
||||||
|
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
'' If ClienteEsDistribuidor Then
|
CveSubProyectoPSA = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
||||||
|
SubProyectoPSA = DrowPartidas("SubProyecto").ToString
|
||||||
|
|
||||||
Dim DTTamanios As DataTable = Nothing
|
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||||
' Dim ObjAcum As New ClsAcumuladores
|
If ObjProductosServicios.GetPS(CvePsTemp, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
CveUnidadMedidaPSA = ObjProductosServicios.CveUnidadMedida
|
||||||
|
CveClacificacionPSA = ObjProductosServicios.CveClasificacion
|
||||||
|
UnidadMedidaPSA = ObjProductosServicios.DtResultados.FiltroPrimeroValor("UnidadMedida")
|
||||||
|
PSPSA = ObjProductosServicios.PS
|
||||||
|
End If
|
||||||
|
ObjProductosServicios.Dispose()
|
||||||
|
|
||||||
'If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
|
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", " Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||||
|
Else
|
||||||
|
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", Orderby:="Clasificacion")
|
||||||
|
End If
|
||||||
|
|
||||||
DTTamanios = GlobalDTAcumTamaños() 'ObjAcum.DtResultados
|
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||||
|
|
||||||
Dim DTCvePSCostos As DataTable
|
|
||||||
DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
|
||||||
|
|
||||||
If Not TmpDT.Columns.Contains("Eliminar") Then
|
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||||
TmpDT.Columns.Add("Eliminar", GetType(Integer))
|
|
||||||
End If
|
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||||
|
|
||||||
|
If (dRowUpdate("CvePS").ToString.ToEntero = CvePsTemp) Then
|
||||||
|
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString.ToDecimal + DrowPartidas("Cantidad").ToString.ToDecimal
|
||||||
|
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString.ToDecimal + ImporteCargo
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
DTPSTemp.AcceptChanges()
|
||||||
|
|
||||||
|
Else
|
||||||
|
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
||||||
|
|
||||||
|
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString.ToDecimal
|
||||||
|
dRowNuevo("PU") = Cargo
|
||||||
|
dRowNuevo("CveUnidadMedida") = CveUnidadMedidaPSA
|
||||||
|
dRowNuevo("UnidadMedida") = UnidadMedidaPSA
|
||||||
|
dRowNuevo("CveClacificacion") = CveClacificacionPSA
|
||||||
|
dRowNuevo("Clacificacion") = ClacificacionPSA
|
||||||
|
dRowNuevo("CvePS") = CvePsTemp
|
||||||
|
dRowNuevo("PS") = PSPSA
|
||||||
|
|
||||||
|
dRowNuevo("CveSubProyecto") = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
||||||
|
dRowNuevo("SubProyecto") = DrowPartidas("SubProyecto").ToString
|
||||||
|
|
||||||
|
DTPSTemp.Rows.Add(dRowNuevo)
|
||||||
|
DTPSTemp.AcceptChanges()
|
||||||
|
End If
|
||||||
|
|
||||||
For Each drow As DataRow In TmpDT.Rows
|
|
||||||
For Each drow2 As DataRow In DTCvePSCostos.Rows
|
|
||||||
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
|
|
||||||
drow("Eliminar") = 1
|
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Next
|
|
||||||
|
|
||||||
Dim TmpDTView As New DataView(TmpDT)
|
|
||||||
TmpDTView.RowFilter = "Eliminar = 1"
|
|
||||||
|
|
||||||
For Each dRowEliminar As DataRowView In TmpDTView
|
|
||||||
dRowEliminar.Delete()
|
|
||||||
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
TmpDT.AcceptChanges()
|
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
||||||
If ViewState("CargoUsado").ToString = "False" Then
|
Modalidad = "A"
|
||||||
Exit Sub
|
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
|
||||||
|
AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
||||||
|
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").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)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
|
||||||
|
|
||||||
Dim CveUnidadMedidaPSA As Integer = -1
|
|
||||||
Dim UnidadMedidaPSA As String = "Unidad"
|
|
||||||
Dim CveClacificacionPSA As Integer = -1
|
|
||||||
|
|
||||||
Dim ClacificacionPSA As String = ""
|
|
||||||
|
|
||||||
Dim CveSubProyectoPSA As Integer = -1
|
|
||||||
Dim SubProyectoPSA As String = ""
|
|
||||||
|
|
||||||
Dim PSPSA As String = ""
|
|
||||||
|
|
||||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
|
||||||
'AgregarProductoServicio(1, CveUnidadMedidaPSA, UnidadMedidaPSA, CveClacificacionPSA, ClacificacionPSA, CvePSPSA, PSPSA, "", ImporteCargo, 0, -1, "", CveSubProyectoPSA, SubProyectoPSA)
|
|
||||||
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("CveUnidadMedida", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("UnidadMedida", GetType(String))
|
|
||||||
DTPSTemp.Columns.Add("CveClacificacion", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("Clacificacion", GetType(String))
|
|
||||||
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("PS", GetType(String))
|
|
||||||
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
|
||||||
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
|
|
||||||
|
|
||||||
For Each DrowPartidas As DataRow In TmpDT.Rows
|
|
||||||
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
|
|
||||||
|
|
||||||
If CveTamanioTemp > 0 Then
|
|
||||||
|
|
||||||
Dim DTTamanioTemp As New DataTable
|
|
||||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString.ToEntero
|
|
||||||
|
|
||||||
|
|
||||||
CveSubProyectoPSA = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
|
||||||
SubProyectoPSA = DrowPartidas("SubProyecto").ToString
|
|
||||||
|
|
||||||
If ObjProductosServicios.GetPS(CvePsTemp, -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
CveUnidadMedidaPSA = ObjProductosServicios.CveUnidadMedida
|
|
||||||
CveClacificacionPSA = ObjProductosServicios.CveClasificacion
|
|
||||||
UnidadMedidaPSA = ObjProductosServicios.DtResultados.FiltroPrimeroValor("UnidadMedida")
|
|
||||||
PSPSA = ObjProductosServicios.PS
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", " Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
|
||||||
Else
|
|
||||||
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", Orderby:="Clasificacion")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
|
||||||
|
|
||||||
|
|
||||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
|
||||||
|
|
||||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
|
||||||
|
|
||||||
If (dRowUpdate("CvePS").ToString.ToEntero = CvePsTemp) Then
|
|
||||||
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString.ToDecimal + DrowPartidas("Cantidad").ToString.ToDecimal
|
|
||||||
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString.ToDecimal + ImporteCargo
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
DTPSTemp.AcceptChanges()
|
|
||||||
|
|
||||||
Else
|
|
||||||
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
|
||||||
|
|
||||||
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString.ToDecimal
|
|
||||||
dRowNuevo("PU") = Cargo
|
|
||||||
dRowNuevo("CveUnidadMedida") = CveUnidadMedidaPSA
|
|
||||||
dRowNuevo("UnidadMedida") = UnidadMedidaPSA
|
|
||||||
dRowNuevo("CveClacificacion") = CveClacificacionPSA
|
|
||||||
dRowNuevo("Clacificacion") = ClacificacionPSA
|
|
||||||
dRowNuevo("CvePS") = CvePsTemp
|
|
||||||
dRowNuevo("PS") = PSPSA
|
|
||||||
|
|
||||||
dRowNuevo("CveSubProyecto") = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
|
||||||
dRowNuevo("SubProyecto") = DrowPartidas("SubProyecto").ToString
|
|
||||||
|
|
||||||
DTPSTemp.Rows.Add(dRowNuevo)
|
|
||||||
DTPSTemp.AcceptChanges()
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
|
||||||
Modalidad = "A"
|
|
||||||
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
|
|
||||||
AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
|
||||||
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").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)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
ObjProductosServicios.Dispose()
|
|
||||||
'End If
|
|
||||||
|
|
||||||
' ObjAcum.Dispose()
|
|
||||||
'End If
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer) As Boolean
|
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer) As Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user