Promociones de baterias, editar observaciones, generacion de PDF en otro hilo

This commit is contained in:
2022-06-18 14:37:58 -07:00
parent 9521b6b677
commit 4b768fdf5e
2 changed files with 209 additions and 62 deletions

View File

@@ -709,6 +709,20 @@ Partial Class PV
ViewState("CveAutorizacion") = value
End Set
End Property
Private Property ClienteCodigoRegimenFiscal As String
Get
If ViewState("ClienteCodigoRegimenFiscal") Is Nothing Then
ViewState("ClienteCodigoRegimenFiscal") = ""
End If
Return ViewState("ClienteCodigoRegimenFiscal").ToString
End Get
Set(value As String)
ViewState("ClienteCodigoRegimenFiscal") = value
End Set
End Property
#End Region
#Region "PROPIEDADES DE PUNTO DE VENTA"
@@ -2431,8 +2445,10 @@ Partial Class PV
'End If
End Sub
Private Sub CargaUsoCFDI()
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
ClienteCodigoRegimenFiscal = "-1"
End If
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=ClienteCodigoRegimenFiscal)
DdlUsoCFDI.DataBind()
End Sub
Private Sub CargaNuevaFactura(OVenta As ClsVentas)
@@ -2635,6 +2651,7 @@ Partial Class PV
ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR
ViewState("CodCliente") = ObjCliente.Codigo
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
ClienteCodigoRegimenFiscal = ObjCliente.DtResultados.Rows(0)("CodigoRegimenFiscal").ToString()
If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then
TrEsDistribuidor.Visible = True
@@ -2687,6 +2704,13 @@ Partial Class PV
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString)
'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
ClienteCodigoRegimenFiscal = "616"
End If
End If
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
@@ -2865,6 +2889,13 @@ Partial Class PV
DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString)
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
ClienteCodigoRegimenFiscal = "616"
End If
End If
If CveVenta < 0 Then TxtAtencionA.Text = ObjCliente.DtResultados.Rows(0)("Contacto").ToString
@@ -2894,6 +2925,13 @@ Partial Class PV
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33)
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
ClienteCodigoRegimenFiscal = "616"
End If
End If
End If
@@ -4204,12 +4242,18 @@ Partial Class PV
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
If PrecioSugerido > 0 AndAlso TxtDescuento.Text.ToDecimal() > 0 Then
If PrecioSugerido > 0 Then
TxtPrecio.Text = PrecioSugerido.FormatoNumero()
LblPrecio1.Text = PrecioSugerido.FormatoNumero()
'RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString() + ", 2, '.', ',');", "A1")
End If
If IsNumeric(TxtCantidad.Text.Trim) Then
LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString.FormatoNumero(2)
Else
LblTotalPS.Text = "0.00"
End If
If ChkAjuste.Checked Then
CalculaMesesUso()
UpAjuste.Update()
@@ -4405,6 +4449,27 @@ Partial Class PV
Descuento = 0
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
'LTH AA Paq. 2 baterias, LTH AAA Paq. 02 baterias, LTH AA Paq. 4 baterias, LTH AAA Paq. 4 Baterias
If CvePS.Contiene(521445, 521448, 402917, 402918) Then
'SI TIENE BATERIAS AGREGADAS CON LA MARCA LTH, APLICAR PROMOCION, LA CLASIFICACION DEBE SER ACUMULADORES
If TmpDT.SUMD("Cantidad", "CveMarca IN (819,826,1085,1052) AND CveClasificacion IN (20520,20522,20513,20521,20512,20514,20229)") >= 1D Then
Descuento = 0
SeAjustoPU = True
'Paq. 2 baterias
If CvePS.Contiene(521445, 521448) Then
PUPromocion = 25D
End If
'Paq. 4 baterias
If CvePS.Contiene(402917, 402918) Then
PUPromocion = 40D
End If
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
End If
End If
End If
ObjDescuento.ImporteDescuento = Descuento
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
If SeAjustoPU Then
@@ -4642,6 +4707,7 @@ Partial Class PV
TmpDT.Columns("EliminarDB").DefaultValue = False
TmpDT.Columns.Add("AplicaSerie", GetType(Boolean))
TmpDT.Columns.Add("CveMarca", GetType(Integer))
End Sub
@@ -5014,6 +5080,11 @@ Partial Class PV
Row("EliminarDB") = EliminarDB
If TmpDT.Columns.Contains("CveMarca") Then
Row("CveMarca") = DrPS("CveMarca")
End If
If UsuarioActual.CveEmpresa = 119 Then
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA