E141, CAMPAÑA DE VERANO 2022 YOKOHAMA
This commit is contained in:
@@ -343,6 +343,14 @@ Partial Class Ventas
|
||||
ViewState("DTRemisiones") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property ListaDescuentos As List(Of Descuentos)
|
||||
Get
|
||||
Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Descuentos)))
|
||||
End Get
|
||||
Set(value As List(Of Descuentos))
|
||||
ViewState("ListaDescuentos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property RemisionesLista As List(Of Integer)
|
||||
Get
|
||||
Return If(IsNothing(ViewState("RemisionesLista")), Nothing, CType(ViewState("RemisionesLista"), List(Of Integer)))
|
||||
@@ -2318,6 +2326,8 @@ Partial Class Ventas
|
||||
RemisionesLista = New List(Of Integer)
|
||||
Pedidos2Lista = New List(Of Integer)
|
||||
CotizacionesLista = New List(Of Integer)
|
||||
ListaDescuentos = New List(Of Descuentos)
|
||||
|
||||
CuentasContablesInvalidas = New StringBuilder
|
||||
CvePrePoliza = 0
|
||||
TotalOtrosConceptos = 0
|
||||
@@ -7968,13 +7978,25 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
|
||||
Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
|
||||
If ConsecEliminar > 0 Then
|
||||
Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
|
||||
If descEliminar IsNot Nothing Then
|
||||
ListaDescuentos.Remove(descEliminar)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If TmpDT.Rows(e.RowIndex)("CvePS").ToString() <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then
|
||||
'eliminar y cargar el ps ***
|
||||
Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida")
|
||||
Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion")
|
||||
|
||||
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
|
||||
ObjDescuento = CalcularDescuentos(GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero(), Cantidad, PU)
|
||||
End If
|
||||
|
||||
TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex))
|
||||
CalculaUsados()
|
||||
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text,
|
||||
@@ -7982,18 +8004,17 @@ Partial Class Ventas
|
||||
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
||||
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
|
||||
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
|
||||
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle)
|
||||
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, ObjDescuento:=ObjDescuento)
|
||||
|
||||
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
|
||||
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
|
||||
GvPS.EditIndex = -1
|
||||
GvPS.DataSource = TmpDT
|
||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
GvPS.DataBind()
|
||||
CargaGVInv(DtInv)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
|
||||
|
||||
GvPS.EditIndex = -1
|
||||
GvPS.DataSource = TmpDT
|
||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
GvPS.DataBind()
|
||||
CargaGVInv(DtInv)
|
||||
CalculaUsados()
|
||||
End If
|
||||
|
||||
@@ -8071,6 +8092,12 @@ Partial Class Ventas
|
||||
TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue
|
||||
End If
|
||||
|
||||
'RELACIONAL PS CON EL DESCUENTO
|
||||
If ObjDescuento IsNot Nothing Then
|
||||
ObjDescuento.Consec = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
|
||||
DrPS = Nothing
|
||||
|
||||
GvPS.EditIndex = -1
|
||||
@@ -8081,6 +8108,10 @@ Partial Class Ventas
|
||||
CalculaUsados()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
|
||||
ListaDescuentos.Add(ObjDescuento)
|
||||
End If
|
||||
|
||||
CalculaTotalesVenta()
|
||||
|
||||
'SI EL PORLET DE COMERCIO EXTERIOR EXTERIOR ESTA VISIBLE SE ACTUALIZAN LOS PRODUCTOS DEL GRIDVIEW
|
||||
@@ -8099,6 +8130,16 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing Then
|
||||
Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
|
||||
If ConsecEliminar > 0 Then
|
||||
Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
|
||||
If descEliminar IsNot Nothing Then
|
||||
ListaDescuentos.Remove(descEliminar)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim DbRow As DataRow = Nothing
|
||||
DbRow = TmpDT.Rows(e.RowIndex)
|
||||
TmpDT.Rows.Remove(DbRow)
|
||||
@@ -17851,8 +17892,11 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
Dim Cant As Integer = 1
|
||||
Dim CveMarcaPromocion As Integer = -1
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
|
||||
CveMarcaPromocion = dr("CveMarca").ToString().ToEntero()
|
||||
TipoPromo = dr("TipoPromocion").ToString().ToEntero()
|
||||
CantMinima = dr("CantidadMinima").ToString().ToEntero()
|
||||
IncluyeImpuestos = dr("IncluyeImpuestos").ToString() = "True"
|
||||
@@ -17970,6 +18014,26 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
'YOKOHAMA
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso CveRinTamañoPS > 0 AndAlso CveMarcaPromocion.Contiene(800, 912, 1238, 1381, 1456, 1528, 1600, 1672, 1807) Then
|
||||
Dim DtRines As DataTable = Nothing
|
||||
Dim ObjGral As New ClsGenerales
|
||||
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
|
||||
DtRines = ObjGral.DtResultados.Copy()
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
|
||||
If CveMarcaPromocion > 0 Then
|
||||
ObjDescuento.NombrePromo = "YOKOHAMA VERANO" 'dr("NombrePromocion").ToString()
|
||||
ObjDescuento.CveMarca = CveMarcaPromocion
|
||||
Dim Rin As String = DtRines.FiltroPrimeroValor("RinTamaño", $"CveRinTamaño = {CveRinTamañoPS}")
|
||||
Dim PromoDescuento = (Descuento * (1 + If(IncluyeImpuestos, PorcentajeIVA, 0))).RoundSQL(2)
|
||||
|
||||
ObjDescuento.ObsDescuento = String.Format("RIN {0} BONO ${1:N2}", Rin, PromoDescuento)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2)
|
||||
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
|
||||
If SeAjustoPU Then
|
||||
@@ -18009,10 +18073,14 @@ Partial Class Ventas
|
||||
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
|
||||
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
||||
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
|
||||
ImporteProntoPago:=ObjDescuento.ImporteProntoPago)
|
||||
ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento)
|
||||
|
||||
CalculaUsados()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
|
||||
ListaDescuentos.Add(ObjDescuento)
|
||||
End If
|
||||
|
||||
CalculaTotalesVenta()
|
||||
|
||||
LimpiaAgregar()
|
||||
@@ -18144,7 +18212,7 @@ Partial Class Ventas
|
||||
Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
|
||||
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
|
||||
Optional ImporteProntoPago As Decimal = 0) As Boolean
|
||||
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Descuentos = Nothing) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
Try
|
||||
@@ -18409,6 +18477,11 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'RELACIONAL PS CON EL DESCUENTO
|
||||
If ObjDescuento IsNot Nothing Then
|
||||
ObjDescuento.Consec = Row("Consec").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
'RECARGAR GV
|
||||
TmpDT.Rows.Add(Row)
|
||||
|
||||
@@ -19168,6 +19241,26 @@ Partial Class Ventas
|
||||
CargaGVInv(DtInv)
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ListaDescuentos.Count > 0 Then
|
||||
TxtObsFact.Text = ""
|
||||
Dim Titulo As String = ListaDescuentos.FirstOrDefault().NombrePromo
|
||||
Dim strPromos As New StringBuilder
|
||||
If Not String.IsNullOrEmpty(Titulo) Then
|
||||
|
||||
For Each Promo As Descuentos In ListaDescuentos
|
||||
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
|
||||
Next
|
||||
|
||||
If strPromos.Length > 2 Then
|
||||
strPromos.Remove(strPromos.Length - 2, 2)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
TxtObsFact.Text = String.Format("{0} {1}", Titulo, strPromos.ToString())
|
||||
End If
|
||||
|
||||
UPObservaciones.Update()
|
||||
UpContado.Update()
|
||||
UpPS.Update()
|
||||
RegistraScript("BorraDescuentos();", "BorraDescuentos")
|
||||
@@ -33000,11 +33093,15 @@ Partial Class Ventas
|
||||
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
'End Sub
|
||||
Partial Class Descuentos
|
||||
Public Consec As Integer
|
||||
Public ImporteDescuento As Decimal = 0
|
||||
Public CvePromocionDetalle As Integer = -1
|
||||
Public PU As Decimal = 0
|
||||
Public EsPUModificado As Boolean = False
|
||||
Public ImporteProntoPago As Decimal = 0
|
||||
Public NombrePromo As String = ""
|
||||
Public CveMarca As Integer = -1
|
||||
Public ObsDescuento As String = ""
|
||||
End Class
|
||||
|
||||
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Reference in New Issue
Block a user