@@ -698,7 +699,7 @@
-
+
@@ -728,7 +729,7 @@
| Linea Adicional: |
-
+
@@ -1719,7 +1720,6 @@
-
@@ -9497,10 +9497,12 @@
step: 30
});
- if(HdnCargarInventario.value == 'True'){
+ if(HdnCargarInventario.value == 'True'){
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
CargaMovimientosInventario();
});
+ }else {
+ $("#TabAlmacen_tab .ajax__tab_inner").unbind();
}
}
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index e030db63d..2a7068f4b 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2401,6 +2401,7 @@ Partial Class Ventas
ViewState("ClienteRetISR") = 0
ViewState("CvePrecioLista") = 0
ViewState("CvePrecioListaCliente") = 0
+ HdnCargarInventario.Value = "True"
Me.CveVendedorVenta = -1
Me.CveVendedorCliente = -1
Me.CveVendedorClienteSucursal = -1
@@ -2851,8 +2852,7 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
HdnCargarInventario.Value = "False"
'spanAlmacen.Attributes.Remove("onclick")
- Tab.ActiveTabIndex = 1
- Updatetabs.Update()
+ UpParametros.Update()
End If
'Modalidad Devoluciones y Refacturacion
@@ -9461,22 +9461,106 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
- 'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
- If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
- TmpDT = TmpDTError.Copy()
- CalculaTotalesVenta(RecalcularTotalOriginal:=False)
- Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
- If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
- TmpDT = TmpDTError.Copy()
- CalculaTotalesVenta(RecalcularTotalOriginal:=False)
- Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
- Exit Sub
+ If ObjFactura.TipoDocto = "Ing" Then
+ If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
+
+ 'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
+ If Me.CveMonedaLineaAdicional = 1 AndAlso ObjFactura.CveMoneda = 2 Then
+ Dim SaldoUSD As Decimal = SaldoIngresosLineaAdicional / TxtTipoCambio.Text.ToDecimal()
+
+ If SaldoUSD < ObjFactura.Total Then
+ TmpDT = TmpDTError.Copy()
+ CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+
+ 'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
+ If Me.CveMonedaLineaAdicional = 2 AndAlso ObjFactura.CveMoneda = 1 Then
+ Dim SaldoMXN As Decimal = SaldoIngresosLineaAdicional * TxtTipoCambio.Text.ToDecimal()
+
+ If SaldoMXN < ObjFactura.Total Then
+ TmpDT = TmpDTError.Copy()
+ CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+ Else
+ 'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
+ If Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
+ TmpDT = TmpDTError.Copy()
+ CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
End If
+ If ObjFactura.TipoDocto = "Rem" Then
+ If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
+
+ 'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
+ If Me.CveMonedaLineaAdicional = 1 AndAlso ObjFactura.CveMoneda = 2 Then
+ Dim SaldoUSD As Decimal = SaldoLineaAdicional / TxtTipoCambio.Text.ToDecimal()
+
+ If SaldoUSD < ObjFactura.Total Then
+ TmpDT = TmpDTError.Copy()
+ CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+
+ 'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
+ If Me.CveMonedaLineaAdicional = 2 AndAlso ObjFactura.CveMoneda = 1 Then
+ Dim SaldoMXN As Decimal = SaldoLineaAdicional * TxtTipoCambio.Text.ToDecimal()
+
+ If SaldoMXN < ObjFactura.Total Then
+ TmpDT = TmpDTError.Copy()
+ CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+ Else
+ 'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
+ If Me.SaldoLineaAdicional < ObjFactura.Total Then
+ TmpDT = TmpDTError.Copy()
+ CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+ End If
+
+
+ 'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
+ 'If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
+ ' TmpDT = TmpDTError.Copy()
+ ' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ ' Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'Else
+ ' If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
+ ' TmpDT = TmpDTError.Copy()
+ ' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ ' Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ ' End If
+ 'End If
+
+ 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
+ 'If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
+ ' TmpDT = TmpDTError.Copy()
+ ' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
+ ' Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
+
If ObjFactura.TipoDocto = "Ing" AndAlso (DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0) Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
@@ -9484,12 +9568,6 @@ Partial Class Ventas
Exit Sub
End If
- If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
- TmpDT = TmpDTError.Copy()
- CalculaTotalesVenta(RecalcularTotalOriginal:=False)
- Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
End If
'If Not CveEmpresaCRM > 0 Then
@@ -14198,14 +14276,26 @@ Partial Class Ventas
End If
ElseIf AplicoNCFacturaActual AndAlso ChkAplicaNCAnticipo.Checked Then
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
+
+ Dim CveConceptoPagoNC As Integer = 251
+ If ObjFactura.CveMoneda > 1 Then
+ CveConceptoPagoNC = 301
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
End If
Else
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
+
+ Dim CveConceptoPagoNC As Integer = 251
+ If ObjFactura.CveMoneda > 1 Then
+ CveConceptoPagoNC = 301
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
@@ -14317,7 +14407,12 @@ Partial Class Ventas
End If
End If
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimientoDev, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMXDev, ImporteME:=If(tipoCambio = 1, 0, importeMovimientoDev), CveSubProyecto:=CveSubProyectoContabilizar) Then
+ Dim CveConceptoPagoNC As Integer = 251
+ If ObjFactura.CveMoneda > 1 Then
+ CveConceptoPagoNC = 301
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimientoDev, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMXDev, ImporteME:=If(tipoCambio = 1, 0, importeMovimientoDev), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
End If
@@ -14526,7 +14621,12 @@ Partial Class Ventas
If importeMovimiento <> 0 Then
- If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVentaNC").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
+ Dim CveConceptoPagoNC As Integer = 251
+ If ObjFactura.CveMoneda > 1 Then
+ CveConceptoPagoNC = 301
+ End If
+
+ If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVentaNC").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, importeMovimiento, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2.DataKey("CveVentaNC").ToString().ToEntero(), ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True
Exit For
@@ -14647,7 +14747,13 @@ Partial Class Ventas
If sumaAmorticaciones <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, 251, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
+
+ Dim CveConceptoPagoNC As Integer = 251
+ If ObjFactura.CveMoneda > 1 Then
+ CveConceptoPagoNC = 301
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True
Else
ViewState("SeGuardoPrePoliza") = True
@@ -18806,10 +18912,12 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "PA") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
DdlLineaAdicional.DataSource = Nothing
+ Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
+
Using ObjVentas As New ClsVentas
'SI ES VENTA EXISTENTE , SI SE VA EDITAR SOLO MOSTRAR LAS CON SALDO, FECHA DE VENCIMIENTO VIGENTE O LA LINEA ACTUAL
If CveVenta > 0 Then
- If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
+ If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= '{Now.ToString("dd/MM/yyyy")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
@@ -18818,14 +18926,14 @@ Partial Class Ventas
Else
'SI SE ESTA FACTURANDO UNA REMISION DEBE SELECCIONAR LA LINEA ADICIONAL DE ESTA
If Me.CveLineaAdicionalVenta > 0 Then
- If ObjVentas.GetLineasAdicionalesSaldo(Me.CveLineaAdicionalVenta, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
+ If ObjVentas.GetLineasAdicionalesSaldo(Me.CveLineaAdicionalVenta, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
End If
End If
Else
- If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
+ If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -24775,15 +24883,30 @@ Partial Class Ventas
If SaldoVenta <> 0 Then
- If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
+ If UsuarioActual.TienePermisoProceso(269) Then
+ DivDevAlm.Visible = True
+ TieneAlmacen = True
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
DivDevAlm.Visible = True
TieneAlmacen = True
- If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
- ChkDevAlm.Checked = True
- ChkDevAlm.Enabled = False
- End If
+ ChkDevAlm.Checked = True
+ ChkDevAlm.Enabled = False
End If
+
+ If (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then
+ Using ObjInv As New ClsInventarios
+ If ObjInv.GetInv_Mov(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInv.DtResultados.Rows.Count > 0 Then
+ Dim RowInv As DataRow = ObjInv.DtResultados.FiltroPrimero("CveConcepto IN (3,40)")
+ If RowInv IsNot Nothing Then
+ CveAlmacenDevolucion = RowInv("CveAlmacen").ToString().ToEntero()
+ End If
+ End If
+ End Using
+ End If
+
End If
End If
@@ -32910,9 +33033,9 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
'spanAlmacen.Attributes.Remove("onclick")
- Tab.ActiveTabIndex = 1
+
HdnCargarInventario.Value = "False"
- Updatetabs.Update()
+ UpParametros.Update()
UpnTools.Update()
@@ -36441,8 +36564,10 @@ Partial Class Ventas
RBLPago.SelectedValue = "1"
RBLPago.Enabled = False
+ Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
+
Using ObjVentas As New ClsVentas
- If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, -1, UsuarioActual.CveEmpresa, FechaVencimientoConsulta:=MinFecha) Then
+ If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
Dim RowLinea As DataRow = ObjVentas.DtResultados.Rows(0)
If RowLinea IsNot Nothing Then
@@ -36552,16 +36677,36 @@ Partial Class Ventas
Exit Sub
End If
- 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
- If Me.SaldoLineaAdicional < TxtTotal.Text.ToDecimal() Then
- Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
+ Dim TotalDocumento As Decimal = TxtTotal.Text.ToDecimal()
- 'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
+ 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If Me.CveMonedaLineaAdicional <> DdlMoneda.SelectedValue.ToEntero() Then
- Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
- Exit Sub
+
+ 'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
+ If Me.CveMonedaLineaAdicional = 1 AndAlso DdlMoneda.SelectedValue.ToEntero() = 2 Then
+ Dim SaldoUSD As Decimal = SaldoLineaAdicional / TxtTipoCambio.Text.ToDecimal()
+
+ If SaldoUSD < TotalDocumento Then
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+
+ 'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
+ If Me.CveMonedaLineaAdicional = 2 AndAlso DdlMoneda.SelectedValue.ToEntero() = 1 Then
+ Dim SaldoMXN As Decimal = SaldoLineaAdicional * TxtTipoCambio.Text.ToDecimal()
+
+ If SaldoMXN < TotalDocumento Then
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+ Else
+ 'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
+ If Me.SaldoLineaAdicional < TotalDocumento Then
+ Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
End If
End If
@@ -36601,7 +36746,7 @@ Partial Class Ventas
'Tab.ActiveTabIndex = 1
HdnCargarInventario.Value = "False"
'Updatetabs.Update()
- UpINV.Update()
+ UpParametros.Update()
End Sub
Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs)
| |