diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index ee482b9de..f224d9383 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -2446,7 +2446,7 @@ Partial Class Ventas_PVCobranza
Msg = Msg & "
Refacturar"
End If
- Alert(Msg, TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion:="Enviar", TextoSegundoBoton:="Cancelar")
+ Alert(Msg, TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnEnviarMailCancelacion()", TextoConfirmacion:="Enviar", TextoSegundoBoton:="Cancelar", ShowCloseButton:=False)
Else
Msg = resp.Mensaje
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 4d0b8ade4..cd1cf262d 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -9298,7 +9298,14 @@
-
+
+
+
+
+
+
+
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 51889df06..f58e37988 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -10494,10 +10494,16 @@ Partial Class Ventas
Protected Sub EmitirImprimirNew(Optional TipoDoctoViejo As String = "")
+ OrdenarPS(Reeordenar:=False, RecargarGV:=False)
+
If Not ValidaVentaContratoObra() Then
Exit Sub
End If
+ If Not ValidaPorcentajeIVA() Then
+ Exit Sub
+ End If
+
If ValidaPagosContado(TipoDoctoViejo:=TipoDoctoViejo) Then
Exit Sub
End If
@@ -25322,6 +25328,21 @@ Partial Class Ventas
Return Retorno
End Function
+
+ Private Function ValidaPorcentajeIVA() As Boolean
+ Dim Retorno As Boolean = True
+
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
+ Dim DtIVA As DataTable = TmpDT.FiltraParametros("PorcentajeIVA > 0", "", {"PorcentajeIVA"})
+ 'SOLO DEBE TENER PORCENTAJE DE 8 o 16 no ambos
+ If DtIVA.Rows.Count > 1 Then
+ Retorno = False
+ Alert("No se puede tener porcentajes de IVA de 8 y 16% en una sola factura", TipoMensaje.MsgAdvertencia)
+ End If
+ End If
+
+ Return Retorno
+ End Function
#End Region
#Region " SERIE ALMACEN "
@@ -26525,7 +26546,7 @@ Partial Class Ventas
End If
End Sub
- Private Sub OrdenarPS(Optional Reeordenar As Boolean = True)
+ Private Sub OrdenarPS(Optional Reeordenar As Boolean = True, Optional RecargarGV As Boolean = True)
If Reeordenar Then
For Each row As GridViewRow In GvPS.Rows
@@ -26544,8 +26565,10 @@ Partial Class Ventas
TmpDT.AcceptChanges()
- GvPS.DataSource = TmpDT
- GvPS.DataBind()
+ If RecargarGV Then
+ GvPS.DataSource = TmpDT
+ GvPS.DataBind()
+ End If
End Sub
Protected Sub OrdenarGvPS(ByVal sender As Object, ByVal e As EventArgs)
OrdenarPS()
@@ -33904,7 +33927,7 @@ Partial Class Ventas
Next
Return Nothing
End Function
- Private Function AgregaPSCotizacion(Optional RecalculaImpustosLocales As Boolean = True) As Boolean
+ Private Function AgregaPSCotizacion(Optional RecalculaImpustosLocales As Boolean = True, Optional DtOrden As DataTable = Nothing) As Boolean
'Dim ObjFactCotizacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
'Dim TotalCotizacion As Decimal = ObjFactCotizacion.Total 'TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
@@ -33925,11 +33948,17 @@ Partial Class Ventas
' Dr("PorcentajeIVA").ToString().ToDecimal, Dr("IVA").ToString().ToDecimal,
' Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
' CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True)
+
+
+ Dim OrdenManual As Integer = 0
+ If DtOrden IsNot Nothing Then
+ OrdenManual = DtOrden.FiltroPrimeroValor("Orden", $"CveVentaDetalle = {Dr("CveVentaDetalle")}").ToEntero()
+ End If
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
Dr("CvePS").ToString.ToEntero(), Dr("PS").ToString, Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString, Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True,
- PorcentajeIVAFijo:=Dr("PorcentajeIVA").ToString.ToDecimal, CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero())
+ PorcentajeIVAFijo:=Dr("PorcentajeIVA").ToString.ToDecimal, CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString().ToEntero(), OrdenManual:=OrdenManual)
Next
'Dim TotalFactura = TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
@@ -33940,6 +33969,10 @@ Partial Class Ventas
' LastRow("ImporteIVA") = LastRow("ImporteIVA").ToString().ToDecimal() - Diferencia
'End If
+ If DtOrden IsNot Nothing Then
+ OrdenarPS(Reeordenar:=False, RecargarGV:=False)
+ End If
+
CalculaTotalesVenta(RecalculaImpuestosLocales:=RecalculaImpustosLocales)
Return True
Else
@@ -33954,6 +33987,12 @@ Partial Class Ventas
'LIMPIAMOS
'Dim TotalCotizacion As Decimal = TxtTotal.Text.Replace(",", "").ToDecimal()
+ Dim DtOrden As DataTable = Nothing
+
+ 'SI ES UNA VENTA EXISTENTE, CONSEVAR EL ORDEN
+ If CveVenta > 0 Then
+ DtOrden = TmpDT.FiltraParametros("", "Orden", {"CveVentaDetalle", "Orden"})
+ End If
TmpDT.Rows.Clear()
TxtSubTotal.Text = "0.00"
@@ -33978,7 +34017,7 @@ Partial Class Ventas
End If
ObjClientes.Dispose()
- If Not AgregaPSCotizacion(RecalculaImpustosLocales:=False) Then
+ If Not AgregaPSCotizacion(RecalculaImpustosLocales:=False, DtOrden:=DtOrden) Then
Alert("Ocurrió un error al agregar los conceptos de la cotización. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Return False
End If
@@ -35281,8 +35320,6 @@ Partial Class Ventas
End Function
Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String)
-
-
If DdlVendedor.SelectedValue.ToEntero() <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDoctoNuevo = "Ing" Then
Alert("Debe seleccionar un vendedor.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -35419,6 +35456,7 @@ Partial Class Ventas
End If
If FolioFijo = 0 Then CargaFolios(FacturarDocumentoNuevo:=True) 'RECARGA FOLIOS CON EL NUEVO TIPO DOCTO
+
EmitirImprimir(TipoDoctoViejo) 'MANDA A EMITIR - PROCESO VIEJO
End If
@@ -40776,9 +40814,9 @@ Partial Class Ventas
GvExist.DataSource = DtExistencias
GvExist.DataBind()
- 'GvExist.Columns(0).ItemStyle.Width = New Unit(200, UnitType.Pixel)
'ORDENA HACIA LA DERECHA LAS CANTIDAD - OJO!! NO SE USO GV.COLUMNS.COUNT PORQUE LAS COLUMNAS GENERADAS EN BEHIND NO LAS RECONOCE
- For index As Integer = 1 To DtExistencias.Columns.Count - 1
+ 'EL GV TIENE UNA COLUMNA EXTRA DEBE TENER UN INDICE MAYOR
+ For index As Integer = 1 To DtExistencias.Columns.Count
For Each gvr As GridViewRow In GvExist.Rows
gvr.Cells(index).HorizontalAlign = HorizontalAlign.Right
Next
@@ -40791,7 +40829,7 @@ Partial Class Ventas
Protected Sub GvExist_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvExist.RowDataBound
If e.Row.RowType = DataControlRowType.Header OrElse e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.Cells(0).Attributes.Add("colspan", "3")
+ e.Row.Cells(1).Visible = False
End If
End Sub