--FIX recoleciones, cortes, facturacion global
This commit is contained in:
@@ -41,11 +41,23 @@ Partial Class Acumuladores_RepRecolecciones
|
|||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
ViewState("Actualizar") = value
|
ViewState("Actualizar") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property DTPSDefinidos As DataTable
|
||||||
|
Get
|
||||||
|
If ViewState("DTPSDefinidos") Is Nothing Then
|
||||||
|
ViewState("DTPSDefinidos") = New DataTable()
|
||||||
|
End If
|
||||||
|
Return CType(ViewState("DTPSDefinidos"), DataTable)
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As DataTable)
|
||||||
|
ViewState("DTPSDefinidos") = CType(value, DataTable)
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
@@ -128,14 +140,16 @@ Partial Class Acumuladores_RepRecolecciones
|
|||||||
Dim Str As New StringBuilder
|
Dim Str As New StringBuilder
|
||||||
Str.Append("Productos Definidos <br/>")
|
Str.Append("Productos Definidos <br/>")
|
||||||
If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then
|
If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then
|
||||||
For Each dr As DataRow In ObjGenerales.DtResultados.Rows
|
DTPSDefinidos = ObjGenerales.DtResultados.Copy()
|
||||||
Str.AppendFormat(" {0} - {1}<br/>", dr("Cantidad"), dr("CodigoPS"))
|
|
||||||
HdnPSRecoleccion.Value = dr("CvePS").ToString
|
|
||||||
HdnCantidadRecoleccion.Value = dr("Cantidad").ToString
|
|
||||||
Next
|
|
||||||
LblProductosCargados.Text = Str.ToString
|
|
||||||
End If
|
End If
|
||||||
ObjGenerales.Dispose()
|
ObjGenerales.Dispose()
|
||||||
|
|
||||||
|
For Each dr As DataRow In DTPSDefinidos.Rows
|
||||||
|
Str.AppendFormat(" {0} - {1}<br/>", dr("Cantidad"), dr("CodigoPS"))
|
||||||
|
'HdnPSRecoleccion.Value = dr("CvePS").ToString
|
||||||
|
'HdnCantidadRecoleccion.Value = dr("Cantidad").ToString
|
||||||
|
Next
|
||||||
|
LblProductosCargados.Text = Str.ToString
|
||||||
|
|
||||||
GvModalPSRecoleccion.DataSource = DTRecoleccion
|
GvModalPSRecoleccion.DataSource = DTRecoleccion
|
||||||
GvModalPSRecoleccion.DataBind()
|
GvModalPSRecoleccion.DataBind()
|
||||||
@@ -204,11 +218,12 @@ Partial Class Acumuladores_RepRecolecciones
|
|||||||
|
|
||||||
Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click
|
Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click
|
||||||
|
|
||||||
Dim Cantidad As Decimal = HdnCantidadRecoleccion.Value.ToDecimal
|
Dim Cantidad As Decimal = DTPSDefinidos.SUMD("Cantidad")
|
||||||
Dim CantidadDefinido As Decimal = 0
|
Dim CantidadDefinido As Decimal = 0
|
||||||
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
|
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
|
||||||
CantidadDefinido += gvr.DataKey("Cantidad").ToDecimal
|
CantidadDefinido += gvr.DataKey("Cantidad").ToDecimal
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If CantidadDefinido <> Cantidad Then
|
If CantidadDefinido <> Cantidad Then
|
||||||
Alert("La cantidad definida no es la correcta", TipoMensaje.MsgAdvertencia)
|
Alert("La cantidad definida no es la correcta", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -219,15 +234,21 @@ Partial Class Acumuladores_RepRecolecciones
|
|||||||
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
|
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
|
||||||
Dim ErrorMovInv As Boolean = False
|
Dim ErrorMovInv As Boolean = False
|
||||||
Dim Fecha As DateTime = NowADS()
|
Dim Fecha As DateTime = NowADS()
|
||||||
Dim Concepto As String = "Traspaso Recolección"
|
Dim Concepto As String = "Traspaso Recolección"
|
||||||
|
|
||||||
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 45, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados")
|
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 45, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados")
|
||||||
Dim FolioSalida As Integer = ObjInventario.Folio
|
Dim FolioSalida As Integer = ObjInventario.Folio
|
||||||
Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 42, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados")
|
|
||||||
Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=HdnPSRecoleccion.Value.ToEntero).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero
|
For Each Row As DataRow In DTPSDefinidos.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, HdnCantidadRecoleccion.Value.ToDecimal, CveUM, HdnPSRecoleccion.Value.ToEntero, 0) Then
|
Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=Row("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero
|
||||||
ErrorMovInv = True
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Row("Cantidad").ToString().ToDecimal, CveUM, Row("CvePS").ToString().ToEntero(), 0) Then
|
||||||
End If
|
ErrorMovInv = True
|
||||||
'HdnPSRecoleccion
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 42, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida, CveEntregaAlmacen:=CveEntregaAlmacen, Modulo:="clasifUsados")
|
||||||
|
|
||||||
|
'HdnPSRecoleccion
|
||||||
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
|
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
|
||||||
Dim CveMovtoDetalle As Integer
|
Dim CveMovtoDetalle As Integer
|
||||||
If ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.DataKey("Cantidad").ToDecimal, gvr.DataKey("CveUnidadMedida").ToEntero, gvr.DataKey("CvePS").ToEntero, 0) Then
|
If ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.DataKey("Cantidad").ToDecimal, gvr.DataKey("CveUnidadMedida").ToEntero, gvr.DataKey("CvePS").ToEntero, 0) Then
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ Partial Class Bancos_RepCortes
|
|||||||
GvP.DataSource = DtCortesVentasResumen
|
GvP.DataSource = DtCortesVentasResumen
|
||||||
|
|
||||||
'RESUMEN - IVA
|
'RESUMEN - IVA
|
||||||
If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
|
If UsuarioActual.CveEmpresa.Contiene(190, 192) AndAlso DsDatos.Tables.Count > 2 Then
|
||||||
DivIVA.Visible = True
|
DivIVA.Visible = True
|
||||||
GvPorIVA.DataSource = DsDatos.Tables(2)
|
GvPorIVA.DataSource = DsDatos.Tables(2)
|
||||||
Dim tsum As Decimal = DsDatos.Tables(2).SUMD("IVA16") + DsDatos.Tables(2).SUMD("IVA0")
|
Dim tsum As Decimal = DsDatos.Tables(2).SUMD("IVA16") + DsDatos.Tables(2).SUMD("IVA0")
|
||||||
|
|||||||
@@ -188,7 +188,8 @@ Partial Class Ventas_FacturacionGlobal
|
|||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
|
|
||||||
If DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0 Then
|
If DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0 Then
|
||||||
Alert("No se pudieron cargar las remsiones para facturar", TipoMensaje.MsgError)
|
Alert("No se pudieron cargar las remisiones para facturar", TipoMensaje.MsgError)
|
||||||
|
GuardaLog("Remisiones: " + SbRemisiones.ToString())
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user