Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3,6 +3,7 @@ Option Explicit On
|
|||||||
|
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports System.Text
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports GemBox.Spreadsheet
|
Imports GemBox.Spreadsheet
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
@@ -2299,36 +2300,41 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
'VERIFICA EXISTENCIAS
|
'VERIFICA EXISTENCIAS
|
||||||
If TipoMovimiento > 1 Then
|
If TipoMovimiento > 1 Then
|
||||||
Dim MensajeExistencias As New StringBuilder
|
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimeroValor("CveTipoAlmacen", "").ToEntero
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ValidaExistencia As Boolean = True
|
||||||
For Each gvr As GridViewRow In GvInv.Rows
|
If CveTipoAlmacen.Contiene(6, 21) AndAlso UsuarioActual.CveEmpresa = 140 Then ValidaExistencia = False ' si es garantia no valida existencia
|
||||||
Dim ExistenciaActual = DtInv.SUM("CantidadSurtidaPantalla", $"CvePS = {gvr.DataKey("CvePS").ToEntero} AND CveUM = {gvr.DataKey("CveUM").ToEntero} ")
|
If ValidaExistencia Then
|
||||||
|
Dim MensajeExistencias As New StringBuilder
|
||||||
|
Dim ObjInventarios As New ClsInventarios
|
||||||
|
For Each gvr As GridViewRow In GvInv.Rows
|
||||||
|
Dim ExistenciaActual = DtInv.SUM("CantidadSurtidaPantalla", $"CvePS = {gvr.DataKey("CvePS").ToEntero} AND CveUM = {gvr.DataKey("CveUM").ToEntero} ")
|
||||||
|
|
||||||
If TipoMovimiento = 2 Then
|
If TipoMovimiento = 2 Then
|
||||||
'If gvr.DataKey("CantidadC").ToString.ToDecimal <> ExistenciaActual Then
|
'If gvr.DataKey("CantidadC").ToString.ToDecimal <> ExistenciaActual Then
|
||||||
' Alert("La devolución debe de ser completa.", TipoMensaje.MsgAdvertencia)
|
' Alert("La devolución debe de ser completa.", TipoMensaje.MsgAdvertencia)
|
||||||
' Exit Sub
|
' Exit Sub
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
If DtExistencias.SUM("Existencia", $"CvePS = {gvr.DataKey("CvePS").ToEntero} AND CveUM = {gvr.DataKey("CveUM").ToEntero}") < ExistenciaActual Then
|
If DtExistencias.SUM("Existencia", $"CvePS = {gvr.DataKey("CvePS").ToEntero} AND CveUM = {gvr.DataKey("CveUM").ToEntero}") < ExistenciaActual Then
|
||||||
|
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Existencia = ObjInventarios.GetExistenciasPS(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=(TxtFecha.Text & " " & Now.ToShortTimeString).ToDateTime.ToString("yyyy/MM/dd HH:mm"))
|
||||||
|
If Existencia < ExistenciaActual Then
|
||||||
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
|
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
|
ObjInventarios.Dispose()
|
||||||
|
|
||||||
|
If MensajeExistencias.ToString <> "" Then
|
||||||
|
Alert($"Los siguientes productos no cuentan con la existencia suficiente para hacer la devolución. </br></br> {MensajeExistencias.ToString}", TipoMensaje.MsgAdvertencia)
|
||||||
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Existencia = ObjInventarios.GetExistenciasPS(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:= (TxtFecha.Text & " " & Now.ToShortTimeString).ToDateTime.ToString("yyyy/MM/dd HH:mm"))
|
|
||||||
If Existencia < ExistenciaActual Then
|
|
||||||
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
|
|
||||||
Continue For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
ObjInventarios.Dispose()
|
|
||||||
|
|
||||||
If MensajeExistencias.ToString <> "" Then
|
|
||||||
Alert($"Los siguientes productos no cuentan con la existencia suficiente para hacer la devolución. </br></br> {MensajeExistencias.ToString}", TipoMensaje.MsgAdvertencia)
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -14287,6 +14287,7 @@ Partial Class Ventas
|
|||||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
||||||
Dim DescuentosAnticipos As Decimal = row2.DataKey("Descuentos").ToDecimal
|
Dim DescuentosAnticipos As Decimal = row2.DataKey("Descuentos").ToDecimal
|
||||||
ImporteAnticipo = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / (row2.DataKey("TotalAnticipo").ToDecimal - DescuentosAnticipos) * row2.DataKey("SubTotalAnticipo").ToDecimal
|
ImporteAnticipo = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / (row2.DataKey("TotalAnticipo").ToDecimal - DescuentosAnticipos) * row2.DataKey("SubTotalAnticipo").ToDecimal
|
||||||
|
ImporteAnticipo = ImporteAnticipo.RoundSQL(2)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Importe11MX As Decimal = ImporteAnticipo
|
Dim Importe11MX As Decimal = ImporteAnticipo
|
||||||
@@ -30167,6 +30168,11 @@ Partial Class Ventas
|
|||||||
Dim importePuTemp As Decimal = 0
|
Dim importePuTemp As Decimal = 0
|
||||||
importePuTemp = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
|
importePuTemp = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
|
||||||
|
|
||||||
|
Dim DescuentoAplicado As Decimal = 0
|
||||||
|
If AplicaDescuentos Then
|
||||||
|
DescuentoAplicado = Porcentaje * TmpDT.SUMD("Descuento", FiltroStr)
|
||||||
|
End If
|
||||||
|
|
||||||
If Not AplicaImpuestosLocales Then
|
If Not AplicaImpuestosLocales Then
|
||||||
importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal
|
importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal
|
||||||
End If
|
End If
|
||||||
@@ -30186,8 +30192,8 @@ Partial Class Ventas
|
|||||||
Dr("ImporteRetISR") = (importePuTemp * Dr("PorcentajeRetISR").ToString().ToDecimal())
|
Dr("ImporteRetISR") = (importePuTemp * Dr("PorcentajeRetISR").ToString().ToDecimal())
|
||||||
|
|
||||||
If AplicaDescuentos Then
|
If AplicaDescuentos Then
|
||||||
Dr("ImportePU") = importePuTemp + TmpDT.SUMD("Descuento", FiltroStr)
|
Dr("ImportePU") = importePuTemp + DescuentoAplicado
|
||||||
Dr("Descuento") = Porcentaje * TmpDT.SUMD("Descuento", FiltroStr)
|
Dr("Descuento") = DescuentoAplicado
|
||||||
Dr("ImporteTotal") = Dr("ImportePU").ToString().ToDecimal().RoundSQL(2)
|
Dr("ImporteTotal") = Dr("ImportePU").ToString().ToDecimal().RoundSQL(2)
|
||||||
Else
|
Else
|
||||||
Dr("ImportePU") = importePuTemp
|
Dr("ImportePU") = importePuTemp
|
||||||
|
|||||||
Reference in New Issue
Block a user