-- paqueterias y devolucion de ingreso
This commit is contained in:
@@ -244,9 +244,9 @@
|
|||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
|
|
||||||
<asp:Panel ID="PnlEntrega" runat="server" Visible="false">
|
<asp:Panel ID="PnlEntrega" runat="server" Visible="false">
|
||||||
<asp:RadioButton id="RbSinEntrega" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="25%" GroupName="EntregaRadioGroup" Text="Entrega en mostrador" AutoPostBack="true"></asp:RadioButton>
|
<asp:RadioButton id="RbSinEntrega" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="33%" GroupName="EntregaRadioGroup" Text="Entrega en mostrador" AutoPostBack="true"></asp:RadioButton>
|
||||||
<asp:RadioButton id="RbEntregaInterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="25%" GroupName="EntregaRadioGroup" Text="Entrega Interna" AutoPostBack="true"></asp:RadioButton>
|
<asp:RadioButton id="RbEntregaInterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="30%" GroupName="EntregaRadioGroup" Text="Entrega Interna" AutoPostBack="true"></asp:RadioButton>
|
||||||
<asp:RadioButton id="RbEntregaExterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="25%" GroupName="EntregaRadioGroup" Text="Entrega Externa" AutoPostBack="true"></asp:RadioButton>
|
<asp:RadioButton id="RbEntregaExterna" runat="server" OnCheckedChanged="EntregaRadioGroup_Click" Width="30%" GroupName="EntregaRadioGroup" Text="Entrega Externa" AutoPostBack="true"></asp:RadioButton>
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
<asp:LinkButton ID="LnkPaqueteriaDetalle" runat="server" OnClick="PaqueteriaDetalle_Click" Visible="false">ver detalle de entrega</asp:LinkButton>
|
<asp:LinkButton ID="LnkPaqueteriaDetalle" runat="server" OnClick="PaqueteriaDetalle_Click" Visible="false">ver detalle de entrega</asp:LinkButton>
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@
|
|||||||
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
|
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
|
||||||
<asp:TemplateField HeaderText="Cant. a Surtir" ItemStyle-Width="10%">
|
<asp:TemplateField HeaderText="Cant. a Surtir" ItemStyle-Width="10%">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TbCantidadF" runat="server" Width="60px" Mask="9,999.99" Text='<%# Eval("CantidadF") %>'></asp:TextBox>
|
<asp:TextBox ID="TbCantidadF" runat="server" Width="60px" Mask="9,999.99" DataFormatString="{0:#,##0.######}" style="text-align: right" Text='<%# Eval("CantidadF") %>'></asp:TextBox>
|
||||||
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
|
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<HeaderStyle CssClass="Titulos" />
|
<HeaderStyle CssClass="Titulos" />
|
||||||
|
|||||||
@@ -244,6 +244,14 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
ViewState("EsDevolucionDirecta") = value
|
ViewState("EsDevolucionDirecta") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property FormaPaqueteria As Integer
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("FormaPaqueteria"), Integer)
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("FormaPaqueteria") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -322,6 +330,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CreaDtDetalleLote()
|
CreaDtDetalleLote()
|
||||||
CargaPendientes()
|
CargaPendientes()
|
||||||
|
|
||||||
|
|
||||||
LimpiaCampos()
|
LimpiaCampos()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -628,7 +637,6 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
LnkPaqueteriaDetalle.Visible = True
|
LnkPaqueteriaDetalle.Visible = True
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString)
|
'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1931,7 +1939,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(CveAlmacenExA, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(CveAlmacenExA, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
||||||
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/GSC22")
|
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/G4")
|
||||||
FolioEntrada = ObjInventario.Folio
|
FolioEntrada = ObjInventario.Folio
|
||||||
|
|
||||||
If Not CveMovimientoEntradaApartado > 0 Then
|
If Not CveMovimientoEntradaApartado > 0 Then
|
||||||
@@ -2228,7 +2236,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
Dim CveMovimientoDevolucionSinCosto = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero(), 41, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
Dim CveMovimientoDevolucionSinCosto = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero(), 41, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
||||||
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/GSC4")
|
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/G4")
|
||||||
Dim FolioDevSinCosto = ObjInventario.Folio
|
Dim FolioDevSinCosto = ObjInventario.Folio
|
||||||
|
|
||||||
If Not CveMovimientoDevolucionSinCosto > 0 Then
|
If Not CveMovimientoDevolucionSinCosto > 0 Then
|
||||||
@@ -2275,13 +2283,15 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
ElseIf TipoMovimiento = 2 Then
|
ElseIf TipoMovimiento = 2 Then
|
||||||
CantidadPendientePorSalir = CantidadPendientePorSalir - CantidadEntradaSinCosto
|
CantidadPendientePorSalir = CantidadPendientePorSalir - CantidadEntradaSinCosto
|
||||||
End If
|
End If
|
||||||
|
'si el alamcen del que salio, es el mismo que entra, no hay traspasos.
|
||||||
|
If CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero Then CveAlmacenTraspasoDestino = 0
|
||||||
|
|
||||||
If Not ErrorMovInv AndAlso CantidadPendientePorSalir > 0 Then
|
If Not ErrorMovInv AndAlso CantidadPendientePorSalir > 0 Then
|
||||||
Dim ConceptoMovimiento = 3
|
Dim ConceptoMovimiento = 3
|
||||||
ConceptoMovimiento = If(TipoMovimiento = 1, ConceptoMovimiento, 18)
|
ConceptoMovimiento = If(TipoMovimiento = 1, ConceptoMovimiento, 18)
|
||||||
ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento)
|
ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento)
|
||||||
|
|
||||||
Dim Almacen1 = DdlAlmacen.SelectedValue.ToEntero
|
Dim Almacen1 As Integer = DdlAlmacen.SelectedValue.ToEntero
|
||||||
|
|
||||||
If TipoDocto = "Rem" AndAlso CveAlmacenTraspasoDestino = 0 Then
|
If TipoDocto = "Rem" AndAlso CveAlmacenTraspasoDestino = 0 Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
@@ -2427,50 +2437,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN - SALIDA ALMACEN
|
Else 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN - SALIDA ALMACEN
|
||||||
Dim DtCostos As DataTable = Nothing
|
ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimiento, TextoError)
|
||||||
Dim ValorInventario As Decimal = 0
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
|
||||||
DtCostos = ObjInventario.DtResultados
|
|
||||||
|
|
||||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
|
||||||
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
|
||||||
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
|
||||||
Dim IdCtaContable As Integer = 0
|
|
||||||
Dim CveCuenta As Integer = 0
|
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
|
||||||
|
|
||||||
|
|
||||||
If ObjVentas.GetVenta(CveVentaSurtir, UsuarioActual.CveEmpresa) Then
|
|
||||||
Dim Fecha As Date = TxtFecha.Text.ToDate ' If(TipoMovimiento <> 1, TxtFecha.Text.ToDate, ObjVentas.DtResultados(0)("Fecha").ToString.ToDate)
|
|
||||||
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
|
|
||||||
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
|
|
||||||
Dim Serie As String = ObjVentas.DtResultados(0)("Serie").ToString
|
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL()
|
|
||||||
Dim TotalCostoAcumulado As Decimal = 0
|
|
||||||
Dim cont As Integer = 1
|
|
||||||
|
|
||||||
Dim ValorMultiplicador = 1
|
|
||||||
|
|
||||||
If TipoMovimiento = 1 Then
|
|
||||||
ValorMultiplicador = 1
|
|
||||||
ElseIf TipoMovimiento = 2 Then
|
|
||||||
ValorMultiplicador = -1
|
|
||||||
ElseIf TipoMovimiento = 2 AndAlso TipoDocto.Contiene({"Dev"}) And (EsDevolucionVenta = 1) Then
|
|
||||||
ValorMultiplicador = 1
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
||||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
|
||||||
|
|
||||||
If CvePrePoliza > 0 Then
|
|
||||||
|
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
|
||||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
|
|
||||||
TotalCostoAcumulado += ValorInventario
|
|
||||||
|
|
||||||
'cuando es el último movimiento y hay diferencias en los importes
|
|
||||||
If cont = DtCostos.FiltraParametros("", "", {"CveClasificacion"}).Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
|
|
||||||
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -3671,13 +3638,12 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs)
|
Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs)
|
||||||
If RbEntregaExterna.Checked Then
|
If RbEntregaExterna.Checked Then
|
||||||
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
||||||
LnkPaqueteriaDetalle.Visible = False
|
|
||||||
ElseIf RbEntregaInterna.Checked Then
|
ElseIf RbEntregaInterna.Checked Then
|
||||||
LnkPaqueteriaDetalle.Visible = True
|
RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||||
'RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
'RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuiasInternas.aspx?CveVenta={CveVentaSurtir}&CveSubProyecto={CveSubProyecto}',800,547,'N')")
|
||||||
|
'CveVentaSurtir
|
||||||
ElseIf RbSinEntrega.Checked Then
|
ElseIf RbSinEntrega.Checked Then
|
||||||
LimpiaCampos()
|
LimpiaCampos()
|
||||||
LnkPaqueteriaDetalle.Visible = False
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -3689,6 +3655,13 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
TxtObservacionesPaqInterna.Text = ""
|
TxtObservacionesPaqInterna.Text = ""
|
||||||
UpPaqInterna.Update()
|
UpPaqInterna.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
Protected Sub PaqueteriaDetalle_Click(sender As Object, e As EventArgs)
|
||||||
|
If RbEntregaExterna.Checked Then
|
||||||
|
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
||||||
|
ElseIf RbEntregaInterna.Checked Then
|
||||||
|
RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user