-- devoluciones, para que se registre la factura y la dev almacen. y que se muestre la liga de impresión de la salida
This commit is contained in:
@@ -1488,7 +1488,7 @@
|
|||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
<i class="icon-pin font-green"></i>
|
<i class="icon-pin font-green"></i>
|
||||||
<span class="caption-subject bold uppercase">Factura de la nota de Credito</span>
|
<span class="caption-subject bold uppercase">Facturas para devolución</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -1526,23 +1526,22 @@
|
|||||||
<br />
|
<br />
|
||||||
<asp:GridView ID="GVDevolucion" runat="server" DataKeyNames="CveMovimientoDetalle,CveAlmacen,Total,PU,Cantidad,CvePS,CveUM,UM,CveClasificacion,Clasificacion,PS,CveTipoPS,PUExtranjero" ShowFooter="true" GridLines="None" AutoGenerateColumns="false" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" CssClass="table table-striped table-hover Widthall">
|
<asp:GridView ID="GVDevolucion" runat="server" DataKeyNames="CveMovimientoDetalle,CveAlmacen,Total,PU,Cantidad,CvePS,CveUM,UM,CveClasificacion,Clasificacion,PS,CveTipoPS,PUExtranjero" ShowFooter="true" GridLines="None" AutoGenerateColumns="false" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" CssClass="table table-striped table-hover Widthall">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="60px">
|
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Right">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label runat="server" Text='<%# Eval("Cantidad", "{0:N2}")%>'></asp:Label>
|
<asp:Label runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.####}")%>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<HeaderStyle CssClass="Titulos" />
|
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" />
|
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-Width="80px" />
|
||||||
<asp:BoundField ItemStyle-Width="400px" HeaderText="Producto o Servicio" DataField="PS" ItemStyle-HorizontalAlign="Center" />
|
<asp:BoundField ItemStyle-Width="400px" HeaderText="Producto o Servicio" DataField="CodigoPS" />
|
||||||
<asp:TemplateField ItemStyle-Width="80px" HeaderText="P.U." ItemStyle-HorizontalAlign="Right">
|
<asp:TemplateField ItemStyle-Width="80px" HeaderText="P.U." ItemStyle-HorizontalAlign="Right">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label Text='<%# Eval("PU", "{0:#,##0.00####}")%>' runat="server"></asp:Label>
|
<asp:Label Text='<%# Eval("PU", "{0:#,##0.####}")%>' runat="server"></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<FooterTemplate>
|
<FooterTemplate>
|
||||||
<label>Total</label>
|
<label>Total</label>
|
||||||
</FooterTemplate>
|
</FooterTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-Width="80px" HeaderText="Devolucion">
|
<asp:TemplateField ItemStyle-Width="80px" HeaderText="Devolución">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtCantidad" Width="50" Mask="999,999.99" min="0" data-max='<%# Eval("Cantidad")%>' data-pu='<%# Eval("PU")%>' type="number" step="any" data-Devolucion="devrow" runat="server"></asp:TextBox>
|
<asp:TextBox ID="TxtCantidad" Width="50" Mask="999,999.99" min="0" data-max='<%# Eval("Cantidad")%>' data-pu='<%# Eval("PU")%>' type="number" step="any" data-Devolucion="devrow" runat="server"></asp:TextBox>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
@@ -1552,7 +1551,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-Width="80px" HeaderText="">
|
<asp:TemplateField ItemStyle-Width="80px" HeaderText="">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtTotalDevolucion" CssClass="devTotal" runat="server" Text="" disabled></asp:TextBox>
|
<asp:TextBox ID="TxtTotalDevolucion" CssClass="devTotal TextBoxAsLabel" runat="server" Text="" disabled></asp:TextBox>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<FooterTemplate>
|
<FooterTemplate>
|
||||||
<asp:TextBox CssClass="devTotaltotal" runat="server"></asp:TextBox>
|
<asp:TextBox CssClass="devTotaltotal" runat="server"></asp:TextBox>
|
||||||
@@ -1564,7 +1563,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 pull-right">
|
<div class="col-md-3 pull-right">
|
||||||
<asp:Button ID="BtnVinculaDevolucion" Text="Concluir vinculación de devolución" CssClass="btn btn-primary" OnClick="BtnVinculaDevolucion_Click" runat="server" />
|
<asp:Button ID="BtnVinculaDevolucion" Text="Concluir vinculación de devolución" CssClass="btn btn-success" OnClick="BtnVinculaDevolucion_Click" runat="server" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -2094,7 +2093,7 @@
|
|||||||
<br />
|
<br />
|
||||||
<div class="row" align="right">
|
<div class="row" align="right">
|
||||||
<div class="col-md-12 text-right text-small">
|
<div class="col-md-12 text-right text-small">
|
||||||
<asp:Button Text="Vinculación Completa" ID="BtnVincularOCCompleta" CssClass="btn btn-success" ClientIDMode="Static" runat="server" Visible="false" OnClick="BtnVincularOCCompleta_Click" ValidationGroup="GrpVincularOC" runat="server" />
|
<asp:Button Text="Vinculación Completa" ID="BtnVincularOCCompleta" CssClass="btn btn-success" ClientIDMode="Static" runat="server" Visible="false" OnClick="BtnVincularOCCompleta_Click" ValidationGroup="GrpVincularOC" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -1268,6 +1268,7 @@ Partial Class Compras_Compras
|
|||||||
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
|
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
|
||||||
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
|
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
|
||||||
LbTotalOC1.Attributes.Add(“readonly”, “readonly”)
|
LbTotalOC1.Attributes.Add(“readonly”, “readonly”)
|
||||||
|
PermisoVinculacionImporteDiferente = True
|
||||||
|
|
||||||
CargaDatosAgregarPS()
|
CargaDatosAgregarPS()
|
||||||
TieneAnticiposXML = False
|
TieneAnticiposXML = False
|
||||||
@@ -1438,15 +1439,17 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue = "NC" Then
|
If DdlTipoComprobante.SelectedValue = "NC" Then
|
||||||
paneldevolucion.Visible = True
|
'paneldevolucion.Visible = True
|
||||||
Pnlalmaceninventarios.Visible = False
|
Pnlalmaceninventarios.Visible = False
|
||||||
cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble)
|
'cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble)
|
||||||
InicializaAplicaNCFact()
|
InicializaAplicaNCFact()
|
||||||
DivReembolso.Visible = False
|
DivReembolso.Visible = False
|
||||||
RBLPago.Items(2).Enabled = False
|
RBLPago.Items(2).Enabled = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue = "DEV" Then
|
If DdlTipoComprobante.SelectedValue = "DEV" Then
|
||||||
|
paneldevolucion.Visible = True
|
||||||
|
cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble)
|
||||||
InicializaAplicaNCFact()
|
InicializaAplicaNCFact()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2176,9 +2179,9 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
|
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(242) Then
|
'If UsuarioActual.TienePermisoProceso(242) Then
|
||||||
PermisoVinculacionImporteDiferente = True
|
' PermisoVinculacionImporteDiferente = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(112) Then
|
If UsuarioActual.TienePermisoProceso(112) Then
|
||||||
PermisoEdicionManual = True
|
PermisoEdicionManual = True
|
||||||
@@ -4374,7 +4377,6 @@ Partial Class Compras_Compras
|
|||||||
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
|
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'------------------ INICIA VALIDACIONES ------------------
|
'------------------ INICIA VALIDACIONES ------------------
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) AndAlso UsuarioActual.CveUsuario <> 1803 Then
|
If UsuarioActual.CveEmpresa.Contiene(13, 83) AndAlso UsuarioActual.CveUsuario <> 1803 Then
|
||||||
@@ -4571,7 +4573,7 @@ Partial Class Compras_Compras
|
|||||||
Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia)
|
Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
ValidaFechaDeAlamacen()
|
ValidaFechaDeAlmacen()
|
||||||
Else
|
Else
|
||||||
'GvInv.Rows(x).FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero 'Charlie
|
'GvInv.Rows(x).FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero 'Charlie
|
||||||
'pestaña de almacen, si hay especificado una entrada por partida dealmacen, debe de existir el almacen.
|
'pestaña de almacen, si hay especificado una entrada por partida dealmacen, debe de existir el almacen.
|
||||||
@@ -5120,7 +5122,7 @@ Partial Class Compras_Compras
|
|||||||
Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal2.Text.ToDecimal, TxtFecha.Text.Trim.ToDate)
|
Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal2.Text.ToDecimal, TxtFecha.Text.Trim.ToDate)
|
||||||
|
|
||||||
TotalRealDevolucion = Devolucion.Total
|
TotalRealDevolucion = Devolucion.Total
|
||||||
|
CveMovimientoInventario = Devolucion.CveMovimiento
|
||||||
TieneError = Devolucion.TieneError
|
TieneError = Devolucion.TieneError
|
||||||
End If
|
End If
|
||||||
Dim ErrorDetalles As Boolean = False
|
Dim ErrorDetalles As Boolean = False
|
||||||
@@ -7950,69 +7952,31 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ValidaFechaDeAlamacen() As Boolean
|
Private Function ValidaFechaDeAlmacen() As Boolean
|
||||||
Dim respuesta As Boolean = False
|
Dim respuesta As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim objInventario As New ClsInventarios
|
|
||||||
Dim MovimientosError As Boolean = False
|
Dim MovimientosError As Boolean = False
|
||||||
|
|
||||||
'Dim SB As New StringBuilder
|
|
||||||
'Dim FechaCompra As DateTime = TxtFecha.Text.ToDate
|
|
||||||
'FechaCompra
|
|
||||||
Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
|
Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
|
||||||
|
Dim CveAlmacenMov As Integer = DdlAlmacenDevolucion.SelectedValue.ToEntero
|
||||||
|
|
||||||
Dim CveAlmacenMov As Integer = ddlAlmacenAdd.SelectedValue.ToEntero
|
|
||||||
Dim DTAlamcen As New DataTable
|
Dim DTAlamcen As New DataTable
|
||||||
|
|
||||||
|
Dim objInventario As New ClsInventarios
|
||||||
If DDLDevolucion.SelectedValue.ToEntero > 0 Then
|
|
||||||
Dim objcompras As New ClsCompras()
|
|
||||||
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
|
|
||||||
GVDevolucion.DataSource = objcompras.DtResultados
|
|
||||||
End If
|
|
||||||
objcompras.Dispose()
|
|
||||||
GVDevolucion.DataBind()
|
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GVDevolucion.Rows
|
|
||||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
|
||||||
CveAlmacenMov = GvRow.DataKey("CveAlmacen").ToString.ToEntero
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If DtInv IsNot Nothing Then
|
If DtInv IsNot Nothing Then
|
||||||
For Each Dr As DataRow In TmpDT.Rows
|
For Each Dr As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
|
||||||
|
If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenMov, CvePS:=Dr("CvePS").ToString.ToEntero) Then
|
||||||
Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero
|
|
||||||
|
|
||||||
If CveTipoPS = 2 Then
|
|
||||||
If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenMov, CvePS:=Dr("CvePS").ToString.ToEntero) Then
|
|
||||||
|
|
||||||
If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
|
|
||||||
Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
|
|
||||||
If FechamoMovimiento > FechaMinima Then
|
|
||||||
FechaMinima = FechamoMovimiento
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
|
||||||
|
Dim tFechaMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
|
||||||
|
If tFechaMovimiento > FechaMinima Then
|
||||||
|
FechaMinima = tFechaMovimiento
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
objInventario.Dispose()
|
objInventario.Dispose()
|
||||||
|
|
||||||
If FechaMinima > TxtFecha.Text.ToDate Then
|
If FechaMinima > TxtFecha.Text.ToDate Then
|
||||||
Alert($"Los productos tienen movientos, la fecha minima que se cambio la fecha de compra as {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
|
Alert($"Los productos tienen movimientos, la fecha minima que se cambio la fecha de compra es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
|
||||||
'respuesta = False
|
'respuesta = False
|
||||||
TxtFecha.Text = FechaMinima.ToString("dd/MM/yyyy")
|
TxtFecha.Text = FechaMinima.ToString("dd/MM/yyyy")
|
||||||
Else
|
Else
|
||||||
@@ -8020,7 +7984,6 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Return respuesta
|
Return respuesta
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GeneraStrinDoctosRelacionados() As String
|
Private Function GeneraStrinDoctosRelacionados() As String
|
||||||
@@ -13869,6 +13832,7 @@ Partial Class Compras_Compras
|
|||||||
Dim subtotaldevolucion As Decimal = 0
|
Dim subtotaldevolucion As Decimal = 0
|
||||||
Dim realizadevolucion As Boolean = False
|
Dim realizadevolucion As Boolean = False
|
||||||
Dim CveMovimientoEntrada As Integer = -1
|
Dim CveMovimientoEntrada As Integer = -1
|
||||||
|
Dim CantidadRenglones As Integer = 0
|
||||||
'Calculo los subtotales para comparar con la NC
|
'Calculo los subtotales para comparar con la NC
|
||||||
Dim Cantidad As Decimal
|
Dim Cantidad As Decimal
|
||||||
|
|
||||||
@@ -13877,6 +13841,7 @@ Partial Class Compras_Compras
|
|||||||
Cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDecimal
|
Cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||||
If Cantidad > 0 Then
|
If Cantidad > 0 Then
|
||||||
realizadevolucion = True
|
realizadevolucion = True
|
||||||
|
CantidadRenglones += 1
|
||||||
Dim PU As Decimal = If(DdlMoneda.SelectedValue.ToEntero <> 1, Dr.DataKey("PUExtranjero").ToString.ToDecimal, Dr.DataKey("PU").ToString.ToDecimal)
|
Dim PU As Decimal = If(DdlMoneda.SelectedValue.ToEntero <> 1, Dr.DataKey("PUExtranjero").ToString.ToDecimal, Dr.DataKey("PU").ToString.ToDecimal)
|
||||||
subtotaldevolucion += PU * Cantidad
|
subtotaldevolucion += PU * Cantidad
|
||||||
End If
|
End If
|
||||||
@@ -13894,13 +13859,7 @@ Partial Class Compras_Compras
|
|||||||
Dim Acumulado As Decimal = 0
|
Dim Acumulado As Decimal = 0
|
||||||
Dim PU As Decimal
|
Dim PU As Decimal
|
||||||
Dim PUExtranjero As Decimal
|
Dim PUExtranjero As Decimal
|
||||||
Dim CantidadRenglones As Integer = 0
|
|
||||||
Dim ii As Integer = 0
|
Dim ii As Integer = 0
|
||||||
For Each Dr As GridViewRow In GVDevolucion.Rows
|
|
||||||
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
|
||||||
CantidadRenglones += 1
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
For Each Dr As GridViewRow In GVDevolucion.Rows
|
For Each Dr As GridViewRow In GVDevolucion.Rows
|
||||||
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
||||||
@@ -13912,8 +13871,6 @@ Partial Class Compras_Compras
|
|||||||
Dim dif As Decimal = subtotal - Acumulado
|
Dim dif As Decimal = subtotal - Acumulado
|
||||||
PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal
|
PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If ObjInventario.GetExistenciasProducto(Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen,
|
If ObjInventario.GetExistenciasProducto(Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen,
|
||||||
FechaMovto:=TxtFecha.Text.ToDateTime.AddHours(NowADS().Hour).AddMinutes(NowADS().Minute).AddSeconds(NowADS().Second).ToString("yyyy/MM/dd HH:mm")) Then
|
FechaMovto:=TxtFecha.Text.ToDateTime.AddHours(NowADS().Hour).AddMinutes(NowADS().Minute).AddSeconds(NowADS().Second).ToString("yyyy/MM/dd HH:mm")) Then
|
||||||
|
|
||||||
@@ -13924,21 +13881,16 @@ Partial Class Compras_Compras
|
|||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDecimal, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, PU, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero, PUTC:=PUExtranjero) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDecimal, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, PU, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero, PUTC:=PUExtranjero) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
@@ -13949,12 +13901,8 @@ Partial Class Compras_Compras
|
|||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa, -1) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa, -1) Then
|
||||||
|
|
||||||
For Each drow As DataRow In ObjInventario.DtResultados.Rows
|
For Each drow As DataRow In ObjInventario.DtResultados.Rows
|
||||||
|
|
||||||
|
|
||||||
TotalSumaPU = TotalSumaPU + drow("Total").ToString.ToDecimal
|
TotalSumaPU = TotalSumaPU + drow("Total").ToString.ToDecimal
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return New MMensajeDevolucion() With
|
Return New MMensajeDevolucion() With
|
||||||
@@ -13964,7 +13912,6 @@ Partial Class Compras_Compras
|
|||||||
.TieneError = ErrorMovInv,
|
.TieneError = ErrorMovInv,
|
||||||
.Total = TotalSumaPU
|
.Total = TotalSumaPU
|
||||||
}
|
}
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub cargaddldevoluciones(CveProveedor As Integer, SubTotal As Double)
|
Private Sub cargaddldevoluciones(CveProveedor As Integer, SubTotal As Double)
|
||||||
@@ -14076,13 +14023,14 @@ Partial Class Compras_Compras
|
|||||||
Contador += 1
|
Contador += 1
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
Dim CveSubProyectoContrato As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDevolucion.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto")
|
||||||
|
Dim SubProyecto As String = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyectoContrato.ToEntero).FiltroPrimeroValor("SubProyecto")
|
||||||
'Iteramos el GridView de la OC
|
'Iteramos el GridView de la OC
|
||||||
For Each gvr As GridViewRow In GVDevolucion.Rows
|
For Each gvr As GridViewRow In GVDevolucion.Rows
|
||||||
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Then
|
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Then
|
||||||
|
|
||||||
Dim CvePS As Integer = gvr.DataKey("CvePS").ToString.ToEntero
|
Dim CvePS As Integer = gvr.DataKey("CvePS").ToString.ToEntero
|
||||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
'Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
|
|
||||||
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
|
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||||
Dim CveUM As Integer = gvr.DataKey("CveUM").ToString.ToEntero
|
Dim CveUM As Integer = gvr.DataKey("CveUM").ToString.ToEntero
|
||||||
@@ -14091,9 +14039,9 @@ Partial Class Compras_Compras
|
|||||||
Dim Clasificacion As String = gvr.DataKey("Clasificacion").ToString
|
Dim Clasificacion As String = gvr.DataKey("Clasificacion").ToString
|
||||||
Dim PS As String = gvr.DataKey("PS").ToString
|
Dim PS As String = gvr.DataKey("PS").ToString
|
||||||
Dim CveTipoPS As Integer = gvr.DataKey("CveTipoPS").ToString.ToEntero
|
Dim CveTipoPS As Integer = gvr.DataKey("CveTipoPS").ToString.ToEntero
|
||||||
Dim CveSubProyectoContrato As String = "-1"
|
|
||||||
Dim CveProyecto As String = "-1"
|
Dim CveProyecto As String = "-1"
|
||||||
Dim SubProyecto As String = "Seleccione"
|
|
||||||
Dim Proyecto As String = "Seleccione"
|
Dim Proyecto As String = "Seleccione"
|
||||||
Dim Obs As String = ""
|
Dim Obs As String = ""
|
||||||
Dim PU As Decimal = gvr.DataKey("PU").ToString.ToDecimal
|
Dim PU As Decimal = gvr.DataKey("PU").ToString.ToDecimal
|
||||||
@@ -14111,11 +14059,8 @@ Partial Class Compras_Compras
|
|||||||
PU = ((PU * Cantidad) + dif) / Cantidad
|
PU = ((PU * Cantidad) + dif) / Cantidad
|
||||||
Total = Cantidad * PU
|
Total = Cantidad * PU
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, 0, 0, 0, 0, Descuento, -1, False)
|
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, 0, 0, 0, 0, Descuento, -1, False)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -14136,11 +14081,11 @@ Partial Class Compras_Compras
|
|||||||
LbAgregar.Visible = False
|
LbAgregar.Visible = False
|
||||||
UpPSS.Update()
|
UpPSS.Update()
|
||||||
|
|
||||||
CargaGvInv()
|
'CargaGvInv()
|
||||||
|
|
||||||
GvPS.DataSource = TmpDT
|
'GvPS.DataSource = TmpDT
|
||||||
GvPS.DataBind()
|
'GvPS.DataBind()
|
||||||
UpPS.Update()
|
'UpPS.Update()
|
||||||
|
|
||||||
CargaGVsAF()
|
CargaGVsAF()
|
||||||
|
|
||||||
@@ -16714,12 +16659,14 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
ImgAnticiposPendientes.Visible = False
|
ImgAnticiposPendientes.Visible = False
|
||||||
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
|
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
|
||||||
paneldevolucion.Visible = True
|
|
||||||
Pnlalmaceninventarios.Visible = False
|
Pnlalmaceninventarios.Visible = False
|
||||||
If DdlTipoComprobante.SelectedValue.Contiene("DEV") Then
|
If DdlTipoComprobante.SelectedValue.Contiene("DEV") Then
|
||||||
DivAlmacenDev.Visible = True
|
DivAlmacenDev.Visible = True
|
||||||
|
paneldevolucion.Visible = True
|
||||||
|
cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble)
|
||||||
End If
|
End If
|
||||||
cargaddldevoluciones(CveProveedor, TxtSubTotal2.Text.ToDouble)
|
|
||||||
InicializaAplicaNCFact()
|
InicializaAplicaNCFact()
|
||||||
DivReembolso.Visible = False
|
DivReembolso.Visible = False
|
||||||
RBLPago.Items(2).Enabled = False
|
RBLPago.Items(2).Enabled = False
|
||||||
|
|||||||
Reference in New Issue
Block a user