Carga de Retenciones al CrearAPartirDe,Validacion de Existencia solo en Productos, Validacion de Surtidos al facturar remision, correcion de aplicacion de NC, boton de agregar cliente en E140 cuando es cotizacion

This commit is contained in:
2021-09-06 15:45:28 -07:00
parent 7ee32d3470
commit 0a09bf95be
14 changed files with 1454 additions and 1467 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2628,6 +2628,10 @@ Partial Class Ventas
'DdlEstatus.Enabled = False
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
LnkAgregarCliente.Visible = True
End If
End If
CargaEstatusFactura(Opcion)
@@ -5632,7 +5636,7 @@ Partial Class Ventas
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
If CveVenta <= 0 Then
If CveVenta <= 0 OrElse EsCreaApartirDe Then
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString())
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
@@ -7689,13 +7693,7 @@ Partial Class Ventas
Dim CveProducto As Integer
Dim Existencia As Double
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero()
For Each dr As DataRow In TmpDT.Rows
'SI ES SERVICIO NO VALIDA
'GlobalDTProductosServicios
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveTipoPS").ToString().ToEntero() = 1 Then
Continue For
End If
For Each dr As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
'VALIDA EXISTENCIA
@@ -18966,6 +18964,12 @@ Partial Class Ventas
' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "")
If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then
Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal)
'SI LA CANTIDAD SURTIDA SUPERA LO REQUERIDO, TOMA SOLO LO NECESARIO PARA COMPLETAR
If (rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida) > rowSurtidos("Cantidad").ToString().ToDecimal Then
CantidadSurtida = (rowSurtidos("Cantidad").ToString().ToDecimal - rowSurtidos("Surtido").ToString().ToDecimal)
End If
MovDTCuadrados.ImportRow(dr)
MovDTCuadrados(MovDTCuadrados.Rows.Count - 1)("Cantidad") = CantidadSurtida
DtRemConceptosSurtidos(Indice)("Surtido") = rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida
@@ -26913,7 +26917,7 @@ Partial Class Ventas
For Each Dr As DataRow In DtImpuestosLocal.Rows
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("CveSubProyecto"))
Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("Total", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
If Not AplicaImpuestosLocales Then
importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal
@@ -29767,7 +29771,7 @@ Partial Class Ventas
End If
End If
ObjCliente.Dispose()
'DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
TrVistaPrevia.Visible = True
TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
@@ -31158,6 +31162,8 @@ Partial Class Ventas
tClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then
tClienteRetIVA = 0.06D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("0") Then
tClienteRetIVA = 0.00D
End If
ViewState("ClienteRetIVA") = tClienteRetIVA
End If