-- emisión con código y PS Alterno

This commit is contained in:
2024-11-19 16:00:54 -07:00
parent b8fabea9d2
commit 766e9bff66

View File

@@ -807,6 +807,13 @@ Partial Class Ventas
End Get
End Property
Private ReadOnly Property ClienteUsaProductoAlterno As Boolean
Get
Return CType(IfNull(ViewState("ClienteUsaProductoAlterno"), "false").ToString(), Boolean)
End Get
End Property
'Cliente
Private ReadOnly Property NombreCliente As String
Get
@@ -6986,6 +6993,7 @@ Partial Class Ventas
LtlClienteMsg.Text += "<br/>Cálculo sin desglose de IVA"
End If
ViewState("CargoUsado") = ObjCliente.CargoUsados
ViewState("ClienteUsaProductoAlterno") = ObjCliente.UsaProductoAlterno
Dim dr As DataRow = Nothing
dr = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal = 1 And Estatus = 'Activo' ")
@@ -13651,13 +13659,13 @@ Partial Class Ventas
Dim totRetIVA As Decimal = Obj.RetIVA
Dim totRetISR As Decimal = Obj.RetISR
Dim i As Integer = 1
Dim tPS As String
Dim tPS, tCodigo As String
'detalles
For Each drr As DataRow In Obj.DtDetalle.Rows
If drr("PS").ToString().Length = 1 Then
If drr("PS").ToString.Length = 1 Then
tPS = drr("Obs").ToString()
Else
If drr("PS").ToString().Length = 0 Then
If drr("PS").ToString.Length = 0 Then
tPS = ""
Else
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
@@ -13665,6 +13673,12 @@ Partial Class Ventas
End If
tPS = tPS.Replace("|", " ")
tCodigo = drr("Noidentificacion").ToString()
If ClienteUsaProductoAlterno AndAlso drr("CodigoAlterno").ToString <> "" Then
tPS = drr("PSAlterno").ToString()
tCodigo = drr("CodigoAlterno").ToString()
End If
If tPS.Length >= 1000 Then
Dim tPSRecortado As String = tPS.Remove(999, tPS.Length - 999)
@@ -13682,7 +13696,7 @@ Partial Class Ventas
.Unidad = drr("UM").ToString(),
.ClaveUnidad = drr("SATClaveUM").ToString(),
.ClaveProdServ = drr("SATClaveProdServ").ToString(),
.Noidentificacion = drr("Noidentificacion").ToString(),
.Noidentificacion = tCodigo,
.CuentaPredial = drr("CuentaPredial").ToString(),
.ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal,
.ObjetoImpuesto = drr("CodigoObjetoImpuesto").ToString(),