Correciones al actualizar, facturar contizaciones con usados
This commit is contained in:
@@ -5459,7 +5459,9 @@ Partial Class Ventas
|
||||
DdlMetodoPago33.Enabled = True
|
||||
End If
|
||||
|
||||
If CveVenta <= 0 Or EsCreaApartirDe Or NuevaFactura = 1 Then
|
||||
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
|
||||
|
||||
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 Then
|
||||
CveMetodoPagoCliente = ObjCliente.CveMetodoPago
|
||||
|
||||
|
||||
@@ -6241,7 +6243,9 @@ Partial Class Ventas
|
||||
ViewState("CliNoInt") = ObjCliente.NoInt
|
||||
PlazoCobranza = ObjCliente.PlazoCobranza
|
||||
|
||||
If CveVenta <= 0 Then
|
||||
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
|
||||
|
||||
If CveVenta <= 0 AndAlso CveCotizacion <= 0 Then
|
||||
CveMetodoPagoCliente = ObjCliente.CveMetodoPago
|
||||
|
||||
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
|
||||
@@ -21405,7 +21409,7 @@ Partial Class Ventas
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = ObjetoPDF, .NombreArchivo = $"AcuseCancelacion{Serie}-{Folio}.pdf"})
|
||||
If ObjMail.SendMail(EmpresaActual, Mail, Asunto, Cuerpo, MailCC, LSRutasMail, Displayname:=DisplayName) Then
|
||||
ResultadoMail = 1
|
||||
Alert("El acuse de cancelación ha sido envíado correctamente.")
|
||||
Alert("El acuse de cancelación ha sido envíado correctamente.", JSBtnAceptar:="BtnRefrescarPagina();")
|
||||
Else
|
||||
ResultadoMail = 0
|
||||
End If
|
||||
@@ -26497,6 +26501,12 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
Private Sub BtnEditarCotizacion_Click(sender As Object, e As EventArgs) Handles BtnEditarCotizacion.Click
|
||||
Dim VaFacturarCotizacion As Boolean = False
|
||||
'SI CARGA UNA COTIZACION DEBE GUARDAR TAMBIEN
|
||||
If IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero() > 0 Then
|
||||
ViewState("CveVenta") = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
|
||||
VaFacturarCotizacion = True
|
||||
End If
|
||||
|
||||
If Not TmpDT.Rows.Count > 0 Then
|
||||
Alert("Es necesario agregar al menos un producto o servicio a la factura.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -26567,14 +26577,14 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
OcurrioError = True
|
||||
MensajeError = ObjConta.MensajePolizaDescuadre
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||
' If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
' If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
' OcurrioError = True
|
||||
' MensajeError = ObjConta.MensajePolizaDescuadre
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If OcurrioError Then
|
||||
ObjVentas.RollBack()
|
||||
@@ -26590,9 +26600,14 @@ Partial Class Ventas
|
||||
'GENERA PDF NUEVO
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked)
|
||||
|
||||
If VaFacturarCotizacion Then
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveCotizacion=" & CveVenta & """;")
|
||||
Else
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta & "&&Tipo=Cot"";")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjCGame.Dispose()
|
||||
@@ -26807,13 +26822,10 @@ Partial Class Ventas
|
||||
Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of MVentaDetalleCotizacion)
|
||||
Dim Retorno As New List(Of MVentaDetalleCotizacion)
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
|
||||
|
||||
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
|
||||
|
||||
Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
||||
|
||||
|
||||
For Each Dr As DataRow In DTSeleccionadas.Rows
|
||||
Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||
Dr("Cantidad") = tCantidad
|
||||
@@ -26882,8 +26894,6 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub VerificaCotizaciones(ByRef dt As DataTable)
|
||||
|
||||
Reference in New Issue
Block a user