This commit is contained in:
@@ -4615,7 +4615,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
If Not SeCancela Then
|
If Not SeCancela Then
|
||||||
Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa)
|
Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa)
|
||||||
|
'SI LA REMISION ESTA SALDADA DEBE REVIVIR LOS MOVIMIENTOS COMPLETAMENTE O PARCIALMENTE
|
||||||
If ObjRem.SaldoAlmacen >= 0 Then
|
If ObjRem.SaldoAlmacen >= 0 Then
|
||||||
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||||
|
|
||||||
|
|||||||
@@ -23484,130 +23484,130 @@ Partial Class Ventas
|
|||||||
DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
|
||||||
|
|
||||||
If Not TmpDT.Columns.Contains("Eliminar") Then
|
If Not TmpDT.Columns.Contains("Eliminar") Then
|
||||||
TmpDT.Columns.Add("Eliminar", GetType(Integer))
|
TmpDT.Columns.Add("Eliminar", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each drow As DataRow In TmpDT.Rows
|
||||||
|
For Each drow2 As DataRow In DTCvePSCostos.Rows
|
||||||
|
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
|
||||||
|
drow("Eliminar") = 1
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim TmpDTView As New DataView(TmpDT)
|
||||||
|
TmpDTView.RowFilter = "Eliminar = 1"
|
||||||
|
|
||||||
|
For Each dRowEliminar As DataRowView In TmpDTView
|
||||||
|
dRowEliminar.Delete()
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
TmpDT.AcceptChanges()
|
||||||
|
|
||||||
|
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||||
|
|
||||||
|
Dim CveUnidadMedidaPSA As Integer = -1
|
||||||
|
Dim UnidadMedidaPSA As String = "Unidad"
|
||||||
|
Dim CveClacificacionPSA As Integer = -1
|
||||||
|
|
||||||
|
Dim ClacificacionPSA As String = ""
|
||||||
|
|
||||||
|
Dim CveSubProyectoPSA As Integer = -1
|
||||||
|
Dim SubProyectoPSA As String = ""
|
||||||
|
|
||||||
|
Dim PSPSA As String = ""
|
||||||
|
|
||||||
|
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
||||||
|
'AgregarProductoServicio(1, CveUnidadMedidaPSA, UnidadMedidaPSA, CveClacificacionPSA, ClacificacionPSA, CvePSPSA, PSPSA, "", ImporteCargo, 0, -1, "", CveSubProyectoPSA, SubProyectoPSA)
|
||||||
|
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("CveUnidadMedida", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("UnidadMedida", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("CveClacificacion", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("Clacificacion", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("PS", GetType(String))
|
||||||
|
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
||||||
|
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
|
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
|
||||||
|
|
||||||
|
For Each DrowPartidas As DataRow In TmpDT.Rows
|
||||||
|
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
|
||||||
|
|
||||||
|
If CveTamanioTemp > 0 Then
|
||||||
|
|
||||||
|
Dim DTTamanioTemp As New DataTable
|
||||||
|
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
CveSubProyectoPSA = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
||||||
|
SubProyectoPSA = DrowPartidas("SubProyecto").ToString
|
||||||
|
|
||||||
|
If ObjProductosServicios.GetPS(CvePsTemp, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
CveUnidadMedidaPSA = ObjProductosServicios.CveUnidadMedida
|
||||||
|
CveClacificacionPSA = ObjProductosServicios.CveClasificacion
|
||||||
|
UnidadMedidaPSA = ObjProductosServicios.DtResultados.FiltroPrimeroValor("UnidadMedida")
|
||||||
|
PSPSA = ObjProductosServicios.PS
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each drow As DataRow In TmpDT.Rows
|
|
||||||
For Each drow2 As DataRow In DTCvePSCostos.Rows
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
|
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", " Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||||
drow("Eliminar") = 1
|
Else
|
||||||
Exit For
|
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", Orderby:="Clasificacion")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
||||||
|
|
||||||
|
|
||||||
|
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
||||||
|
|
||||||
|
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
||||||
|
|
||||||
|
If (dRowUpdate("CvePS").ToString.ToEntero = CvePsTemp) Then
|
||||||
|
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString.ToDecimal + DrowPartidas("Cantidad").ToString.ToDecimal
|
||||||
|
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString.ToDecimal + ImporteCargo
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Next
|
|
||||||
|
|
||||||
Dim TmpDTView As New DataView(TmpDT)
|
DTPSTemp.AcceptChanges()
|
||||||
TmpDTView.RowFilter = "Eliminar = 1"
|
|
||||||
|
|
||||||
For Each dRowEliminar As DataRowView In TmpDTView
|
Else
|
||||||
dRowEliminar.Delete()
|
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
||||||
|
|
||||||
Next
|
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString.ToDecimal
|
||||||
|
dRowNuevo("PU") = Cargo
|
||||||
|
dRowNuevo("CveUnidadMedida") = CveUnidadMedidaPSA
|
||||||
|
dRowNuevo("UnidadMedida") = UnidadMedidaPSA
|
||||||
|
dRowNuevo("CveClacificacion") = CveClacificacionPSA
|
||||||
|
dRowNuevo("Clacificacion") = ClacificacionPSA
|
||||||
|
dRowNuevo("CvePS") = CvePsTemp
|
||||||
|
dRowNuevo("PS") = PSPSA
|
||||||
|
|
||||||
|
dRowNuevo("CveSubProyecto") = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
||||||
|
dRowNuevo("SubProyecto") = DrowPartidas("SubProyecto").ToString
|
||||||
|
|
||||||
|
DTPSTemp.Rows.Add(dRowNuevo)
|
||||||
|
DTPSTemp.AcceptChanges()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
TmpDT.AcceptChanges()
|
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
||||||
|
Modalidad = "A"
|
||||||
|
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
|
||||||
|
AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
||||||
|
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").ToString, drowPsTamaños("CvePS").ToString.ToEntero,
|
||||||
|
drowPsTamaños("PS").ToString, "", drowPsTamaños("PU").ToString.ToDecimal, 0, -1, "", drowPsTamaños("CveSubProyecto").ToString.ToEntero,
|
||||||
|
drowPsTamaños("SubProyecto").ToString)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
ObjProductosServicios.Dispose()
|
||||||
|
|
||||||
Dim CveUnidadMedidaPSA As Integer = -1
|
|
||||||
Dim UnidadMedidaPSA As String = "Unidad"
|
|
||||||
Dim CveClacificacionPSA As Integer = -1
|
|
||||||
|
|
||||||
Dim ClacificacionPSA As String = ""
|
|
||||||
|
|
||||||
Dim CveSubProyectoPSA As Integer = -1
|
|
||||||
Dim SubProyectoPSA As String = ""
|
|
||||||
|
|
||||||
Dim PSPSA As String = ""
|
|
||||||
|
|
||||||
Dim DTPSTemp As New DataTable '= TmpDT.Clone
|
|
||||||
'AgregarProductoServicio(1, CveUnidadMedidaPSA, UnidadMedidaPSA, CveClacificacionPSA, ClacificacionPSA, CvePSPSA, PSPSA, "", ImporteCargo, 0, -1, "", CveSubProyectoPSA, SubProyectoPSA)
|
|
||||||
DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("CveUnidadMedida", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("UnidadMedida", GetType(String))
|
|
||||||
DTPSTemp.Columns.Add("CveClacificacion", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("Clacificacion", GetType(String))
|
|
||||||
DTPSTemp.Columns.Add("CvePS", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("PS", GetType(String))
|
|
||||||
DTPSTemp.Columns.Add("PU", GetType(Decimal))
|
|
||||||
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
|
||||||
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
|
|
||||||
|
|
||||||
For Each DrowPartidas As DataRow In TmpDT.Rows
|
|
||||||
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
|
|
||||||
|
|
||||||
If CveTamanioTemp > 0 Then
|
|
||||||
|
|
||||||
Dim DTTamanioTemp As New DataTable
|
|
||||||
Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString.ToEntero
|
|
||||||
|
|
||||||
|
|
||||||
CveSubProyectoPSA = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
|
||||||
SubProyectoPSA = DrowPartidas("SubProyecto").ToString
|
|
||||||
|
|
||||||
If ObjProductosServicios.GetPS(CvePsTemp, -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
CveUnidadMedidaPSA = ObjProductosServicios.CveUnidadMedida
|
|
||||||
CveClacificacionPSA = ObjProductosServicios.CveClasificacion
|
|
||||||
UnidadMedidaPSA = ObjProductosServicios.DtResultados.FiltroPrimeroValor("UnidadMedida")
|
|
||||||
PSPSA = ObjProductosServicios.PS
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", " Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
|
||||||
Else
|
|
||||||
ClacificacionPSA = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=If(UsuarioActual.Empresa.UsaContabilidad, CveClacificacionPSA, -1)).FiltroPrimeroValor("Clasificacion", Orderby:="Clasificacion")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
|
|
||||||
|
|
||||||
|
|
||||||
If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
|
|
||||||
|
|
||||||
For Each dRowUpdate As DataRow In DTPSTemp.Rows
|
|
||||||
|
|
||||||
If (dRowUpdate("CvePS").ToString.ToEntero = CvePsTemp) Then
|
|
||||||
dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString.ToDecimal + DrowPartidas("Cantidad").ToString.ToDecimal
|
|
||||||
dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString.ToDecimal + ImporteCargo
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
DTPSTemp.AcceptChanges()
|
|
||||||
|
|
||||||
Else
|
|
||||||
Dim dRowNuevo As DataRow = DTPSTemp.NewRow
|
|
||||||
|
|
||||||
dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString.ToDecimal
|
|
||||||
dRowNuevo("PU") = Cargo
|
|
||||||
dRowNuevo("CveUnidadMedida") = CveUnidadMedidaPSA
|
|
||||||
dRowNuevo("UnidadMedida") = UnidadMedidaPSA
|
|
||||||
dRowNuevo("CveClacificacion") = CveClacificacionPSA
|
|
||||||
dRowNuevo("Clacificacion") = ClacificacionPSA
|
|
||||||
dRowNuevo("CvePS") = CvePsTemp
|
|
||||||
dRowNuevo("PS") = PSPSA
|
|
||||||
|
|
||||||
dRowNuevo("CveSubProyecto") = DrowPartidas("CveSubProyecto").ToString.ToEntero
|
|
||||||
dRowNuevo("SubProyecto") = DrowPartidas("SubProyecto").ToString
|
|
||||||
|
|
||||||
DTPSTemp.Rows.Add(dRowNuevo)
|
|
||||||
DTPSTemp.AcceptChanges()
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
|
||||||
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
|
|
||||||
Modalidad = "A"
|
|
||||||
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
|
|
||||||
AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
|
|
||||||
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").ToString, drowPsTamaños("CvePS").ToString.ToEntero,
|
|
||||||
drowPsTamaños("PS").ToString, "", drowPsTamaños("PU").ToString.ToDecimal, 0, -1, "", drowPsTamaños("CveSubProyecto").ToString.ToEntero,
|
|
||||||
drowPsTamaños("SubProyecto").ToString)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
ObjProductosServicios.Dispose()
|
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
' ObjAcum.Dispose()
|
' ObjAcum.Dispose()
|
||||||
|
|||||||
Reference in New Issue
Block a user