Ventas TC 13 y 83
This commit is contained in:
@@ -3298,7 +3298,7 @@
|
||||
<Width>20.2229cm</Width>
|
||||
<ZIndex>47</ZIndex>
|
||||
<Visibility>
|
||||
<Hidden>=Not Parameters!TieneCartaPorte.Value</Hidden>
|
||||
<Hidden>true</Hidden>
|
||||
</Visibility>
|
||||
<Style>
|
||||
<Border>
|
||||
|
||||
@@ -9443,6 +9443,8 @@ Partial Class Ventas
|
||||
'ContPAQ El movimiento 1 es el de Venta
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
|
||||
AutoConta = AutocontaMatriz(AutoConta)
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
|
||||
AutoConta = False
|
||||
End If
|
||||
@@ -12983,7 +12985,11 @@ Partial Class Ventas
|
||||
If ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio > 0 Then
|
||||
tipoCambio = ObjFactura.TipoCambio
|
||||
ElseIf ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio <= 1 Then
|
||||
tipoCambio = GlobalTipoCambio(ObjFactura.Fecha).ToString().ToDecimal
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
tipoCambio = GlobalTipoCambio(ObjFactura.Fecha.AddDays(-1)).ToString().ToDecimal
|
||||
Else
|
||||
tipoCambio = GlobalTipoCambio(ObjFactura.Fecha).ToString().ToDecimal
|
||||
End If
|
||||
Else
|
||||
tipoCambio = 1
|
||||
End If
|
||||
@@ -13194,7 +13200,13 @@ Partial Class Ventas
|
||||
If tipoCambio > 1 Then
|
||||
TipoCambioNC = tipoCambio
|
||||
Else
|
||||
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate.AddDays(-1)).ToDecimal
|
||||
Else
|
||||
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'APLICA NC SALDOS DIRECTOS
|
||||
@@ -13228,7 +13240,11 @@ Partial Class Ventas
|
||||
|
||||
Dim TCFluctuacion As Decimal = Dr("TCCambioValuacion").ToString().ToDecimal
|
||||
If TCFluctuacion = 1 AndAlso TipoCambioNC > 1 Then
|
||||
TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate.AddDays(-1)).ToDecimal
|
||||
Else
|
||||
TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso Not Dr("TCCambioValuacion").ToString().ToDecimal > 1 Then
|
||||
@@ -13299,8 +13315,13 @@ Partial Class Ventas
|
||||
|
||||
'SI LA NC ES EN DOLARES Y PERO VIENE DE UN ANTICIPO EN PESOS
|
||||
If (Not UsuarioActual.CveEmpresa.Contiene(72, 80, 146)) AndAlso ObjFactura.CveMoneda = 2 Then
|
||||
|
||||
Dim tipoCambioAnticipo = GlobalTipoCambio(row2.DataKey("Fecha").ToString().ToDate).ToDecimal
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
tipoCambioAnticipo = GlobalTipoCambio(row2.DataKey("Fecha").ToString().ToDate.AddDays(-1)).ToDecimal
|
||||
End If
|
||||
|
||||
If row2.DataKey("CveMoneda").ToString.ToEntero = 2 Then
|
||||
IdCtaContable = IdCtaContAnticiposExtranjera
|
||||
End If
|
||||
@@ -14836,7 +14857,11 @@ Partial Class Ventas
|
||||
If ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio > 0 Then
|
||||
tipoCambio = Factura.TipoCambio
|
||||
ElseIf ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio <= 1 Then
|
||||
tipoCambio = GlobalTipoCambio(Factura.Fecha).ToString().ToDecimal
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
tipoCambio = GlobalTipoCambio(Factura.Fecha.AddDays(-1)).ToString().ToDecimal
|
||||
Else
|
||||
tipoCambio = GlobalTipoCambio(Factura.Fecha).ToString().ToDecimal
|
||||
End If
|
||||
Else
|
||||
tipoCambio = 1
|
||||
End If
|
||||
@@ -15523,6 +15548,7 @@ Partial Class Ventas
|
||||
|
||||
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
|
||||
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
|
||||
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
|
||||
@@ -20252,6 +20278,8 @@ Partial Class Ventas
|
||||
If GenerarPrePolizaNueva Then
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
|
||||
AutoConta = AutocontaMatriz(AutoConta)
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
|
||||
AutoConta = False
|
||||
End If
|
||||
@@ -21654,11 +21682,20 @@ Partial Class Ventas
|
||||
ChkConvertirDolares.Enabled = Not UsuarioActual.TienePermisoProceso(324)
|
||||
Case "2"
|
||||
TxtTipoCambioDlls.Text = "1"
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate.AddDays(-1)).ToString()
|
||||
Else
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
||||
End If
|
||||
TrConversionTipoCambio.Visible = True
|
||||
ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324)
|
||||
|
||||
Case Else
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate.AddDays(-1)).ToString()
|
||||
Else
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
||||
End If
|
||||
TrConversionTipoCambio.Visible = True
|
||||
End Select
|
||||
|
||||
@@ -28059,8 +28096,16 @@ Partial Class Ventas
|
||||
|
||||
'verifica el tipo de cambio que se actualice
|
||||
If DdlMoneda.SelectedValue <> "1" Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now.AddDays(-1)).ToString()
|
||||
Else
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
If DdlTipoComprobante.SelectedValue = "Ant" Then CveAnticipo = CveVenta
|
||||
|
||||
@@ -28146,7 +28191,13 @@ Partial Class Ventas
|
||||
|
||||
'verifica el tipo de cambio que se actualice
|
||||
If DdlMoneda.SelectedValue <> "1" Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now.AddDays(-1)).ToString()
|
||||
Else
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
|
||||
End If
|
||||
|
||||
End If
|
||||
LblTCValuacion.Visible = False
|
||||
UpPS.Update()
|
||||
@@ -29254,7 +29305,13 @@ Partial Class Ventas
|
||||
TipoCambioFactura = 1
|
||||
End If
|
||||
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now.AddDays(-1)).ToString()
|
||||
Else
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
|
||||
End If
|
||||
|
||||
DivEstatusFac.Visible = False
|
||||
|
||||
'REINICIALIZA TABS
|
||||
@@ -35139,5 +35196,27 @@ Partial Class Ventas
|
||||
Alert(sb.ToString(), TipoMensaje.MsgInformacion)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function AutocontaMatriz(AutoConta As Boolean) As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
Dim DTSubproyectoActual As DataTable = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero)
|
||||
|
||||
If (DTSubproyectoActual.Rows(0)("TipoSucursal").ToString.ToEntero = 1) Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
Else
|
||||
Respuesta = AutoConta
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user