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