RNC de bonificacion por ps cargo, subir PA_Acum_DistribuidorMovtosGet

This commit is contained in:
2021-07-21 12:37:40 -07:00
parent 791848dc5a
commit 19ee45b2d5
2 changed files with 48 additions and 44 deletions

View File

@@ -4289,7 +4289,7 @@
<ContentTemplate>
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
DataKeyNames="CveMovto, CveCliente,Cantidad,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto"
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>

View File

@@ -9511,51 +9511,55 @@ Partial Class Clientes
End Function
Private Sub CreaObjetosVenta(Tipo As Integer)
Dim SubTotal As Decimal = 0D
Dim IVA As Decimal = 0D
Dim CveSubProyecto As Integer = -1
TmpDT.Rows.Clear()
TmpDT.AcceptChanges()
For Each GvRow As GridViewRow In GvAcum.Rows
If Tipo = 1 Then
If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkCargo").Checked Then
SubTotal = SubTotal + GvRow.DataKey("ImporteCargo").ToDecimal()
End If
ElseIf Tipo = 2 Then
If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkBonificacion").Checked Then
SubTotal = SubTotal + GvRow.DataKey("ImporteBonificacion").ToDecimal()
End If
End If
CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
If GvRow.FCCheckBox("ChkBonificacion").Checked OrElse GvRow.FCCheckBox("ChkCargo").Checked Then
CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
Dim PU As Decimal = 0
Dim CvePSCargo As Integer = GvRow.DataKey("CvePSCargo").ToEntero()
Dim CveUnidadMedida As Integer = 0
Dim CveClasificacion As Integer = 0
Dim UnidadMedida As String = ""
Dim Clasificacion As String = ""
Dim PS As String = ""
Dim PorcentajeIVA As Decimal = 0.16D
If Tipo = 1 Then
If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkCargo").Checked Then
PU = GvRow.DataKey("Cargo").ToDecimal()
End If
ElseIf Tipo = 2 Then
If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkBonificacion").Checked Then
PU = GvRow.DataKey("Bonificacion").ToDecimal()
End If
End If
If CvePSCargo > 0 AndAlso PU > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSCargo).Rows(0)
If Dr IsNot Nothing Then
CveUnidadMedida = Dr("CveUnidadMedida").ToString().ToEntero()
CveClasificacion = Dr("CveClasificacion").ToString().ToEntero()
PS = Dr("PSCodigo").ToString()
UnidadMedida = Dr("UnidadMedida").ToString()
Clasificacion = Dr("Clasificacion").ToString()
End If
AgregarProductoServicio(Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePSCargo, PS, "Clientes/Usados", PU, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero(),
DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
End If
End If
Next
Dim CvePS As Integer = UsuarioActual.Empresa.Funcionalidad(534).ToEntero() 'CvePS Distruibuidor Bonificación Nota
Dim CveUnidadMedida As Integer = 0
Dim CveClasificacion As Integer = 0
Dim UnidadMedida As String = ""
Dim Clasificacion As String = ""
Dim PS As String = ""
Dim PorcentajeIVA As Decimal = 0D
If CvePS > 0 Then
If SubTotal > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
If Dr IsNot Nothing Then
CveUnidadMedida = Dr("CveUnidadMedida").ToString().ToEntero()
CveClasificacion = Dr("CveClasificacion").ToString().ToEntero()
PS = Dr("PSCodigo").ToString()
UnidadMedida = Dr("UnidadMedida").ToString()
Clasificacion = Dr("Clasificacion").ToString()
End If
PorcentajeIVA = 0.16D
IVA = SubTotal * PorcentajeIVA
End If
End If
TmpDT.Rows.Clear()
TmpDT.AcceptChanges()
AgregarProductoServicio(1, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Clientes/Usados", SubTotal, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero(),
DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
Dim SubTotalFactura As Decimal = TmpDT.SUMD("Total")
Dim IVAFactura As Decimal = TmpDT.SUMD("ImporteIVA")
Dim Folio As Integer = -1
Dim Serie As String = ""
@@ -9683,14 +9687,14 @@ Partial Class Clientes
ObjFactura.Det_FechaOrdenCompra = ""
ObjFactura.MonedaAbreviatura = ""
ObjFactura.SubTotal = SubTotal
ObjFactura.SubTotal = SubTotalFactura
ObjFactura.Descuento = 0
ObjFactura.Amortizacion = 0
ObjFactura.IVA = IVA
ObjFactura.IVA = IVAFactura
ObjFactura.RetIVA = 0
ObjFactura.RetISR = 0
ObjFactura.IEPS = 0
ObjFactura.Total = SubTotal + IVA
ObjFactura.Total = SubTotalFactura + IVAFactura
ObjFactura.DtDetalle = TmpDT
ObjFactura.DtPagos = DtPagos
ObjFactura.DtPromociones = DtPromociones