RNC de bonificacion por ps cargo, subir PA_Acum_DistribuidorMovtosGet
This commit is contained in:
@@ -4289,7 +4289,7 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
|
<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"
|
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||||
<Columns>
|
<Columns>
|
||||||
|
|||||||
@@ -9511,51 +9511,55 @@ Partial Class Clientes
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
Private Sub CreaObjetosVenta(Tipo As Integer)
|
Private Sub CreaObjetosVenta(Tipo As Integer)
|
||||||
|
|
||||||
Dim SubTotal As Decimal = 0D
|
|
||||||
Dim IVA As Decimal = 0D
|
|
||||||
Dim CveSubProyecto As Integer = -1
|
Dim CveSubProyecto As Integer = -1
|
||||||
|
|
||||||
|
TmpDT.Rows.Clear()
|
||||||
|
TmpDT.AcceptChanges()
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvAcum.Rows
|
For Each GvRow As GridViewRow In GvAcum.Rows
|
||||||
If Tipo = 1 Then
|
If GvRow.FCCheckBox("ChkBonificacion").Checked OrElse GvRow.FCCheckBox("ChkCargo").Checked Then
|
||||||
If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkCargo").Checked Then
|
CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
|
||||||
SubTotal = SubTotal + GvRow.DataKey("ImporteCargo").ToDecimal()
|
|
||||||
End If
|
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||||
ElseIf Tipo = 2 Then
|
Dim PU As Decimal = 0
|
||||||
If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkBonificacion").Checked Then
|
Dim CvePSCargo As Integer = GvRow.DataKey("CvePSCargo").ToEntero()
|
||||||
SubTotal = SubTotal + GvRow.DataKey("ImporteBonificacion").ToDecimal()
|
Dim CveUnidadMedida As Integer = 0
|
||||||
End If
|
Dim CveClasificacion As Integer = 0
|
||||||
End If
|
Dim UnidadMedida As String = ""
|
||||||
|
Dim Clasificacion As String = ""
|
||||||
CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
|
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
|
Next
|
||||||
|
|
||||||
Dim CvePS As Integer = UsuarioActual.Empresa.Funcionalidad(534).ToEntero() 'CvePS Distruibuidor Bonificación Nota
|
Dim SubTotalFactura As Decimal = TmpDT.SUMD("Total")
|
||||||
Dim CveUnidadMedida As Integer = 0
|
Dim IVAFactura As Decimal = TmpDT.SUMD("ImporteIVA")
|
||||||
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 Folio As Integer = -1
|
Dim Folio As Integer = -1
|
||||||
Dim Serie As String = ""
|
Dim Serie As String = ""
|
||||||
@@ -9683,14 +9687,14 @@ Partial Class Clientes
|
|||||||
ObjFactura.Det_FechaOrdenCompra = ""
|
ObjFactura.Det_FechaOrdenCompra = ""
|
||||||
ObjFactura.MonedaAbreviatura = ""
|
ObjFactura.MonedaAbreviatura = ""
|
||||||
|
|
||||||
ObjFactura.SubTotal = SubTotal
|
ObjFactura.SubTotal = SubTotalFactura
|
||||||
ObjFactura.Descuento = 0
|
ObjFactura.Descuento = 0
|
||||||
ObjFactura.Amortizacion = 0
|
ObjFactura.Amortizacion = 0
|
||||||
ObjFactura.IVA = IVA
|
ObjFactura.IVA = IVAFactura
|
||||||
ObjFactura.RetIVA = 0
|
ObjFactura.RetIVA = 0
|
||||||
ObjFactura.RetISR = 0
|
ObjFactura.RetISR = 0
|
||||||
ObjFactura.IEPS = 0
|
ObjFactura.IEPS = 0
|
||||||
ObjFactura.Total = SubTotal + IVA
|
ObjFactura.Total = SubTotalFactura + IVAFactura
|
||||||
ObjFactura.DtDetalle = TmpDT
|
ObjFactura.DtDetalle = TmpDT
|
||||||
ObjFactura.DtPagos = DtPagos
|
ObjFactura.DtPagos = DtPagos
|
||||||
ObjFactura.DtPromociones = DtPromociones
|
ObjFactura.DtPromociones = DtPromociones
|
||||||
|
|||||||
Reference in New Issue
Block a user