-Ajustes para inicialización de usados

This commit is contained in:
rrene
2019-12-02 10:36:09 -07:00
parent 385c0c92a3
commit 0f8ddb797c
4 changed files with 69 additions and 58 deletions

View File

@@ -1052,6 +1052,18 @@ Partial Class Inventarios_RecepcionUsados
Else Else
Dim Mensaje As String = "" Dim Mensaje As String = ""
If Not ErrorMovInv AndAlso GenerarRNC AndAlso ObjRemisionNC IsNot Nothing Then
CargaDTDetalleRNC()
Dim Resp = ObjRemisionNC.EmitirFactura(False)
For Each mensaje2 As String In Resp.Mensajes
Msg.AppendFormat("<br>{0}", mensaje2)
Next
Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia))
CveVenta = Resp.CveVenta
End If
For Each Dr As DataRow In DtMovimientos.Rows For Each Dr As DataRow In DtMovimientos.Rows
If CveConcepto = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then If CveConcepto = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
@@ -1066,7 +1078,7 @@ Partial Class Inventarios_RecepcionUsados
Exit For Exit For
End If End If
If Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then
Mensaje = "Error al actualizar el recibo de los usados" Mensaje = "Error al actualizar el recibo de los usados"
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
@@ -1074,15 +1086,15 @@ Partial Class Inventarios_RecepcionUsados
'si es selectedvalue = 2, es entrada ,3 -salida 'si es selectedvalue = 2, es entrada ,3 -salida
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2) Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
If RBLOpcion.SelectedValue.ToEntero = 2 Then If RBLOpcion.SelectedValue.ToEntero = 2 AndAlso EsDistribuidor Then
If EsDistribuidor Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario, If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, CveVenta, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
Mensaje = "Error al guardar Movimientos de distribuidor" Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
End If
End If End If
Next Next
@@ -1125,17 +1137,7 @@ Partial Class Inventarios_RecepcionUsados
ObjAcum.Dispose() ObjAcum.Dispose()
ObjVentas.Dispose() ObjVentas.Dispose()
If Not ErrorMovInv AndAlso GenerarRNC AndAlso ObjRemisionNC IsNot Nothing Then If Not ErrorMovInv Then
CargaDTDetalleRNC()
Dim Resp = ObjRemisionNC.EmitirFactura(False)
For Each mensaje As String In Resp.Mensajes
Msg.AppendFormat("<br>{0}", mensaje)
Next
Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia))
ElseIf Not ErrorMovInv Then
Alert(Msg.ToString, TipoMensaje.MsgInformacion) Alert(Msg.ToString, TipoMensaje.MsgInformacion)
End If End If

View File

@@ -8899,7 +8899,7 @@ Partial Class Clientes
GvAcum.DataSource = ObjAcum.DtResultados GvAcum.DataSource = ObjAcum.DtResultados
LblUsadosPuntos.Text = (ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 2 ") - ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 1 ")).ToDecimal.FormatoNumero(2) LblUsadosPuntos.Text = (ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 2 ") - ObjAcum.DtResultados.SUM("Puntos", " CveConcepto IN (1,3) ")).ToDecimal.FormatoNumero(2)
ImporteCargo = ObjAcum.DtResultados.SUM("ImporteCargo", "(FacturadoCargo = 0 OR FacturadoCargo IS NULL) AND CveConcepto = 1 ").ToDecimal ImporteCargo = ObjAcum.DtResultados.SUM("ImporteCargo", "(FacturadoCargo = 0 OR FacturadoCargo IS NULL) AND CveConcepto = 1 ").ToDecimal
ImporteBonificacion = ObjAcum.DtResultados.SUM("ImporteBonificacion", "(FacturadoBonificacion = 0 OR FacturadoBonificacion IS NULL) AND CveConcepto = 1 ").ToDecimal ImporteBonificacion = ObjAcum.DtResultados.SUM("ImporteBonificacion", "(FacturadoBonificacion = 0 OR FacturadoBonificacion IS NULL) AND CveConcepto = 1 ").ToDecimal
@@ -9928,7 +9928,14 @@ Partial Class Clientes
End Sub End Sub
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
Dim Acum As New ClsAcumuladores
Dim Puntos As Decimal = -LblUsadosPuntos.Text.ToDecimal
If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
Alert("Puntuación Inicializada") Alert("Puntuación Inicializada")
End If
Acum.Dispose()
End Sub End Sub
#End Region #End Region
End Class End Class

View File

@@ -5995,7 +5995,7 @@
<asp:CheckBox ID="ChkAplicar" runat="server" /> <asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" /> <asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
@@ -6378,7 +6378,7 @@
<asp:CheckBox ID="ChkAplicar" runat="server" /> <asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" /> <asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>

View File

@@ -20861,16 +20861,18 @@ Partial Class Ventas
End Sub End Sub
Private Sub CargaRNC() Private Sub CargaRNC()
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1, TipoDocto:="RNC") Then
GvRemisionesNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento") If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
GvRemisionesNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0", "Moneda,Fecha,Folio")
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
GvRemisionesNC.DataBind() GvRemisionesNC.DataBind()
End Sub End Sub
Private Sub CargaDescRNC() Private Sub CargaDescRNC()
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1, TipoDocto:="RNC") Then If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
GvDescNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento") GvDescNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0", "Moneda,Fecha,Folio")
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
GvDescNC.DataBind() GvDescNC.DataBind()