diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 6b88ea977..8c62cb16c 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -5335,7 +5335,7 @@ - + @@ -5355,7 +5355,7 @@ - + @@ -5368,7 +5368,7 @@ Cantidad - + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index e3a3ec63e..a5d315eef 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5583,6 +5583,11 @@ Partial Class Ventas If TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then BtnsFacturar.Visible = True + 'E119, bloquear la facturación de remisiones que no estén surtidas + If UsuarioActual.CveEmpresa = 119 AndAlso DbRowVenta("SaldoAlmacen").ToString.ToDecimal = 0 Then + BtnsFacturar.Visible = False + End If + LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) 'ACTIVA CONVERSION DE MONEDA @@ -12486,7 +12491,21 @@ Partial Class Ventas Dim i As Integer = 1 'detalles - Dim tPS As String = "" + Dim tPS As String + If UsuarioActual.CveEmpresa = 119 Then + Dim ObjPed As New ClsInventarios + If ObjPed.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then + Dim dttped As DataTable = ObjPed.DtResultados + If Not Obj.DtDetalle.Columns.Contains("NumeroPedimento") Then + Obj.DtDetalle.Columns.Add("NumeroPedimento", Type.GetType("System.String")) + End If + For Each drt As DataRow In Obj.DtDetalle.Rows + Dim Pedimento As String = dttped.FiltroPrimeroValor("Pedimento", $"CveVentaDetalle = {drt("CveVentaDetalle")}") + drt("NumeroPedimento") = Pedimento + Next + End If + ObjPed.Dispose() + End If For Each drr As DataRow In Obj.DtDetalle.Rows If drr("PS").ToString().Length = 1 Then @@ -12520,7 +12539,8 @@ Partial Class Ventas .Noidentificacion = drr("Noidentificacion").ToString(), .CuentaPredial = drr("CuentaPredial").ToString(), .ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal, - .ObjetoImpuesto = drr("CodigoObjetoImpuesto").ToString()} + .ObjetoImpuesto = drr("CodigoObjetoImpuesto").ToString(), + .NumeroPedimento = drr("NumeroPedimento").ToString} 'verifica suma subtotales If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal.RoundSQL(2) <> concepto.Importe.RoundSQL(2) AndAlso Math.Abs(totSubTotal.RoundSQL(2) - concepto.Importe.RoundSQL(2)) <= 0.01 Then 'proceso de ajusta de decimales concepto.Importe = totSubTotal @@ -13768,8 +13788,6 @@ Partial Class Ventas Dim CveSubProyectoContabilizar As Integer Dim SeContabiliza As Boolean = True - Dim SimplificarPrePoliza As Boolean = False - If (UsuarioActual.Empresa.Funcionalidad(343) = "1" AndAlso ObjFactura.TipoDocto = "Ant") Or (ChkAntEspecial.Checked AndAlso ObjFactura.TipoDocto = "Ant") Then SeContabiliza = False End If @@ -14696,8 +14714,6 @@ Partial Class Ventas End If End If - SimplificarPrePoliza = True - Else 'BANCOS Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) @@ -14864,11 +14880,11 @@ Partial Class Ventas End If 'Simplificacion de PrePolizas - If ObjFactura.TipoDocto.Contiene("Egs", "Dev") OrElse SimplificarPrePoliza Then - If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then - Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) - End If - End If + 'If ObjFactura.TipoDocto.Contiene("Egs", "Dev") OrElse SimplificarPrePoliza Then + ' If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then + ' Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) + ' End If + 'End If Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero() @@ -15921,7 +15937,6 @@ Partial Class Ventas Dim ContaIdPoliza As Integer = 0 'Dim ConceptoAmortizacion As Integer = 0 'Dim UsaComplementariaClientes As Boolean = True - Dim SimplificaPrePoliza As Boolean = True ''[IPP] PARCHE TEMPORAL PARA ANTICIPOS DE JAM 'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then @@ -16050,7 +16065,6 @@ Partial Class Ventas 'Pago.CveConceptoPago = 251 ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) - SimplificaPrePoliza = False End If Case "66" @@ -16084,12 +16098,9 @@ Partial Class Ventas 'Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero() 'Pago.Referencia = gvr.DataKey("Folio") - - 'importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal) 'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) - ''Agregamos el 92 'importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) 'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) @@ -16104,10 +16115,6 @@ Partial Class Ventas ErrorConta = True End If - If Not ErrorConta AndAlso SimplificaPrePoliza AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then - Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) - End If - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then If ObjConta.ValorPolizaDescuadre > 0 Then GuardaLogAD($"Ventas/Ventas-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") @@ -18851,6 +18858,7 @@ Partial Class Ventas TmpDT.Columns.Add("NumTurnos", GetType(Decimal)) TmpDT.Columns("NumTurnos").DefaultValue = 0 + TmpDT.Columns.Add("NumeroPedimento", GetType(String)) End Sub Private Sub CreaDTmpC() @@ -27499,7 +27507,7 @@ Partial Class Ventas If AplicarRNC Then TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray) Else - For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString()) + For Each RowEliminar As DataRow In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString()) RowEliminar.Delete() Next End If @@ -27825,13 +27833,13 @@ Partial Class Ventas If Not AplicaNuevoDocumento Then If AplicaNCMasiva Then If NCDescuento Then - For Each RNC In ListaNCDesc + For Each RNC As Modelos.Factura In ListaNCDesc DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero()), True, MissingSchemaAction.Ignore) Next 'SI HAY RNC DE BONIFICACION SE AGREGAN If ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0 Then - For Each RNC In ListaNCBonificacion + For Each RNC As Modelos.Factura In ListaNCBonificacion DtImpuestosBonificacion.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero()), True, MissingSchemaAction.Ignore) Next End If @@ -27874,13 +27882,13 @@ Partial Class Ventas End If Else If ListaRemisionesNC IsNot Nothing Then - For Each RNC In ListaRemisionesNC + For Each RNC As Modelos.Factura In ListaRemisionesNC DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore) Next End If If ListaNCBonificacion IsNot Nothing Then - For Each RNC In ListaNCBonificacion + For Each RNC As Modelos.Factura In ListaNCBonificacion DtImpuestosBonificacion.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore) Next End If @@ -33250,11 +33258,7 @@ Partial Class Ventas GvPS.DataSource = TmpDT GvPS.DataBind() - - End If - - End If UpPS.Update() @@ -35072,7 +35076,7 @@ Partial Class Ventas End If Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero() - Dim CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProyecto", "").ToEntero() + Dim CveProyecto As Integer = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProyecto", "").ToEntero() Dim Proyecto As String = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("Proyecto", "").ToString()