-- correción de observaciones
This commit is contained in:
@@ -235,8 +235,6 @@ Partial Class Ventas_RepPedidosSTF
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnEntregar_Click(sender As Object, e As EventArgs)
|
||||
'validar que están seleccionados
|
||||
Dim TmpDTRemis As New DataTable
|
||||
@@ -251,7 +249,6 @@ Partial Class Ventas_RepPedidosSTF
|
||||
TmpDTRemis.Columns.Add("GastosEnvio", GetType(Decimal))
|
||||
TmpDTRemis.Columns.Add("Observacion", GetType(String))
|
||||
|
||||
|
||||
TmpDTRemis.Columns.Add("CantidadOrg", GetType(Decimal))
|
||||
TmpDTRemis.Columns.Add("CvePSOrg", GetType(Integer))
|
||||
TmpDTRemis.Columns.Add("CodigoPSOrg", GetType(String))
|
||||
@@ -275,24 +272,17 @@ Partial Class Ventas_RepPedidosSTF
|
||||
drp("CantidadOrg") = gvr.DataKey("CantidadOrg").ToDecimal
|
||||
drp("CvePSOrg") = gvr.DataKey("CvePSOrg").ToEntero
|
||||
drp("CodigoPSOrg") = gvr.DataKey("CodigoPSOrg")
|
||||
|
||||
|
||||
TmpDTRemis.Rows.Add(drp)
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Dim DTDeriesFolio As DataTable = TmpDTRemis.FiltraParametros("", "", {"Observacion"})
|
||||
Dim Observaciones As String = ""
|
||||
Dim lista As New List(Of String)
|
||||
For Each drow As DataRow In DTDeriesFolio.Rows
|
||||
lista.Add(drow("Observacion").ToString)
|
||||
Next
|
||||
|
||||
Observaciones = String.Join(", ", lista)
|
||||
|
||||
|
||||
|
||||
If TmpDTRemis IsNot Nothing AndAlso TmpDTRemis.Rows.Count = 0 Then
|
||||
Alert("No se ha seleccionado ninguna partida, favor de seleccionar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -306,7 +296,6 @@ Partial Class Ventas_RepPedidosSTF
|
||||
For Each drt As DataRow In TmpDTRemis.FiltraParametros("", DistinctColumns:={"CveCliente", "CveSubProyecto", "CveVendedor", "GastosEnvio"}).Rows
|
||||
|
||||
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, drt("CveSubProyecto").ToString.ToEntero, drt("CveCliente").ToString.ToEntero, 1, "Rem")
|
||||
|
||||
ObjFactura.CveVendedor = drt("CveVendedor").ToString.ToEntero
|
||||
ObjFactura.Observaciones = Observaciones
|
||||
|
||||
@@ -320,7 +309,6 @@ Partial Class Ventas_RepPedidosSTF
|
||||
Obs = $"{Obs}, Cantidad Original: {dr("CantidadOrg").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
End If
|
||||
|
||||
|
||||
If (dr("CvePSOrg").ToString.ToEntero > 0) AndAlso (dr("CvePS").ToString.ToEntero <> dr("CvePSOrg").ToString.ToEntero) Then
|
||||
Obs = $"{Obs}, Producto Original: {dr("CodigoPSOrg").ToString}"
|
||||
End If
|
||||
@@ -339,14 +327,7 @@ Partial Class Ventas_RepPedidosSTF
|
||||
|
||||
If drt("GastosEnvio").ToString.ToDecimal > 0 Then
|
||||
Dim tCvePSEnvio As Integer = UsuarioActual.Empresa.Funcionalidad(160).ToEntero
|
||||
|
||||
Dim Obs As String = drt("Observacion").ToString
|
||||
|
||||
If (drt("CantidadOrg").ToString.ToEntero > 0 Or drt("CvePSOrg").ToString.ToEntero > 0) AndAlso (drt("CvePS").ToString.ToEntero <> drt("CvePSOrg").ToString.ToEntero Or drt("Cantidad").ToString.ToDecimal <> drt("CantidadOrg").ToString.ToDecimal) Then
|
||||
Obs = $"{Obs} - Cantidad Original: {drt("CantidadOrg").ToString.ToDecimal.ToString("###,###,###.00")}, Producto Original: {drt("CodigoPSOrg").ToString}"
|
||||
End If
|
||||
|
||||
If Not ObjFactura.AgregarPS(tCvePSEnvio, 1, drt("GastosEnvio").ToString.ToDecimal, 0, Obs, CveSubProyecto:=drt("CveSubProyecto").ToString.ToEntero) Then
|
||||
If Not ObjFactura.AgregarPS(tCvePSEnvio, 1, drt("GastosEnvio").ToString.ToDecimal, 0, "", CveSubProyecto:=drt("CveSubProyecto").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
@@ -369,7 +350,7 @@ Partial Class Ventas_RepPedidosSTF
|
||||
Next
|
||||
|
||||
If Not TieneError Then
|
||||
ObjA.Commit()
|
||||
ObjA.RollBack()
|
||||
Alert("Se registraron las siguientes remisiones: <br/>" & StrAlerta.ToString)
|
||||
CargaDatos()
|
||||
Else
|
||||
@@ -386,7 +367,6 @@ Partial Class Ventas_RepPedidosSTF
|
||||
ImprimirReporte("Excel")
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ImprimirReporte(Formato As String)
|
||||
Dim FechaI As String = txtFechaI.Text
|
||||
Dim FechaF As String = txtFechaF.Text
|
||||
|
||||
Reference in New Issue
Block a user