Actualizar Contrato, actualiza remision y prepoliza de remision
This commit is contained in:
@@ -343,6 +343,61 @@ Public Class ClsContabilidad
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Function UpdatePrePolizasDetalleContrato(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1,
|
||||||
|
Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1,
|
||||||
|
Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1, Optional CveIE As Integer = -1,
|
||||||
|
Optional TipoCambio As Decimal = -1, Optional CveClasificacion As Integer = -1, Optional ImporteME As Decimal = -1) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Conta_PrePolizasDetalleContratoUpdate")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CvePrePolizaDetalle", SqlDbType.Int).Value = CvePrePolizaDetalle
|
||||||
|
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto
|
||||||
|
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
|
||||||
|
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||||
|
.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
|
||||||
|
.Add("@TipoMovto", SqlDbType.Bit).Value = TipoMovto
|
||||||
|
.Add("@TipoCambio", SqlDbType.Decimal).Value = TipoCambio
|
||||||
|
.Add("@ImporteMN", SqlDbType.Money).Value = ImporteMN
|
||||||
|
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||||
|
.Add("@ImporteME", SqlDbType.Money).Value = ImporteME
|
||||||
|
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
|
||||||
|
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
|
||||||
|
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
||||||
|
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||||
|
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
||||||
|
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto
|
||||||
|
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
|
||||||
|
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||||
|
.Add("@CveIE", SqlDbType.Int).Value = CveIE
|
||||||
|
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
If ex.Message.Contains("CuentasResultados_SubProyectos") Then
|
||||||
|
OnError("El concepto requiere que se le especifique centro de costo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
ElseIf ex.Message.Contains("50015") Then
|
||||||
|
OnError("No se puede eliminar una póliza en un ejercicio Cerrado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
If ex.Message.Contains("concepto de bancos con un importe diferente") Then
|
||||||
|
OnError("No se puede editar el valor del bancos con un valor diferente a movimiento registrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al Actualizar la Prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Integer
|
Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Integer
|
||||||
|
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
|
Imports System.Data.SqlClient
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
Imports Modelos
|
||||||
|
|
||||||
|
|
||||||
Partial Class RepContratoDetalle
|
Partial Class RepContratoDetalle
|
||||||
@@ -98,6 +100,82 @@ Partial Class RepContratoDetalle
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property CveVentaRemision As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveVentaRemision") Is Nothing Then
|
||||||
|
ViewState("CveVentaRemision") = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("CveVentaRemision").ToString.ToEntero
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveVentaRemision") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property CveSubProyectoOriginal As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveSubProyectoOriginal") Is Nothing Then
|
||||||
|
ViewState("CveSubProyectoOriginal") = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("CveSubProyectoOriginal").ToString.ToEntero
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveSubProyectoOriginal") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property CveMonedaOriginal As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveMonedaOriginal") Is Nothing Then
|
||||||
|
ViewState("CveMonedaOriginal") = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("CveMonedaOriginal").ToString.ToEntero
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveMonedaOriginal") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Private Property ImporteOrigial As Decimal
|
||||||
|
Get
|
||||||
|
If ViewState("ImporteOrigial") Is Nothing Then
|
||||||
|
ViewState("ImporteOrigial") = 0D
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("ImporteOrigial").ToString.ToDecimal
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Decimal)
|
||||||
|
ViewState("ImporteOrigial") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Private Property DescripcionOriginal As String
|
||||||
|
Get
|
||||||
|
If ViewState("DescripcionOriginal") Is Nothing Then
|
||||||
|
ViewState("DescripcionOriginal") = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return ViewState("DescripcionOriginal").ToString
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("DescripcionOriginal") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Carga Página"
|
#Region "Carga Página"
|
||||||
@@ -166,9 +244,14 @@ Partial Class RepContratoDetalle
|
|||||||
CveContratoEstatus = Contrato.Rows(0)("CveContratosEstatus").ToString.ToEntero
|
CveContratoEstatus = Contrato.Rows(0)("CveContratosEstatus").ToString.ToEntero
|
||||||
DdlSubProyecto.SelectedValueExist(Contrato.Rows(0)("CveSubProyecto").ToString)
|
DdlSubProyecto.SelectedValueExist(Contrato.Rows(0)("CveSubProyecto").ToString)
|
||||||
|
|
||||||
|
CveSubProyectoOriginal = Contrato.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||||
|
CveMonedaOriginal = Contrato.Rows(0)("CveMoneda").ToString.ToEntero
|
||||||
|
ImporteOrigial = Importe
|
||||||
|
DescripcionOriginal = Contrato.Rows(0)("DescripcionContrato").ToString
|
||||||
|
|
||||||
|
CveVentaRemision = Contrato.Rows(0)("CveVentaRemision").ToString.ToEntero
|
||||||
HypRemision.Text = Contrato.Rows(0)("RemisionSerieFolio").ToString
|
HypRemision.Text = Contrato.Rows(0)("RemisionSerieFolio").ToString
|
||||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={ Contrato.Rows(0)("CveVentaRemision").ToString}"
|
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={ CveVentaRemision}"
|
||||||
|
|
||||||
If Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal > 0 Then
|
If Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal > 0 Then
|
||||||
LblSaldo.Text = $"Saldo { Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
LblSaldo.Text = $"Saldo { Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||||
@@ -285,7 +368,7 @@ Partial Class RepContratoDetalle
|
|||||||
End Sub
|
End Sub
|
||||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||||
Dim ArchivoUpdate As String = "-1"
|
Dim ArchivoUpdate As String = "-1"
|
||||||
|
Dim ErrorProceso As Boolean = False
|
||||||
If Session("FileExtension").ToString <> "" Then
|
If Session("FileExtension").ToString <> "" Then
|
||||||
|
|
||||||
'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}"
|
'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}"
|
||||||
@@ -296,22 +379,266 @@ Partial Class RepContratoDetalle
|
|||||||
|
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
ObjContratos.IniciaTransacSQL()
|
ObjContratos.IniciaTransacSQL()
|
||||||
Try
|
|
||||||
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
|
|
||||||
|
If Not ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
|
||||||
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
|
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
|
||||||
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
|
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
|
||||||
Alert("Contrato actualizado correctamente")
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
|
||||||
|
If CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero Or CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero Or ImporteOrigial <> TxtImporte.Text.ToDecimal Or DescripcionOriginal <> TxtDescripcion.Text Then
|
||||||
|
If Not UpdateRemision(ObjContratos.IniciaTransacSQL(), DdlSubProyecto.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, TxtDescripcion.Text) Then
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
Catch ex As Exception
|
|
||||||
Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
|
|
||||||
ObjContratos.RollBack()
|
|
||||||
Finally
|
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
AgregarABitacora($"Actualización del contrato {CveContrato}")
|
AgregarABitacora($"Actualización del contrato {CveContrato}")
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End Try
|
Alert("Contrato actualizado correctamente")
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
|
Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
|
||||||
|
ObjContratos.RollBack()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean
|
||||||
|
|
||||||
|
Dim Respuesta As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim TmpDT As DataTable = New DataTable
|
||||||
|
Dim OcurrioError As Boolean = False
|
||||||
|
Dim ObjVentas As New ClsVentas(transaccionSql)
|
||||||
|
Dim FechaVenta As Date = MinFecha
|
||||||
|
Dim PorcentajeIVA As Decimal = 0D
|
||||||
|
Dim IVANew As Decimal = 0D
|
||||||
|
Dim SubTotalNew As Decimal = TotalNew
|
||||||
|
Dim CvePrePoliza As Integer = -1
|
||||||
|
|
||||||
|
If ObjVentas.GetVenta(CveVentaRemision, UsuarioActual.CveEmpresa) Then
|
||||||
|
FechaVenta = ObjVentas.DtResultados(0)("Fecha").ToString.ToDate
|
||||||
|
CvePrePoliza = ObjVentas.DtResultados(0)("CvePrePoliza").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjVentas.GetVentaDetalle(CveVentaRemision) Then
|
||||||
|
TmpDT = ObjVentas.DtResultados
|
||||||
|
PorcentajeIVA = ObjVentas.DtResultados.MAX("PorcentajeIVA").ToDecimal
|
||||||
|
|
||||||
|
If PorcentajeIVA > 0 Then
|
||||||
|
|
||||||
|
IVANew = (TotalNew * (PorcentajeIVA * 100)) / (100 + (PorcentajeIVA * 100))
|
||||||
|
SubTotalNew = TotalNew - IVANew
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
If TmpDT Is Nothing OrElse TmpDT.Rows.Count = 0 Or FechaVenta = MinFecha Then
|
||||||
|
Alert("Error al obtener los datos de la remisión.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'ObjVentas.IniciaTransacSQL()
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||||
|
'Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||||
|
'Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
||||||
|
|
||||||
|
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
||||||
|
'Dim TipoCambio As Decimal = GlobalTipoCambio(FechaVenta).ToDecimal
|
||||||
|
'Dim CveClienteSucursal As Integer = -1
|
||||||
|
|
||||||
|
Dim TC As Decimal = If(CveMonedaNew = 2, GlobalTipoCambio(FechaVenta).ToDecimal, 1)
|
||||||
|
|
||||||
|
Try
|
||||||
|
''CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
||||||
|
'If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||||
|
|
||||||
|
' For Each Row As DataRow In TmpDT.Rows
|
||||||
|
' Row("PU") = Math.Round(Row("PU").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6)
|
||||||
|
' Row("Total") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' Dim ImpuestosLocales As Double = 0
|
||||||
|
' For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
|
' If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
' gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero
|
||||||
|
' ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' TxtSubTotal.Text = TmpDT.SUM("Total").FormatoNumero
|
||||||
|
' LblDescuentos.Text = TmpDT.SUM("Descuento").FormatoNumero
|
||||||
|
' LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
|
||||||
|
' TxtIVA.Text = TmpDT.SUM("ImporteIVA").FormatoNumero
|
||||||
|
' TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").FormatoNumero
|
||||||
|
' TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").FormatoNumero
|
||||||
|
' TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").FormatoNumero
|
||||||
|
' TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
|
||||||
|
|
||||||
|
' TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
||||||
|
' Moneda = 2
|
||||||
|
'End If
|
||||||
|
|
||||||
|
''CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES
|
||||||
|
'If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
|
||||||
|
' Dim Importe As Decimal
|
||||||
|
|
||||||
|
|
||||||
|
' For Each Row As DataRow In TmpDT.Rows
|
||||||
|
' Row("PU") = Math.Round(Row("PU").ToString().ToDecimal * TCC, 6)
|
||||||
|
' Row("Total") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDecimal * TCC, NumeroDecimales)
|
||||||
|
' Importe = Row("Total").ToString().ToDecimal - Row("Descuento").ToString().ToDecimal
|
||||||
|
' Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString().ToDecimal, NumeroDecimales)
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' Dim ImpuestosLocales As Double = 0
|
||||||
|
' For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
|
' If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
' gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero
|
||||||
|
' ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' TxtSubTotal.Text = TmpDT.SUM("Total").FormatoNumero
|
||||||
|
' LblDescuentos.Text = TmpDT.SUM("Descuento").FormatoNumero
|
||||||
|
' LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
|
||||||
|
' TxtIVA.Text = TmpDT.SUM("ImporteIVA").FormatoNumero
|
||||||
|
' TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").FormatoNumero
|
||||||
|
' TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").FormatoNumero
|
||||||
|
' TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").FormatoNumero
|
||||||
|
' TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
|
||||||
|
|
||||||
|
|
||||||
|
' TipoCambio = 1
|
||||||
|
' Moneda = 1
|
||||||
|
'End If
|
||||||
|
|
||||||
|
'Dim FechaParaSurtir As DateTime = MinFecha
|
||||||
|
'If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then
|
||||||
|
' FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime()
|
||||||
|
'End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not ObjVentas.UpdateVentas(SubTotalNew, 0, IVANew, 0, TotalNew, CveMonedaNew, TC, FechaVenta, "",
|
||||||
|
UsuarioActual.CveEmpresa, CveVentaRemision,
|
||||||
|
Vigencia:=FechaVenta, CondicionesPago:=-1,
|
||||||
|
PedidoContrato:="-1", AtencionA:="-1", CveMetodoPago33:=-1,
|
||||||
|
CveFormaPago33:=-1, TipoDocto:="Rem", CveCliente:=-1, CveClienteSucursal:=-1,
|
||||||
|
OrdenCompra:="-1", RetIVA:=0, RetISR:=0, Kilometraje:=0D, CveUsoCFDi:=-1,
|
||||||
|
CveVendedor:=-1, ServicioDomicilio:=False, CveMedico:=-1, CveProcedimiento:=-1,
|
||||||
|
FechaParaSurtir:=MinFecha, Paciente:="-1", Episodio:="-1", CveCondicionEntrega:=-1, FolioRemision:="-1") Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
|
||||||
|
If Not OcurrioError Then
|
||||||
|
Dim index As Integer = 0
|
||||||
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
|
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
|
||||||
|
If CveVentaDetalle > 0 Then
|
||||||
|
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, SubTotalNew, Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), IVANew, PorcentajeIVA, 0, DescripcionNew, UsuarioActual.CveUsuario) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Exit For ' solo debe de tener un detalle por eso se sale
|
||||||
|
index = index + 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If Not OcurrioError Then
|
||||||
|
|
||||||
|
' Dim ObjPrePoliza As New ClsContabilidad(transaccionSql)
|
||||||
|
Dim DTPrePoliza As New DataTable
|
||||||
|
|
||||||
|
If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTPrePoliza = ObjConta.DtResultados
|
||||||
|
If DTPrePoliza.Rows.Count = 0 Then
|
||||||
|
OcurrioError = True
|
||||||
|
Alert("No se encontraron datos de prepoliza", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
For Each dRow As DataRow In DTPrePoliza.Rows
|
||||||
|
|
||||||
|
If Not ObjConta.UpdatePrePolizasDetalleContrato(dRow("CvePrePolizaDetalle").ToString.ToEntero, dRow("Concepto").ToString, dRow("CveSubProyecto").ToString.ToEntero, -1, Boolean.Parse(dRow("TipoMovto").ToString), ImporteMN:=(TotalNew * TC), Importe:=TotalNew, TipoCambio:=TC, ImporteME:=If(CveMonedaNew = 2, TotalNew, 0)) Then
|
||||||
|
OcurrioError = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If ObjConta.ValidacionesPrePoliza(-1, UsuarioActual, Opcion:=2, CveVenta:=CveVentaRemision) Then
|
||||||
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
|
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||||
|
OcurrioError = True
|
||||||
|
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OcurrioError = True
|
||||||
|
OnError("Ocurrió un error al actualizar la remisión", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If OcurrioError Then
|
||||||
|
'Alert("Ocurrió un error al guardar los cambios. Por favor intente de nuevo.", TipoMensaje.MsgError)
|
||||||
|
Return False
|
||||||
|
Else
|
||||||
|
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
Protected Sub EliminarContrato(sender As Object, e As EventArgs)
|
Protected Sub EliminarContrato(sender As Object, e As EventArgs)
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
If (CveContratoTipo = 35) Then
|
If (CveContratoTipo = 35) Then
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/* .fc-month-view .fc-day {
|
.fc-month-view .fc-day {
|
||||||
border-left: 4px solid #464646;
|
border-left: 4px solid #464646;
|
||||||
border-right: 4px solid #464646
|
border-right: 4px solid #464646
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
.fc-month-view .fc-row.fc-week.fc-widget-content:last-of-type {
|
.fc-month-view .fc-row.fc-week.fc-widget-content:last-of-type {
|
||||||
border-bottom: 4px solid #464646!important;
|
border-bottom: 4px solid #464646!important;
|
||||||
} */
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.css" type="text/css">
|
<link rel="stylesheet" href="/Transportes/Gant/dhtmlxgantt.css" type="text/css">
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@
|
|||||||
<asp:UpdatePanel ID="UPGat" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UPGat" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<div style="display:none">
|
<div >
|
||||||
<div class="gantt-samples-banner_controls_bar controls_bar" style="display:none!important">
|
<div class="gantt-samples-banner_controls_bar controls_bar" style="display:none!important">
|
||||||
|
|
||||||
<strong>Formato: </strong>
|
<strong>Formato: </strong>
|
||||||
@@ -734,7 +734,8 @@
|
|||||||
<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
|
<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
|
||||||
<script src="https://cdn.amcharts.com/lib/5/xy.js"></script>
|
<script src="https://cdn.amcharts.com/lib/5/xy.js"></script>
|
||||||
<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>
|
<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>
|
||||||
<script src="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.js"></script>
|
<%--<script src="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.js"></script>--%>
|
||||||
|
<script src="/Transportes/Gant/dhtmlxgantt.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// Create root element
|
// Create root element
|
||||||
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
|
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
|
||||||
|
|||||||
@@ -154,9 +154,9 @@ Partial Class RepContratosCalendario
|
|||||||
Dim FechaI = txtFechaI.Text.ToDateTime()
|
Dim FechaI = txtFechaI.Text.ToDateTime()
|
||||||
Dim FechaF = txtFechaF.Text.ToDateTime()
|
Dim FechaF = txtFechaF.Text.ToDateTime()
|
||||||
|
|
||||||
Dim ScriptZoomx = $"zoomAxis({FechaI.Year},{FechaI.Month - 1},{FechaI.Day},{FechaF.Year},{FechaF.Month - 1},{FechaF.Day});"
|
'Dim ScriptZoomx = $"zoomAxis({FechaI.Year},{FechaI.Month - 1},{FechaI.Day},{FechaF.Year},{FechaF.Month - 1},{FechaF.Day});"
|
||||||
Dim ScriptZoomy = $"zoomAxisy(0,{If(jsonCategorias.Count > 9, 9, jsonCategorias.Count - 1)});"
|
'Dim ScriptZoomy = $"zoomAxisy(0,{If(jsonCategorias.Count > 9, 9, jsonCategorias.Count - 1)});"
|
||||||
RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});{ScriptZoomx};{ScriptZoomy};", "A1")
|
'RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});{ScriptZoomx};{ScriptZoomy};", "A1")
|
||||||
'RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", "A1")
|
'RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", "A1")
|
||||||
|
|
||||||
|
|
||||||
@@ -249,16 +249,16 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
'If Not SeEncontro Then
|
If Not SeEncontro Then
|
||||||
' If encontrados > 0 Then
|
If encontrados > 0 Then
|
||||||
' separator = ","
|
separator = ","
|
||||||
' End If
|
End If
|
||||||
' str.AppendLine(String.Format("{0}", separator))
|
str.AppendLine(String.Format("{0}", separator))
|
||||||
' str.AppendLine(String.Format("{{id: {1}, text: ""{2}"", start_date: ""{3}"", end_date: ""{4}"", parent: {5}, progress:{6}, open: true, unidad: ""{7}"",duracion: ""{8}"", color: ""{9}"",codigoaf: ""{10}"", hidden: true}} ",
|
str.AppendLine(String.Format("{{id: {1}, text: ""{2}"", start_date: ""{3}"", end_date: ""{4}"", parent: {5}, progress:{6}, open: true, unidad: ""{7}"",duracion: ""{8}"", color: ""{9}"",codigoaf: ""{10}"", hidden: true}} ",
|
||||||
' "", CveActivoFijo, -1, txtFechaF.Text.ToDate.ToString("yyyy/MM/dd HH:mm"), txtFechaF.Text.ToDate.ToString("yyyy/MM/dd HH:mm"), 0, 100, "", "", ColorAleatorio(randomNumber), CodigoAF))
|
"", CveActivoFijo, -1, txtFechaF.Text.ToDate.ToString("yyyy/MM/dd HH:mm"), txtFechaF.Text.ToDate.ToString("yyyy/MM/dd HH:mm"), 0, 100, "", "", ColorAleatorio(randomNumber), CodigoAF))
|
||||||
' separator = ","
|
separator = ","
|
||||||
|
|
||||||
'End If
|
End If
|
||||||
|
|
||||||
'str.AppendLine(String.Format("}"))
|
'str.AppendLine(String.Format("}"))
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
|
|
||||||
str.AppendLine("];loadGant();")
|
str.AppendLine("];loadGant();")
|
||||||
'RegistraScript(str.ToString())
|
RegistraScript(str.ToString())
|
||||||
|
|
||||||
UPPGantt.Update()
|
UPPGantt.Update()
|
||||||
UPGat.Update()
|
UPGat.Update()
|
||||||
|
|||||||
Reference in New Issue
Block a user