bdh
This commit is contained in:
@@ -752,7 +752,7 @@
|
||||
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
|
||||
<asp:GridView ID="GvM" runat="server" GridLines="none" Width="70%"
|
||||
CssClass="table table-hover ADScroller btn-xs" ShowHeader="True"
|
||||
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad,CveTamaño"
|
||||
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad,CveTamaño,CodigoPS"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
|
||||
|
||||
@@ -2489,7 +2489,6 @@ Partial Class Inventarios_RecepcionUsados
|
||||
For Each Row As GridViewRow In GvM.Rows
|
||||
If Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
|
||||
Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal()
|
||||
Dim PU As Decimal = Row.DataKey("PU").ToDecimal()
|
||||
Dim CveTamaño As Integer = Row.DataKey("CveTamaño").ToEntero()
|
||||
@@ -2502,29 +2501,45 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Dim PS As String = ""
|
||||
Dim PorcentajeIVA As Decimal = 0D
|
||||
Dim IVA 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
|
||||
|
||||
Dim CvePS As Integer = 0
|
||||
|
||||
Select Case RblUsadosAjuste.SelectedValue
|
||||
Case "0" ' USADOS
|
||||
CvePS = Row.DataKey("CvePS").ToEntero()
|
||||
Case "1" ' AJUSTE/GARANTIA
|
||||
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||
|
||||
If drDatos IsNot Nothing Then
|
||||
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
|
||||
End If
|
||||
PorcentajeIVA = 0.16D
|
||||
IVA = SubTotal * PorcentajeIVA
|
||||
End Select
|
||||
|
||||
If CvePS > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=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
|
||||
|
||||
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
|
||||
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
|
||||
Else
|
||||
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
|
||||
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
|
||||
End If
|
||||
Next
|
||||
|
||||
'SI ES AJUSTE/GARANTIA
|
||||
If RblUsadosAjuste.SelectedValue = "1" Then
|
||||
'agrego un registro extra del importe de ajuste
|
||||
Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal
|
||||
Dim PU As Decimal = TmpDTAjustes.SUMD("Importe")
|
||||
'CONSULTA EL CONCEPTO DE NC
|
||||
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
|
||||
Dim NCAjuste As Integer = -1
|
||||
@@ -2540,7 +2555,18 @@ Partial Class Inventarios_RecepcionUsados
|
||||
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
|
||||
CvePS = Dr("CvePS").ToString.ToEntero
|
||||
Dim PorcentajeIVA As Decimal = 0.16D
|
||||
Dim Obs As String = $"Descuento por garantía. BCI: {DdlBCIAjuste.SelectedValue}"
|
||||
|
||||
Dim SbBCI As New StringBuilder()
|
||||
SbBCI.Append("BCI: ")
|
||||
'AGREGA LOS PRODUCTOS COMO OBSERVACION
|
||||
For Each GvRow As GridViewRow In GvM.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
SbBCI.AppendFormat("{0},", GvRow.DataKey("CodigoPS"))
|
||||
End If
|
||||
Next
|
||||
SbBCI.Remove(SbBCI.Length - 1, 1)
|
||||
|
||||
Dim Obs As String = SbBCI.ToString()
|
||||
|
||||
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
|
||||
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
|
||||
@@ -2570,7 +2596,6 @@ Partial Class Inventarios_RecepcionUsados
|
||||
ObjRemisionNC.Total = Total
|
||||
ObjRemisionNC.TotalOtrosConceptos = 0
|
||||
|
||||
|
||||
ObjRemisionNC.DtMovimientosUsados = DtMovimientos
|
||||
ObjRemisionNC.CveAlmacen = DdlAlmacen.SelectedValue.ToEntero()
|
||||
ObjRemisionNC.ObservacionesMovimiento = TxtObservaciones.Text
|
||||
@@ -2646,6 +2671,10 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End Sub
|
||||
Private Sub CargaPSAjuste()
|
||||
DdlPSAjuste.setEsWebService(True)
|
||||
DdlPSAjuste.Attributes.Add("data-cvesubproyecto", "-1")
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||
DdlPSAjuste.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
|
||||
@@ -2996,28 +3025,38 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
Dim CveTamaño As Integer = -1
|
||||
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||
CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
|
||||
End If
|
||||
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||
|
||||
If drDatos IsNot Nothing Then
|
||||
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
|
||||
Dim drTamañoPS As DataRow = Nothing
|
||||
|
||||
DtMovimientos.Rows.Clear()
|
||||
|
||||
If ObjPS.GetPS(drDatos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
|
||||
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
|
||||
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
|
||||
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
|
||||
|
||||
Try
|
||||
Dim CveTamaño As Integer = -1
|
||||
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||
CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
|
||||
End If
|
||||
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||
|
||||
If drDatos IsNot Nothing Then
|
||||
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
|
||||
Dim drTamañoPS As DataRow = Nothing
|
||||
|
||||
DtMovimientos.Rows.Clear()
|
||||
|
||||
Select Case RblUsadosAjuste.SelectedValue
|
||||
Case "0" ' USADOS
|
||||
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
|
||||
Case "1" ' AJUSTE/GARANTIA
|
||||
CvePS = DdlPSAjuste.SelectedValue.ToEntero
|
||||
End Select
|
||||
|
||||
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
|
||||
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
|
||||
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
|
||||
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el producto", ex)
|
||||
End Try
|
||||
ObjPS.Dispose()
|
||||
|
||||
GuardaAjuste()
|
||||
|
||||
Reference in New Issue
Block a user