Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3493,10 +3493,63 @@ Public Class ClsContratos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Region " MAQUINARIA FLOTILLA HERRAMIENTA "
|
||||||
|
|
||||||
|
|
||||||
|
Public Function AddContratosMaquinariaFlotilla(CveActivoFijo As Integer, Fecha As Date, CvePersonal As Integer, Importe As Decimal, CveContratoDetalle As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
Dataset = New DataSet()
|
||||||
|
DataAdapter("PA_Con_ContratosMaquinariaFlotillaAdd")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
|
||||||
|
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
||||||
|
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
||||||
|
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||||
|
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Dataset)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar el registro.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function GetContratosMaquinariaFlotillaSubTipoAF(CveContrato As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
Dataset = New DataSet()
|
||||||
|
DataAdapter("PA_Con_ContratosMaquinariaFlotillaSuibTipoAFGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
|
||||||
|
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el registro.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
#Region " IDisposable Support "
|
#Region " IDisposable Support "
|
||||||
' IDisposable
|
' IDisposable
|
||||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||||
If Not disposedValue Then
|
If Not disposedValue Then
|
||||||
If disposing Then
|
If disposing Then
|
||||||
|
|||||||
@@ -7052,6 +7052,28 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
||||||
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
|
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
|
||||||
|
Case "RNC"
|
||||||
|
|
||||||
|
|
||||||
|
NombreArchivo = "RemisionNC"
|
||||||
|
NombreArchivoDescarga = "RemisionNC"
|
||||||
|
TipoDocumento = "REMISION"
|
||||||
|
|
||||||
|
params.Add(New ReportParameter("TipoDocumento", NombreArchivoDescarga))
|
||||||
|
params.Add(New ReportParameter("Tipo", TipoDocumento))
|
||||||
|
params.Add(New ReportParameter("Ref", TipoDocumentoRef))
|
||||||
|
params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
|
||||||
|
|
||||||
|
'ALAN YEPIZ
|
||||||
|
If UsuarioActual.CveEmpresa.Contiene(123) Then
|
||||||
|
params.Add(New ReportParameter("DiaExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Day)))
|
||||||
|
params.Add(New ReportParameter("MesExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Month)))
|
||||||
|
params.Add(New ReportParameter("AñoExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Year)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
||||||
|
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
NombreArchivo = ""
|
NombreArchivo = ""
|
||||||
TipoDocumento = ""
|
TipoDocumento = ""
|
||||||
|
|||||||
@@ -1912,6 +1912,27 @@ Namespace Modelos
|
|||||||
DtVentasNC.Rows.Add(Dr)
|
DtVentasNC.Rows.Add(Dr)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Function CancelarMovimientosUsados(factura As Modelos.Factura, UsuarioActual As Usuario, ByRef ObjAcum As ClsAcumuladores) As Boolean
|
||||||
|
Dim Retorno As Boolean = True
|
||||||
|
If ObjAcum.DistribuidorMovtosGet(factura.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=factura.CveVenta, CveConcepto:=2) Then
|
||||||
|
Dim CveConceptoSalida As Integer = 2
|
||||||
|
|
||||||
|
Dim DtSalidas As DataTable = ObjAcum.DtResultados.FiltraParametros("Cantidad > 0")
|
||||||
|
If DtSalidas IsNot Nothing AndAlso DtSalidas.Rows.Count > 0 Then
|
||||||
|
For Each RowSalida As DataRow In DtSalidas.Rows
|
||||||
|
Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
|
||||||
|
|
||||||
|
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConceptoSalida, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "") Then
|
||||||
|
Retorno = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
DtSalidas.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
Private Function GuardarUsados(ByRef ObjAcum As ClsAcumuladores, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura, ByRef Optional Resp As MMensajeFactura = Nothing) As Boolean
|
Private Function GuardarUsados(ByRef ObjAcum As ClsAcumuladores, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura, ByRef Optional Resp As MMensajeFactura = Nothing) As Boolean
|
||||||
Dim Resultado As Boolean = True
|
Dim Resultado As Boolean = True
|
||||||
|
|
||||||
@@ -4407,63 +4428,79 @@ Namespace Modelos
|
|||||||
If ObjFactura.FolioFiscal <> "" Then
|
If ObjFactura.FolioFiscal <> "" Then
|
||||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||||
|
|
||||||
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion)
|
'VERIFICA SI DEBE VALIDAR ANTE EL SAT
|
||||||
|
If Not (UsuarioActual.Empresa.Funcionalidad(529) = "1") Then
|
||||||
|
|
||||||
If Vigencia IsNot Nothing Then
|
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion)
|
||||||
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
|
||||||
Retorno.Mensaje = "Esta factura no es cancelable."
|
If Vigencia IsNot Nothing Then
|
||||||
|
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
||||||
|
Retorno.Mensaje = "Esta factura no es cancelable."
|
||||||
|
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End If
|
||||||
|
If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then
|
||||||
|
ContinuarCancelacion = False
|
||||||
|
ObtenerAcuse = True
|
||||||
|
Dim solicitud = New WSGF.Service1SoapClient()
|
||||||
|
Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal)
|
||||||
|
|
||||||
|
If acuse.Estado = 0 Then
|
||||||
|
Dim xmlAcuse = New System.Xml.XmlDocument()
|
||||||
|
xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64))
|
||||||
|
CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText
|
||||||
|
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
|
||||||
|
CveEstatus = 5
|
||||||
|
Else
|
||||||
|
CancelacionFecha = Now.Date
|
||||||
|
CancelacionAcuse = ""
|
||||||
|
CveEstatus = 5
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then
|
||||||
|
|
||||||
|
If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then
|
||||||
|
CveEstatus = 20
|
||||||
|
ContinuarCancelacion = False
|
||||||
|
ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then
|
||||||
|
CveEstatus = 20
|
||||||
|
ContinuarCancelacion = True
|
||||||
|
RequiereAceptacion = True
|
||||||
|
ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
|
||||||
|
ContinuarCancelacion = True
|
||||||
|
CveEstatus = 5
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
If Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
|
||||||
|
ContinuarCancelacion = True
|
||||||
|
CveEstatus = 5
|
||||||
|
Else
|
||||||
|
CveEstatus = 20
|
||||||
|
ContinuarCancelacion = False
|
||||||
|
CancelacionFecha = Now.Date
|
||||||
|
CancelacionAcuse = ""
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Retorno.Mensaje = "SAT - No se pudo verificar el estatus de la factura."
|
||||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End If
|
End If
|
||||||
If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then
|
|
||||||
ContinuarCancelacion = False
|
|
||||||
ObtenerAcuse = True
|
|
||||||
Dim solicitud = New WSGF.Service1SoapClient()
|
|
||||||
Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal)
|
|
||||||
|
|
||||||
If acuse.Estado = 0 Then
|
|
||||||
Dim xmlAcuse = New System.Xml.XmlDocument()
|
|
||||||
xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64))
|
|
||||||
CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText
|
|
||||||
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
|
|
||||||
CveEstatus = 5
|
|
||||||
Else
|
|
||||||
CancelacionFecha = Now.Date
|
|
||||||
CancelacionAcuse = ""
|
|
||||||
CveEstatus = 5
|
|
||||||
End If
|
|
||||||
|
|
||||||
ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then
|
|
||||||
|
|
||||||
If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then
|
|
||||||
CveEstatus = 20
|
|
||||||
ContinuarCancelacion = False
|
|
||||||
ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then
|
|
||||||
CveEstatus = 20
|
|
||||||
ContinuarCancelacion = True
|
|
||||||
RequiereAceptacion = True
|
|
||||||
ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
|
|
||||||
ContinuarCancelacion = True
|
|
||||||
CveEstatus = 5
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
If Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
|
|
||||||
ContinuarCancelacion = True
|
|
||||||
CveEstatus = 5
|
|
||||||
Else
|
|
||||||
CveEstatus = 20
|
|
||||||
ContinuarCancelacion = False
|
|
||||||
CancelacionFecha = Now.Date
|
|
||||||
CancelacionAcuse = ""
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
Retorno.Mensaje = "SAT - No se pudo verificar el estatus de la factura."
|
ObtenerAcuse = False
|
||||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
ContinuarCancelacion = True
|
||||||
|
CancelacionFecha = Now.Date
|
||||||
|
CancelacionAcuse = ""
|
||||||
|
|
||||||
|
Dim diasTimbrado As Decimal = DateDiff(DateInterval.Day, ObjFactura.FechaCP, Now)
|
||||||
|
|
||||||
|
If ObjFactura.Total < 5000D OrElse diasTimbrado <= 3 OrElse ObjFactura.Cliente.RFC.Contiene("XAXX010101000", "XEXX010101000") Then
|
||||||
|
RequiereAceptacion = False
|
||||||
|
End If
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObtenerAcuse Then
|
If Not ObtenerAcuse Then
|
||||||
@@ -4558,6 +4595,7 @@ Namespace Modelos
|
|||||||
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
|
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
|
||||||
|
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
@@ -4974,6 +5012,16 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'CANCELA MOVIMIENTOS DE USADOS
|
||||||
|
If Not ErrorCancelar Then
|
||||||
|
If ObjFactura.TipoDocto = "Ing" Then
|
||||||
|
If Not CancelarMovimientosUsados(ObjFactura, UsuarioActual, ObjAcum) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Ocurrió un error al cancelar los movimientos de usados"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE
|
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE
|
||||||
|
|||||||
@@ -59,18 +59,20 @@ Public Class Timbrado
|
|||||||
Public Function CFDICancelar(Empresa As Empresa, FolioFiscal As String, Total As Decimal, RFCReceptor As String, RFCEmisor As String, Optional CvePACCancelacion As Integer = 2, Optional ValidaFactura As Boolean = True) As Boolean
|
Public Function CFDICancelar(Empresa As Empresa, FolioFiscal As String, Total As Decimal, RFCReceptor As String, RFCEmisor As String, Optional CvePACCancelacion As Integer = 2, Optional ValidaFactura As Boolean = True) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
Dim MsgCancelacion As New StringBuilder
|
Dim MsgCancelacion As New StringBuilder
|
||||||
If ValidaFactura Then
|
|
||||||
Dim Vigencia = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True)
|
If Not (Empresa.Funcionalidad(529) = "1") Then
|
||||||
If Vigencia IsNot Nothing Then
|
If ValidaFactura Then
|
||||||
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
Dim Vigencia = VerificarVigenciaSAT(FolioFiscal, RFCEmisor, RFCReceptor, Total.ToString(), True)
|
||||||
|
If Vigencia IsNot Nothing Then
|
||||||
|
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
MsgCancelacion.AppendFormat("CvePAC:{0}", CvePACCancelacion)
|
MsgCancelacion.AppendFormat("CvePAC:{0}", CvePACCancelacion)
|
||||||
|
|
||||||
Select Case CvePACCancelacion
|
Select Case CvePACCancelacion
|
||||||
|
|||||||
@@ -5058,8 +5058,12 @@ Partial Class Bancos_IE
|
|||||||
Dim fileItem As Archivo = Filesgral(0)
|
Dim fileItem As Archivo = Filesgral(0)
|
||||||
Dim Path As String = HttpContext.Current.Request.ApplicationPath
|
Dim Path As String = HttpContext.Current.Request.ApplicationPath
|
||||||
Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||||
Path = HttpContext.Current.Request.MapPath(Path)
|
|
||||||
|
Path = Extensiones.DirectorioBaseEmpresas
|
||||||
Path += String.Format("Empresas/{0}/IE", UsuarioActual.CveEmpresa)
|
Path += String.Format("Empresas/{0}/IE", UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Not Directory.Exists(Path) Then
|
If Not Directory.Exists(Path) Then
|
||||||
Directory.CreateDirectory(Path)
|
Directory.CreateDirectory(Path)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1366,7 +1366,15 @@ Partial Class Compras_Compras
|
|||||||
Dim ObjPersonal As New ClsRH
|
Dim ObjPersonal As New ClsRH
|
||||||
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
||||||
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
||||||
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1")
|
|
||||||
|
If UsuarioActual.CveEmpresa = 119 Then
|
||||||
|
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados
|
||||||
|
Else
|
||||||
|
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ObjPersonal.Dispose()
|
ObjPersonal.Dispose()
|
||||||
DdlPersonal.DataBind()
|
DdlPersonal.DataBind()
|
||||||
DdlPersonalReembolso.DataBind()
|
DdlPersonalReembolso.DataBind()
|
||||||
|
|||||||
@@ -2710,7 +2710,7 @@ Partial Class Compras_eFacturas
|
|||||||
Dim PrefijoPagos As String = ""
|
Dim PrefijoPagos As String = ""
|
||||||
|
|
||||||
For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
||||||
If nodoPrefijo.Prefix <> "tfd" Then
|
If nodoPrefijo.Prefix <> "tfd" And nodoPrefijo.Prefix.ToUpper.Contains("PAGO") Then
|
||||||
PrefijoPagos = nodoPrefijo.Prefix
|
PrefijoPagos = nodoPrefijo.Prefix
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|||||||
@@ -102,6 +102,10 @@
|
|||||||
<asp:LinkButton ID="LnkModalAddGastos" Visible="false" runat="server" OnClick="LnkModalAddGastos_Click"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Agregar Gasto</asp:LinkButton>
|
<asp:LinkButton ID="LnkModalAddGastos" Visible="false" runat="server" OnClick="LnkModalAddGastos_Click"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Agregar Gasto</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkModalAddMaquinariaFlotilla" Visible="false" runat="server" OnClick="LnkModalAddMaquinariaFlotilla_Click"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Agregar Maquionaria Flotilla Herramienta</asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
@@ -1011,19 +1015,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
|
||||||
<%-- <asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
|
||||||
<EditItemTemplate>
|
|
||||||
<div style="width: 65px;">
|
|
||||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
|
||||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" /><asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
|
||||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
|
||||||
</div>
|
|
||||||
</EditItemTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
|
||||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>--%>
|
|
||||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red"
|
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red"
|
||||||
@@ -2720,7 +2712,7 @@
|
|||||||
<asp:DropDownList ID="DdlRubro" runat="server" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;" AutoPostBack="true" OnSelectedIndexChanged="DdlRubro_SelectedIndexChanged">
|
<asp:DropDownList ID="DdlRubro" runat="server" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;" AutoPostBack="true" OnSelectedIndexChanged="DdlRubro_SelectedIndexChanged">
|
||||||
<asp:ListItem Value="2">Insumos</asp:ListItem>
|
<asp:ListItem Value="2">Insumos</asp:ListItem>
|
||||||
<asp:ListItem Value="3">Mano de Obra</asp:ListItem>
|
<asp:ListItem Value="3">Mano de Obra</asp:ListItem>
|
||||||
<asp:ListItem Value="4">Flotillas</asp:ListItem>
|
<asp:ListItem Value="4">Maquinaria Herramienta Flotilla</asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<label for="<%= DdlRubro.ClientID.ToString()%>">Rubro:</label>
|
<label for="<%= DdlRubro.ClientID.ToString()%>">Rubro:</label>
|
||||||
|
|
||||||
@@ -2764,18 +2756,30 @@
|
|||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVActividadesRH" visible="false" >
|
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVActividadesRH" visible="false" >
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlActividades" runat="server" DataTextField="Actividad" DataValueField="CveActividad" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;"></asp:DropDownList>
|
<asp:DropDownList ID="DdlActividades" runat="server" DataTextField="Actividad" DataValueField="CveActividad" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;"></asp:DropDownList>
|
||||||
<label for="<%= DdlActividades.ClientID.ToString()%>">Actividad:</label>
|
<label for="<%= DdlActividades.ClientID.ToString()%>">Actividad:</label>
|
||||||
<asp:RequiredFieldValidator ID="RFVDdlActividades" runat="server" ControlToValidate="DdlActividades" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Actividad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVDdlActividades" runat="server" ControlToValidate="DdlActividades" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Actividad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl"></asp:RequiredFieldValidator>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVSubTipoActivoFijo" visible="false" >
|
||||||
|
<asp:DropDownList ID="DdlSubTipoActivoFijo" runat="server" DataTextField="SubTipoActivoFijo" DataValueField="CveSubTipoActivoFijo" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;"></asp:DropDownList>
|
||||||
|
<label for="<%= DdlSubTipoActivoFijo.ClientID.ToString()%>">Sub Tipo Activo Fijo:</label>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlSubTipoActivoFijo" runat="server" ControlToValidate="DdlActividades" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Tipo Activo Fijo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl"></asp:RequiredFieldValidator>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVDias" visible="false">
|
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVDias" visible="false">
|
||||||
<asp:TextBox ID="TxtDias" runat="server" CssClass="form-control" ></asp:TextBox>
|
<asp:TextBox ID="TxtDias" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender ID="FilTxtDias" runat="server" TargetControlID="TxtDias" FilterType="Numbers" InvalidChars="-+.," />
|
<ajax:FilteredTextBoxExtender ID="FilTxtDias" runat="server" TargetControlID="TxtDias" FilterType="Numbers" InvalidChars="-+.," />
|
||||||
<asp:RequiredFieldValidator ID="RFVTxtDias" runat="server" ControlToValidate="TxtDias" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dias''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl" ></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVTxtDias" runat="server" ControlToValidate="TxtDias" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dias''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl" ></asp:RequiredFieldValidator>
|
||||||
<label for="<%= TxtDias.ClientID.ToString()%>">Dias:</label>
|
<label for="<%= TxtDias.ClientID.ToString()%>">Dias:</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" style="text-align:right!important">
|
<div class="form-group form-md-line-input input-iconright" style="text-align:right!important">
|
||||||
<asp:CheckBox ID="ChkContinualAgregandoControl" runat="server" TextAlign="Left" Text="Continuar agregando" CssClass="form-control" Checked="true" />
|
<asp:CheckBox ID="ChkContinualAgregandoControl" runat="server" TextAlign="Left" Text="Continuar agregando" CssClass="form-control" Checked="true" />
|
||||||
@@ -2890,6 +2894,94 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<%--MODAL CONTROL PRESUPUESTOS AGREGAR--%>
|
||||||
|
<div id="ModalMaquinaria" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog" style="width: 450px;">
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalMaquinariaFlotilla" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="Literal7" runat="server">Maquinaria Flotilla </asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlSubTipoAF" runat="server" DataTextField="SubTipoActivoFijo" DataValueField="CveClaveDetalle" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;" AutoPostBack="true" >
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDdlSubTipoAF" runat="server" ControlToValidate="DdlSubTipoAF" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Tipo Activo Fijo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddMaquinaria"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlSubTipoAF.ClientID.ToString()%>">Sub Tipo Activo Fijo:</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlAF" Width="100%" runat="server" CssClass="table-group-action-input form-control input-inline input-sm select2me" AppendDataBoundItems="true" DataTextField="CodDesc" DataValueField="CveActivoFijo" Style="width: 100%;" ValidationGroup="GrpAddMaquinaria" >
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione uno" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDdlAF" runat="server" ControlToValidate="DdlAF" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Activo Fijo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddMaquinaria"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlAF.ClientID.ToString()%>">Activo Fijo:</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlPersonal" Width="100%" runat="server" CssClass="table-group-action-input form-control input-inline input-sm select2me" DataTextField="NombreCompleto" DataValueField="CvePersonal" Style="width: 100%;" ValidationGroup="GrpAddMaquinaria" >
|
||||||
|
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDdlPersonal" runat="server" ControlToValidate="DdlPersonal" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Personal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddMaquinaria"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlPersonal.ClientID.ToString()%>">Personal:</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="110px" ID="TxtFechaMaquinaria" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="LnkFechaMaquinaria" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEETxtFechaMaquinaria" runat="server" TargetControlID="TxtFechaMaquinaria" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="CETxtFechaMaquinaria" TargetControlID="TxtFechaMaquinaria" PopupButtonID="LnkFechaMaquinaria" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVTxtFechaMaquinaria" runat="server" ControlToValidate="TxtFechaMaquinaria" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="CVTxtFechaMaquinaria" runat="server" ControlToValidate="TxtFechaMaquinaria" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAddMaquinaria"></asp:CompareValidator>
|
||||||
|
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtFechaMaquinaria" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaMaquinaria" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtMaquinariaImporte" runat="server" Width="70px" CssClass="form-control"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FilTxtMaquinariaImporte" runat="server" TargetControlID="TxtMaquinariaImporte" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
|
<asp:RequiredFieldValidator ID="RFVTxtMaquinariaImporte" runat="server" ControlToValidate="TxtMaquinariaImporte" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddMaquinaria"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtMaquinariaImporte.ClientID.ToString()%>">Importe:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" style="text-align:right!important">
|
||||||
|
<asp:CheckBox ID="ChkModalMaquinaria" runat="server" TextAlign="Left" Text="Continuar agregando" CssClass="form-control" Checked="true" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<td id="TD2" runat="server" visible="false"></td>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button Text="Guardar" runat="server" ID="BtnModalMaquinariaAdd" Width="100px" OnClick="BtnModalMaquinariaAdd_Click" ValidationGroup="GrpAddMaquinaria" class="btn btn-success" />
|
||||||
|
<button id="Button8" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<iframe id="my_iframe" style="display: none;"></iframe>
|
<iframe id="my_iframe" style="display: none;"></iframe>
|
||||||
|
|
||||||
|
|||||||
@@ -436,6 +436,7 @@ Partial Class Contratos_ContratoObra
|
|||||||
LnkModalAddPSControl.Visible = True
|
LnkModalAddPSControl.Visible = True
|
||||||
LnkModalAddPresupuestoVentas.Visible = True
|
LnkModalAddPresupuestoVentas.Visible = True
|
||||||
LnkModalAddPresupuestoControl.Visible = True
|
LnkModalAddPresupuestoControl.Visible = True
|
||||||
|
LnkModalAddMaquinariaFlotilla.Visible = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1824,6 +1825,7 @@ Partial Class Contratos_ContratoObra
|
|||||||
Row("Rubro") = DdlRubro.SelectedItem.Text
|
Row("Rubro") = DdlRubro.SelectedItem.Text
|
||||||
|
|
||||||
If DdlRubro.SelectedValue.ToEntero = 3 Then
|
If DdlRubro.SelectedValue.ToEntero = 3 Then
|
||||||
|
|
||||||
Row("CveActividad") = DdlActividades.SelectedValue.ToEntero
|
Row("CveActividad") = DdlActividades.SelectedValue.ToEntero
|
||||||
Row("Actividad") = DdlActividades.SelectedItem.Text
|
Row("Actividad") = DdlActividades.SelectedItem.Text
|
||||||
Row("Dias") = TxtDias.Text.ToEntero
|
Row("Dias") = TxtDias.Text.ToEntero
|
||||||
@@ -1838,6 +1840,23 @@ Partial Class Contratos_ContratoObra
|
|||||||
Row("PS") = DdlActividades.SelectedItem.Text
|
Row("PS") = DdlActividades.SelectedItem.Text
|
||||||
Row("CodigoPS") = DdlActividades.SelectedItem.Text
|
Row("CodigoPS") = DdlActividades.SelectedItem.Text
|
||||||
|
|
||||||
|
|
||||||
|
ElseIf DdlRubro.SelectedValue.ToEntero = 4 Then
|
||||||
|
|
||||||
|
Row("CveActividad") = -1
|
||||||
|
Row("Actividad") = ""
|
||||||
|
Row("Dias") = TxtDias.Text.ToEntero
|
||||||
|
Row("CveSubTipoActivoFijo") = DdlSubTipoActivoFijo.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
Row("CveUM") = -1
|
||||||
|
Row("UM") = ""
|
||||||
|
Row("CveClasificacion") = -1
|
||||||
|
Row("Clasificacion") = ""
|
||||||
|
Row("CvePS") = -1
|
||||||
|
Row("PS") = DdlSubTipoActivoFijo.SelectedItem.Text
|
||||||
|
Row("CodigoPS") = DdlSubTipoActivoFijo.SelectedItem.Text
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Row("CveActividad") = -1
|
Row("CveActividad") = -1
|
||||||
Row("Actividad") = ""
|
Row("Actividad") = ""
|
||||||
@@ -1903,11 +1922,22 @@ Partial Class Contratos_ContratoObra
|
|||||||
|
|
||||||
If CveRubro = 3 Then
|
If CveRubro = 3 Then
|
||||||
|
|
||||||
|
CveSubTipoActivoFijo = -1
|
||||||
CveActividad = DdlActividades.SelectedValue.ToEntero
|
CveActividad = DdlActividades.SelectedValue.ToEntero
|
||||||
Dias = TxtDias.Text.ToEntero
|
Dias = TxtDias.Text.ToEntero
|
||||||
|
|
||||||
CvePS = -1
|
CvePS = -1
|
||||||
CveUM = -1
|
CveUM = -1
|
||||||
|
|
||||||
|
ElseIf CveRubro = 4 Then
|
||||||
|
|
||||||
|
CveSubTipoActivoFijo = DdlSubTipoActivoFijo.SelectedValue.ToEntero
|
||||||
|
CveActividad = -1
|
||||||
|
Dias = TxtDias.Text.ToEntero
|
||||||
|
|
||||||
|
CvePS = -1
|
||||||
|
CveUM = -1
|
||||||
|
|
||||||
Else
|
Else
|
||||||
CvePS = DdlProductowsInsumos.SelectedValue.ToEntero
|
CvePS = DdlProductowsInsumos.SelectedValue.ToEntero
|
||||||
CveUM = DdlUMInsumos.SelectedValue.ToEntero
|
CveUM = DdlUMInsumos.SelectedValue.ToEntero
|
||||||
@@ -1923,23 +1953,45 @@ Partial Class Contratos_ContratoObra
|
|||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then
|
If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then
|
||||||
|
|
||||||
If Autorizado Then
|
'If Autorizado Then
|
||||||
Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}",
|
' Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}",
|
||||||
row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU)
|
' row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU)
|
||||||
guardarBitacora(msj)
|
' guardarBitacora(msj)
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
row("Cantidad") = Cantidad
|
row("Cantidad") = Cantidad
|
||||||
row("CantidadContratada") = Cantidad
|
row("CantidadContratada") = Cantidad
|
||||||
row("PU") = PU
|
row("PU") = PU
|
||||||
row("Total") = Cantidad * PU
|
row("Total") = Cantidad * PU
|
||||||
row("CveUM") = CveUM
|
row("CveUM") = CveUM
|
||||||
row("UM") = DdlUMInsumos.SelectedItem.Text
|
|
||||||
row("NoIdentificacion") = "" 'NoIdentificacion
|
row("NoIdentificacion") = "" 'NoIdentificacion
|
||||||
row("LimitarCantidad") = False
|
row("LimitarCantidad") = False
|
||||||
|
|
||||||
|
row("CveActividad") = CveActividad
|
||||||
|
row("CveSubTipoActivoFijo") = CveSubTipoActivoFijo
|
||||||
|
row("Dias") = Dias
|
||||||
|
|
||||||
|
|
||||||
|
If CveRubro = 3 Then
|
||||||
|
row("PS") = DdlActividades.SelectedItem.Text
|
||||||
|
row("CodigoPS") = DdlActividades.SelectedItem.Text
|
||||||
|
row("UM") = ""
|
||||||
|
ElseIf CveRubro = 4 Then
|
||||||
|
row("PS") = DdlSubTipoActivoFijo.SelectedItem.Text
|
||||||
|
row("CodigoPS") = DdlSubTipoActivoFijo.SelectedItem.Text
|
||||||
|
row("UM") = ""
|
||||||
|
Else
|
||||||
|
row("UM") = DdlUMInsumos.SelectedItem.Text
|
||||||
|
End If
|
||||||
|
|
||||||
TmpDT.AcceptChanges()
|
TmpDT.AcceptChanges()
|
||||||
|
|
||||||
Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion)
|
Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion)
|
||||||
RegistraScript("$('#ModalControlAddPS').modal('hide')")
|
RegistraScript("$('#ModalControlAddPS').modal('hide')")
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Error al Actualizar Detalle", TipoMensaje.MsgError)
|
Alert("Error al Actualizar Detalle", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
@@ -4163,22 +4215,43 @@ Partial Class Contratos_ContratoObra
|
|||||||
|
|
||||||
DVDias.Visible = True
|
DVDias.Visible = True
|
||||||
DVActividadesRH.Visible = True
|
DVActividadesRH.Visible = True
|
||||||
|
DVSubTipoActivoFijo.Visible = False
|
||||||
|
|
||||||
DVClasificacion.Visible = False
|
DVClasificacion.Visible = False
|
||||||
DVPS.Visible = False
|
DVPS.Visible = False
|
||||||
DVUM.Visible = False
|
DVUM.Visible = False
|
||||||
|
|
||||||
DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad"))
|
DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad"))
|
||||||
|
DdlSubTipoActivoFijo.SelectedValueExist(-1)
|
||||||
TxtDias.Text = gvRow.DataKey("Dias")
|
TxtDias.Text = gvRow.DataKey("Dias")
|
||||||
|
|
||||||
|
ElseIf CveRubro = 4 Then
|
||||||
|
|
||||||
|
|
||||||
|
DVDias.Visible = True
|
||||||
|
DVActividadesRH.Visible = False
|
||||||
|
DVSubTipoActivoFijo.Visible = True
|
||||||
|
|
||||||
|
|
||||||
|
DVClasificacion.Visible = False
|
||||||
|
DVPS.Visible = False
|
||||||
|
DVUM.Visible = False
|
||||||
|
|
||||||
|
DdlActividades.SelectedValueExist(-1)
|
||||||
|
DdlSubTipoActivoFijo.SelectedValueExist(gvRow.DataKey("CveSubTipoActivoFijo"))
|
||||||
|
TxtDias.Text = gvRow.DataKey("Dias")
|
||||||
|
|
||||||
Else
|
Else
|
||||||
DVDias.Visible = False
|
DVDias.Visible = False
|
||||||
DVActividadesRH.Visible = False
|
DVActividadesRH.Visible = False
|
||||||
|
DVSubTipoActivoFijo.Visible = False
|
||||||
|
|
||||||
DVClasificacion.Visible = True
|
DVClasificacion.Visible = True
|
||||||
DVPS.Visible = True
|
DVPS.Visible = True
|
||||||
DVUM.Visible = True
|
DVUM.Visible = True
|
||||||
|
|
||||||
DdlActividades.SelectedValueExist(-1)
|
DdlActividades.SelectedValueExist(-1)
|
||||||
|
DdlSubTipoActivoFijo.SelectedValueExist(-1)
|
||||||
TxtDias.Text = "0"
|
TxtDias.Text = "0"
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -4218,18 +4291,22 @@ Partial Class Contratos_ContratoObra
|
|||||||
UpModalVentasAddPS.Update()
|
UpModalVentasAddPS.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LimpiarModalControl()
|
Private Sub LimpiarModalControl()
|
||||||
|
|
||||||
DdlActividades.Items.Clear()
|
DdlActividades.Items.Clear()
|
||||||
|
DdlSubTipoActivoFijo.Items.Clear()
|
||||||
|
|
||||||
|
|
||||||
DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa)
|
DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa)
|
||||||
DdlActividades.DataBind()
|
DdlActividades.DataBind()
|
||||||
|
|
||||||
DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
||||||
|
|
||||||
|
DdlSubTipoActivoFijo.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa)
|
||||||
|
DdlSubTipoActivoFijo.DataBind()
|
||||||
|
DdlSubTipoActivoFijo.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||||
|
|
||||||
TxtCantidadInsumos.Text = ""
|
TxtCantidadInsumos.Text = ""
|
||||||
'ChkLimitarInsumos.Checked = False
|
|
||||||
'TxtNoIdentificacionvInsumos.Text = ""
|
|
||||||
|
|
||||||
DdlClasificacionAddInsumos.SelectedValueExist(-1)
|
DdlClasificacionAddInsumos.SelectedValueExist(-1)
|
||||||
DdlProductowsInsumos.txtText.Value = ""
|
DdlProductowsInsumos.txtText.Value = ""
|
||||||
@@ -4238,8 +4315,6 @@ Partial Class Contratos_ContratoObra
|
|||||||
TxtPUInsumos.Text = ""
|
TxtPUInsumos.Text = ""
|
||||||
|
|
||||||
DdlRubro.SelectedValue = "2"
|
DdlRubro.SelectedValue = "2"
|
||||||
' DdlRubro_SelectedIndexChanged(Nothing, Nothing)
|
|
||||||
|
|
||||||
|
|
||||||
DVClasificacion.Visible = True
|
DVClasificacion.Visible = True
|
||||||
DVPS.Visible = True
|
DVPS.Visible = True
|
||||||
@@ -4263,7 +4338,33 @@ Partial Class Contratos_ContratoObra
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LimpiarModalMaquinaria()
|
||||||
|
|
||||||
|
DdlPersonal.Items.Clear()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
|
DdlPersonal.DataBind()
|
||||||
|
DdlPersonal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||||
|
|
||||||
|
Dim Objcontratos As New ClsContratos
|
||||||
|
If Objcontratos.GetContratosMaquinariaFlotillaSubTipoAF(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||||
|
DdlSubTipoAF.DataSource = Objcontratos.DtResultados
|
||||||
|
End If
|
||||||
|
Objcontratos.Dispose()
|
||||||
|
DdlSubTipoAF.DataBind()
|
||||||
|
DdlSubTipoAF.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||||
|
|
||||||
|
|
||||||
|
TxtFechaMaquinaria.Text = ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
UpModalMaquinariaFlotilla.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
@@ -4287,7 +4388,7 @@ Partial Class Contratos_ContratoObra
|
|||||||
|
|
||||||
DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos")
|
DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos")
|
||||||
DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra")
|
DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra")
|
||||||
DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Flotillas")
|
DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Maquinaria")
|
||||||
|
|
||||||
ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas)
|
ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas)
|
||||||
|
|
||||||
@@ -4579,6 +4680,7 @@ Partial Class Contratos_ContratoObra
|
|||||||
Row("Observacion") = ""
|
Row("Observacion") = ""
|
||||||
|
|
||||||
DTPS.Rows.Add(Row)
|
DTPS.Rows.Add(Row)
|
||||||
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -4590,6 +4692,48 @@ Partial Class Contratos_ContratoObra
|
|||||||
|
|
||||||
If Not DTCargaPresupuestoFlotillas Is Nothing Then
|
If Not DTCargaPresupuestoFlotillas Is Nothing Then
|
||||||
|
|
||||||
|
For Each DrowPS As DataRow In DTCargaPresupuestoFlotillas.Rows
|
||||||
|
|
||||||
|
Dim CveSubTipoActivoFijo As Integer = 0
|
||||||
|
Dim SubTipoActivoFijo As String = DrowPS("SubTipoAF").ToString
|
||||||
|
|
||||||
|
CveSubTipoActivoFijo = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $" SubTipoActivoFijo = '{DrowPS("SubTipoAF").ToString }'").ToEntero
|
||||||
|
|
||||||
|
If CveSubTipoActivoFijo > 0 Then
|
||||||
|
|
||||||
|
Dim Row As DataRow = DTPS.NewRow()
|
||||||
|
Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
|
||||||
|
Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
|
||||||
|
Row("CveUM") = -1
|
||||||
|
Row("UM") = "Maquinaria Flotilla"
|
||||||
|
Row("CveClasificacion") = -1
|
||||||
|
Row("Clasificacion") = ""
|
||||||
|
Row("CvePS") = -1
|
||||||
|
Row("PS") = SubTipoActivoFijo
|
||||||
|
Row("CodigoPS") = SubTipoActivoFijo
|
||||||
|
Row("PU") = DrowPS("PU").ToString.ToDouble
|
||||||
|
Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
|
||||||
|
|
||||||
|
Row("CveTipoPresupuesto") = 1
|
||||||
|
Row("CveRubro") = 3
|
||||||
|
Row("CveActividad") = -1
|
||||||
|
Row("CveSubTipoActivoFijo") = CveSubTipoActivoFijo
|
||||||
|
Row("Dias") = DrowPS("Horas").ToString.ToEntero
|
||||||
|
|
||||||
|
Row("NoIdentificacion") = ""
|
||||||
|
Row("OCInterna") = ""
|
||||||
|
Row("LimitarCantidad") = 0
|
||||||
|
Row("Observacion") = ""
|
||||||
|
|
||||||
|
DTPS.Rows.Add(Row)
|
||||||
|
Else
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -4643,6 +4787,7 @@ Partial Class Contratos_ContratoObra
|
|||||||
NrowTmpDT("Rubro") = Row("Rubro")
|
NrowTmpDT("Rubro") = Row("Rubro")
|
||||||
NrowTmpDT("Actividad") = Row("Actividad")
|
NrowTmpDT("Actividad") = Row("Actividad")
|
||||||
NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo")
|
NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo")
|
||||||
|
NrowTmpDT("Dias") = Row("Dias")
|
||||||
|
|
||||||
|
|
||||||
NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||||
@@ -4975,13 +5120,28 @@ Partial Class Contratos_ContratoObra
|
|||||||
Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
If DdlRubro.SelectedValue.ToEntero = 3 Then
|
If DdlRubro.SelectedValue.ToEntero = 3 Then 'Rubro RH
|
||||||
DVDias.Visible = True
|
DVDias.Visible = True
|
||||||
DVActividadesRH.Visible = True
|
DVActividadesRH.Visible = True
|
||||||
|
|
||||||
DVClasificacion.Visible = False
|
DVClasificacion.Visible = False
|
||||||
DVPS.Visible = False
|
DVPS.Visible = False
|
||||||
DVUM.Visible = False
|
DVUM.Visible = False
|
||||||
|
|
||||||
|
DVSubTipoActivoFijo.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
ElseIf DdlRubro.SelectedValue.ToEntero = 4 Then 'Rubro Maquinaria florilla herramienta
|
||||||
|
|
||||||
|
DVDias.Visible = True
|
||||||
|
DVActividadesRH.Visible = False
|
||||||
|
|
||||||
|
DVClasificacion.Visible = False
|
||||||
|
DVPS.Visible = False
|
||||||
|
DVUM.Visible = False
|
||||||
|
|
||||||
|
DVSubTipoActivoFijo.Visible = True
|
||||||
|
|
||||||
Else
|
Else
|
||||||
DVDias.Visible = False
|
DVDias.Visible = False
|
||||||
DVActividadesRH.Visible = False
|
DVActividadesRH.Visible = False
|
||||||
@@ -4990,11 +5150,89 @@ Partial Class Contratos_ContratoObra
|
|||||||
DVPS.Visible = True
|
DVPS.Visible = True
|
||||||
DVUM.Visible = True
|
DVUM.Visible = True
|
||||||
|
|
||||||
|
DVSubTipoActivoFijo.Visible = False
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
UpModalControlAddPS.Update()
|
UpModalControlAddPS.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkModalAddMaquinariaFlotilla_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
LimpiarModalMaquinaria()
|
||||||
|
RegistraScript("$('#ModalMaquinaria').modal('show');")
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub DdlSubTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubTipoAF.SelectedIndexChanged
|
||||||
|
|
||||||
|
DdlAF.Items.Clear()
|
||||||
|
|
||||||
|
If DdlSubTipoAF.SelectedIndex > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
Dim CveSubTipoActivoFijo As Integer = 0
|
||||||
|
|
||||||
|
Dim Separador As Char() = {"-"c}
|
||||||
|
|
||||||
|
Try
|
||||||
|
CveSubTipoActivoFijo = DdlSubTipoAF.SelectedValue.Split(Separador)(0).ToEntero
|
||||||
|
Catch ex As Exception
|
||||||
|
CveSubTipoActivoFijo = 0
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If CveSubTipoActivoFijo > 0 Then
|
||||||
|
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1).FiltraParametros(String.Format("CveSubTipoActivoFijo IN ({0})", CveSubTipoActivoFijo))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
DdlAF.DataSource = Nothing
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
DdlAF.DataBind()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DdlAF.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
|
|
||||||
|
UpModalMaquinariaFlotilla.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub BtnModalMaquinariaAdd_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim CveContratoDetalle As Integer = 0
|
||||||
|
|
||||||
|
Dim Separador As Char() = {"-"c}
|
||||||
|
|
||||||
|
Try
|
||||||
|
CveContratoDetalle = DdlSubTipoAF.SelectedValue.Split(Separador)(1).ToEntero
|
||||||
|
Catch ex As Exception
|
||||||
|
CveContratoDetalle = 0
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Dim ObjContrato As New ClsContratos
|
||||||
|
|
||||||
|
If ObjContrato.AddContratosMaquinariaFlotilla(DdlAF.SelectedValue.ToEntero, TxtFechaMaquinaria.Text.ToDate, DdlPersonal.SelectedValue.ToEntero, TxtMaquinariaImporte.Text.ToDecimal, CveContratoDetalle) Then
|
||||||
|
|
||||||
|
|
||||||
|
If Not ChkModalMaquinaria.Checked Then
|
||||||
|
RegistraScript("$('#ModalMaquinaria').modal('hide');")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Alert("Registro agregado correctamente.")
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjContrato.Dispose()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,40 +3,6 @@
|
|||||||
<Body>
|
<Body>
|
||||||
<ReportItems>
|
<ReportItems>
|
||||||
<Rectangle Name="Rectangle4">
|
<Rectangle Name="Rectangle4">
|
||||||
<ReportItems>
|
|
||||||
<Textbox Name="Textbox43">
|
|
||||||
<CanGrow>true</CanGrow>
|
|
||||||
<KeepTogether>true</KeepTogether>
|
|
||||||
<Paragraphs>
|
|
||||||
<Paragraph>
|
|
||||||
<TextRuns>
|
|
||||||
<TextRun>
|
|
||||||
<Value>=Parameters!TipoRelacionTexto.Value</Value>
|
|
||||||
<Style>
|
|
||||||
<FontFamily>Myriad Pro</FontFamily>
|
|
||||||
<FontSize>8pt</FontSize>
|
|
||||||
</Style>
|
|
||||||
</TextRun>
|
|
||||||
</TextRuns>
|
|
||||||
<Style />
|
|
||||||
</Paragraph>
|
|
||||||
</Paragraphs>
|
|
||||||
<rd:DefaultName>Textbox29</rd:DefaultName>
|
|
||||||
<Top>0.7092cm</Top>
|
|
||||||
<Left>10.09673cm</Left>
|
|
||||||
<Height>0.41981cm</Height>
|
|
||||||
<Width>7.14985cm</Width>
|
|
||||||
<Style>
|
|
||||||
<Border>
|
|
||||||
<Style>None</Style>
|
|
||||||
</Border>
|
|
||||||
<PaddingLeft>2pt</PaddingLeft>
|
|
||||||
<PaddingRight>2pt</PaddingRight>
|
|
||||||
<PaddingTop>2pt</PaddingTop>
|
|
||||||
<PaddingBottom>2pt</PaddingBottom>
|
|
||||||
</Style>
|
|
||||||
</Textbox>
|
|
||||||
</ReportItems>
|
|
||||||
<KeepTogether>true</KeepTogether>
|
<KeepTogether>true</KeepTogether>
|
||||||
<Top>5.67653in</Top>
|
<Top>5.67653in</Top>
|
||||||
<Left>0.06096in</Left>
|
<Left>0.06096in</Left>
|
||||||
@@ -2377,6 +2343,39 @@
|
|||||||
<PaddingBottom>2pt</PaddingBottom>
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
</Style>
|
</Style>
|
||||||
</Textbox>
|
</Textbox>
|
||||||
|
<Textbox Name="Textbox43">
|
||||||
|
<CanGrow>true</CanGrow>
|
||||||
|
<KeepTogether>true</KeepTogether>
|
||||||
|
<Paragraphs>
|
||||||
|
<Paragraph>
|
||||||
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>=Parameters!TipoRelacionTexto.Value</Value>
|
||||||
|
<Style>
|
||||||
|
<FontFamily>Myriad Pro</FontFamily>
|
||||||
|
<FontSize>8pt</FontSize>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
|
</TextRuns>
|
||||||
|
<Style />
|
||||||
|
</Paragraph>
|
||||||
|
</Paragraphs>
|
||||||
|
<rd:DefaultName>Textbox29</rd:DefaultName>
|
||||||
|
<Top>15.12759cm</Top>
|
||||||
|
<Left>10.25157cm</Left>
|
||||||
|
<Height>0.41981cm</Height>
|
||||||
|
<Width>7.14985cm</Width>
|
||||||
|
<ZIndex>17</ZIndex>
|
||||||
|
<Style>
|
||||||
|
<Border>
|
||||||
|
<Style>None</Style>
|
||||||
|
</Border>
|
||||||
|
<PaddingLeft>2pt</PaddingLeft>
|
||||||
|
<PaddingRight>2pt</PaddingRight>
|
||||||
|
<PaddingTop>2pt</PaddingTop>
|
||||||
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
|
</Style>
|
||||||
|
</Textbox>
|
||||||
<Textbox Name="Textbox41">
|
<Textbox Name="Textbox41">
|
||||||
<CanGrow>true</CanGrow>
|
<CanGrow>true</CanGrow>
|
||||||
<KeepTogether>true</KeepTogether>
|
<KeepTogether>true</KeepTogether>
|
||||||
@@ -2403,7 +2402,7 @@
|
|||||||
<Left>0.21692cm</Left>
|
<Left>0.21692cm</Left>
|
||||||
<Height>0.54004cm</Height>
|
<Height>0.54004cm</Height>
|
||||||
<Width>20.7077cm</Width>
|
<Width>20.7077cm</Width>
|
||||||
<ZIndex>17</ZIndex>
|
<ZIndex>18</ZIndex>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
<Style>None</Style>
|
<Style>None</Style>
|
||||||
@@ -2440,7 +2439,7 @@
|
|||||||
<Left>17.56899cm</Left>
|
<Left>17.56899cm</Left>
|
||||||
<Height>0.6cm</Height>
|
<Height>0.6cm</Height>
|
||||||
<Width>3.32021cm</Width>
|
<Width>3.32021cm</Width>
|
||||||
<ZIndex>18</ZIndex>
|
<ZIndex>19</ZIndex>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
<Style>None</Style>
|
<Style>None</Style>
|
||||||
@@ -2623,6 +2622,7 @@
|
|||||||
<rd:DataSourceID>c220a38d-e45b-4e04-917e-7dfd9cc3345f</rd:DataSourceID>
|
<rd:DataSourceID>c220a38d-e45b-4e04-917e-7dfd9cc3345f</rd:DataSourceID>
|
||||||
</DataSource>
|
</DataSource>
|
||||||
</DataSources>
|
</DataSources>
|
||||||
|
|
||||||
<DataSets>
|
<DataSets>
|
||||||
<DataSet Name="DsOC">
|
<DataSet Name="DsOC">
|
||||||
<Query>
|
<Query>
|
||||||
|
|||||||
@@ -2204,7 +2204,7 @@
|
|||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Fields!Cantidad.Value * Fields!PU.Value</Value>
|
<Value>=(Fields!Cantidad.Value * Fields!PU.Value) - Fields!Descuento.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>Myriad Pro</FontFamily>
|
<FontFamily>Myriad Pro</FontFamily>
|
||||||
<FontSize>7.5pt</FontSize>
|
<FontSize>7.5pt</FontSize>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4257,6 +4257,7 @@
|
|||||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||||
<asp:ListItem Text="Entradas" Value="1"></asp:ListItem>
|
<asp:ListItem Text="Entradas" Value="1"></asp:ListItem>
|
||||||
<asp:ListItem Text="Salidas" Value="2"></asp:ListItem>
|
<asp:ListItem Text="Salidas" Value="2"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Acreditamiento" Value="6"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -932,6 +932,7 @@
|
|||||||
<th style="width: 100px;" colspan="3">Comandos</th>
|
<th style="width: 100px;" colspan="3">Comandos</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th runat="server" visible="false" id="nomostrar2"></th>
|
<th runat="server" visible="false" id="nomostrar2"></th>
|
||||||
|
<th runat="server" visible="false" id="thProntoPago2"></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="TextTab" runat="server" id="TrEdit">
|
<tr class="TextTab" runat="server" id="TrEdit">
|
||||||
<th>
|
<th>
|
||||||
@@ -1040,6 +1041,7 @@
|
|||||||
<asp:LinkButton ID="LbVerInventario" ClientIDMode="Static" runat="server" CssClass="btn btn-circle btn-sm purple" Text="<i class='icon-magnifier'></i>"></asp:LinkButton>
|
<asp:LinkButton ID="LbVerInventario" ClientIDMode="Static" runat="server" CssClass="btn btn-circle btn-sm purple" Text="<i class='icon-magnifier'></i>"></asp:LinkButton>
|
||||||
</th>--%>
|
</th>--%>
|
||||||
<th runat="server" visible="false" id="nomostrar"></th>
|
<th runat="server" visible="false" id="nomostrar"></th>
|
||||||
|
<th runat="server" visible="false" id="thProntoPago"></th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1255,6 +1257,8 @@
|
|||||||
<asp:DropDownList runat="server" ID="DdlFR" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="FuenteRecaudacionCodigoRubroIngreso" DataValueField="CvePresupuestoIngreso" Style="max-width: 100px;" OnSelectedIndexChanged="DdlFR_SelectedIndexChanged"></asp:DropDownList>
|
<asp:DropDownList runat="server" ID="DdlFR" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="FuenteRecaudacionCodigoRubroIngreso" DataValueField="CvePresupuestoIngreso" Style="max-width: 100px;" OnSelectedIndexChanged="DdlFR_SelectedIndexChanged"></asp:DropDownList>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
<%--22--%>
|
||||||
|
<asp:BoundField DataField="TieneProntoPago" HeaderText="Pronto Pago" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ReadOnly="true" Visible="false" />
|
||||||
</Columns>
|
</Columns>
|
||||||
<RowStyle CssClass="Texto" />
|
<RowStyle CssClass="Texto" />
|
||||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||||
@@ -1360,19 +1364,26 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
<td style="border: 1px none white"><b>Descuentos. RNC.:</b></td>
|
<td style="border: 1px none white"><b>Descuentos RNC:</b></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:Label ID="LblDescuentosRNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
<asp:Label ID="LblDescuentosRNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
<td align="right"> <asp:LinkButton ID="LnkDescuentosRNC" runat="server" OnClick="LnkDescuentosRNC_Click" Text="<i class='fa fa-tag fa-lg font-green'></i>" AlternateText="Aplicacion de RNC" Style="cursor: pointer;" />
|
<td align="right"> <asp:LinkButton ID="LnkDescuentosRNC" runat="server" OnClick="LnkDescuentosRNC_Click" Text="<i class='fa fa-tag fa-lg font-green'></i>" AlternateText="Aplicacion de RNC" Style="cursor: pointer;" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
<td style="border: 1px none white"><b>Total NC.:</b></td>
|
<td style="border: 1px none white"><b>Total NC:</b></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:Label ID="LblTotalNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
<asp:Label ID="LblTotalNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr align="right">
|
||||||
|
<td style="border: 1px none white"><b>Pronto Pago:</b></td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblProntoPago" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
|
<td align="right">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1576,6 +1587,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<asp:HiddenField ID="HdnTotalRNC" runat="server" ClientIDMode="Static" Value="0" />
|
<asp:HiddenField ID="HdnTotalRNC" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
|
<asp:HiddenField ID="HdnProntoPago" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
@@ -7220,7 +7232,7 @@
|
|||||||
if (Chk.checked) {
|
if (Chk.checked) {
|
||||||
let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
|
let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
|
||||||
let ImportesAsignados = 0;
|
let ImportesAsignados = 0;
|
||||||
|
|
||||||
$('.ImportesRNCCargo').each(function () {
|
$('.ImportesRNCCargo').each(function () {
|
||||||
if ($(this).context.id != TxtImporte.id) {
|
if ($(this).context.id != TxtImporte.id) {
|
||||||
ImportesAsignados += ToDouble($(this).val());
|
ImportesAsignados += ToDouble($(this).val());
|
||||||
@@ -7235,16 +7247,15 @@
|
|||||||
TxtImporte.value = FormatoNumero(Saldo, 2);
|
TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TxtImporte.value = "";
|
if (SaldoMaximoUtilizable > 0) {
|
||||||
Chk.checked = false;
|
TxtImporte.value = "";
|
||||||
//if (SaldoMaximoUtilizable > 0) {
|
Chk.checked = false;
|
||||||
// TxtImporte.value = "";
|
} else {
|
||||||
// Chk.checked = false;
|
TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||||
//} else {
|
}
|
||||||
// TxtImporte.value = FormatoNumero(Saldo, 2);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
TxtImporte.value = "";
|
TxtImporte.value = "";
|
||||||
}
|
}
|
||||||
@@ -7791,7 +7802,10 @@
|
|||||||
var totalDebito = ToDouble($get("TxtImporteDebito").value);
|
var totalDebito = ToDouble($get("TxtImporteDebito").value);
|
||||||
var totalCheque = ToDouble($get("TxtImporteCheque").value);
|
var totalCheque = ToDouble($get("TxtImporteCheque").value);
|
||||||
var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
|
var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
|
||||||
|
|
||||||
var totalRNC = ToDouble($get("HdnTotalRNC").value);
|
var totalRNC = ToDouble($get("HdnTotalRNC").value);
|
||||||
|
var totalAmortizado = ToDouble($get("HdnAnticipos").value);
|
||||||
|
var totalProntoPago = ToDouble($get("HdnProntoPago").value);
|
||||||
|
|
||||||
var TotalOtrosContado = 0;
|
var TotalOtrosContado = 0;
|
||||||
|
|
||||||
@@ -7801,7 +7815,7 @@
|
|||||||
}
|
}
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
|
||||||
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado + totalRNC;
|
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado + totalRNC + totalAmortizado + totalProntoPago;
|
||||||
var totalVenta = ToDouble($get('TxtTotal').value);
|
var totalVenta = ToDouble($get('TxtTotal').value);
|
||||||
|
|
||||||
if (total > totalVenta) {
|
if (total > totalVenta) {
|
||||||
@@ -7810,7 +7824,7 @@
|
|||||||
$get("TxtCambio").value = "0.00";
|
$get("TxtCambio").value = "0.00";
|
||||||
}
|
}
|
||||||
|
|
||||||
$get("TxtImporteContado").value = total - totalRNC;
|
$get("TxtImporteContado").value = total - totalRNC - totalAmortizado - totalProntoPago;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ****************************************************************************************************************************************************************************
|
// ****************************************************************************************************************************************************************************
|
||||||
|
|||||||
@@ -3996,6 +3996,8 @@ Partial Class Ventas
|
|||||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||||
GvPS.DataSource = ObjVentas.DtResultados
|
GvPS.DataSource = ObjVentas.DtResultados
|
||||||
GvPS.DataBind()
|
GvPS.DataBind()
|
||||||
|
|
||||||
@@ -7842,6 +7844,25 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
Dim SerieFolioNCProntoPago As String = ""
|
||||||
|
Dim CveVentaNCProntoPago As Integer = -1
|
||||||
|
Dim GeneroDescuentoProntoPago As Boolean = False
|
||||||
|
If ObjFactura.DescuentoProntoPago > 0 Then
|
||||||
|
Dim RespFacturaProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjContPaq, ObjFactura)
|
||||||
|
If RespFacturaProntoPago.ObjFacturaProntoPago Is Nothing OrElse RespFacturaProntoPago Is Nothing Then
|
||||||
|
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
|
||||||
|
Else
|
||||||
|
If RespFacturaProntoPago.Mensaje.CveVenta <= 0 OrElse RespFacturaProntoPago.Mensaje.TieneError Then
|
||||||
|
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
|
||||||
|
Else
|
||||||
|
GeneroDescuentoProntoPago = True
|
||||||
|
CveVentaNCProntoPago = RespFacturaProntoPago.Mensaje.CveVenta
|
||||||
|
SerieFolioNCProntoPago = RespFacturaProntoPago.Mensaje.SerieFolio
|
||||||
|
|
||||||
|
Obj2.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
|
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
|
||||||
If ErrorList.Count = 0 Then
|
If ErrorList.Count = 0 Then
|
||||||
@@ -7941,7 +7962,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'ENVIAR POLIZA VIRTUAL
|
'ENVIAR POLIZA VIRTUAL
|
||||||
If ErrorList.Count = 0 Then
|
If ErrorList.Count = 0 Then
|
||||||
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
|
||||||
GeneraPolizaVentaWS(ObjFactura)
|
GeneraPolizaVentaWS(ObjFactura)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -8034,7 +8055,7 @@ Partial Class Ventas
|
|||||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||||
|
|
||||||
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||||
If Not IsNothing(Obj2) AndAlso Obj2.Count > 0 AndAlso SeTimbro Then
|
If Not GeneroDescuentoProntoPago AndAlso Not IsNothing(Obj2) AndAlso Obj2.Count > 0 AndAlso SeTimbro Then
|
||||||
Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura)
|
Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura)
|
||||||
'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
|
'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
|
||||||
If TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
If TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
||||||
@@ -8046,9 +8067,25 @@ Partial Class Ventas
|
|||||||
GeneraPDFFactura(ChkEnviarFactura.Checked)
|
GeneraPDFFactura(ChkEnviarFactura.Checked)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||||
|
If GeneroDescuentoProntoPago AndAlso Not IsNothing(Obj2) AndAlso Obj2.Count > 0 AndAlso SeTimbro Then
|
||||||
|
Try
|
||||||
|
Dim ofa As Modelos.Factura = CType(Obj2(Obj2.Count - 1), Modelos.Factura)
|
||||||
|
'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
|
||||||
|
ofa.Timbre.CFDIRelacionados.UUID.Clear()
|
||||||
|
ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID)
|
||||||
|
|
||||||
|
ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
|
||||||
|
GeneraPDFFactura(ChkEnviarFactura.Checked)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al timbrar la nota de credito", ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
|
If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
|
||||||
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not SeTimbro Then
|
If Not SeTimbro Then
|
||||||
Alert(ObjTimbrado.MensajeErrorCFDI, TipoMensaje.MsgError)
|
Alert(ObjTimbrado.MensajeErrorCFDI, TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
@@ -8207,6 +8244,10 @@ Partial Class Ventas
|
|||||||
MensajeAlert.AppendFormat("<br/><br/>Su cambio es de <b>${0}</b><br/>", TxtCambio.Text.ToDecimal.FormatoNumero(2))
|
MensajeAlert.AppendFormat("<br/><br/>Su cambio es de <b>${0}</b><br/>", TxtCambio.Text.ToDecimal.FormatoNumero(2))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If CveVentaNCProntoPago > 0 Then
|
||||||
|
MensajeAlert.AppendFormat(String.Format("<br/>La nota de crédito <b>{0}</b> por descuento pronto pago se generó correctamente.<br/><br/>", SerieFolioNCProntoPago))
|
||||||
|
End If
|
||||||
|
|
||||||
'MUESTA ALERT OK
|
'MUESTA ALERT OK
|
||||||
' si es elrol 1165-Ventas,EMp:80, o la empresa 119, recarga ventas, para seguir registrando-.
|
' si es elrol 1165-Ventas,EMp:80, o la empresa 119, recarga ventas, para seguir registrando-.
|
||||||
Dim Liga = If(UsuarioActual.CveRol = 1165 Or UsuarioActual.CveEmpresa = 119, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", If(CveEmpresaCRM > 0, $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}&Opt=2"";"))
|
Dim Liga = If(UsuarioActual.CveRol = 1165 Or UsuarioActual.CveEmpresa = 119, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", If(CveEmpresaCRM > 0, $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}&Opt=2"";"))
|
||||||
@@ -9649,6 +9690,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ObjFactura.CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero()
|
ObjFactura.CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero()
|
||||||
|
ObjFactura.DescuentoProntoPago = HdnProntoPago.Value.ToDecimal()
|
||||||
|
|
||||||
ObjFactura.NuevaFactura = Me.NuevaFactura
|
ObjFactura.NuevaFactura = Me.NuevaFactura
|
||||||
End Sub
|
End Sub
|
||||||
@@ -10088,6 +10130,12 @@ Partial Class Ventas
|
|||||||
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If tPS.Length >= 1000 Then
|
||||||
|
Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999)
|
||||||
|
tPS = tPSRecortado
|
||||||
|
End If
|
||||||
|
|
||||||
'condicionante, especial
|
'condicionante, especial
|
||||||
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
||||||
|
|
||||||
@@ -10690,8 +10738,14 @@ Partial Class Ventas
|
|||||||
factura.Timbre.Comprobante.Serie = ObjVentas.Serie
|
factura.Timbre.Comprobante.Serie = ObjVentas.Serie
|
||||||
factura.Timbre.Comprobante.Folio = ObjVentas.Folio.ToString()
|
factura.Timbre.Comprobante.Folio = ObjVentas.Folio.ToString()
|
||||||
|
|
||||||
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, factura) Then
|
If ObjFactura.TipoDocto = "Ing" Then
|
||||||
ErrorList.Add("Error al guardar usados")
|
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
|
||||||
|
ErrorList.Add("Error al guardar usados")
|
||||||
|
End If
|
||||||
|
ElseIf ObjFactura.TipoDocto = "Dev" Then
|
||||||
|
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then
|
||||||
|
ErrorList.Add("Error al guardar usados")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
|
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
|
||||||
@@ -12109,7 +12163,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
importeMovimiento = 0
|
importeMovimiento = 0
|
||||||
Case 103 'Descuento
|
Case 103 'Descuento
|
||||||
If ObjFactura.Descuento <> 0 AndAlso Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "-1" Then
|
If ObjFactura.Descuento <> 0 AndAlso Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso (DdlTipoAmortizacionAnticipo.SelectedValue = "-1" OrElse UsuarioActual.CveEmpresa = 141) Then
|
||||||
|
|
||||||
importeMovimiento = ObjFactura.Descuento * Multiplicador * ValorMultiplicador
|
importeMovimiento = ObjFactura.Descuento * Multiplicador * ValorMultiplicador
|
||||||
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador * ValorMultiplicador
|
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador * ValorMultiplicador
|
||||||
@@ -14319,6 +14373,7 @@ Partial Class Ventas
|
|||||||
'cuando es amortización por NOTA DE CREDITO
|
'cuando es amortización por NOTA DE CREDITO
|
||||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
||||||
LblAntAplicados.Text = String.Format("Amortización por Nota de Crédito: {0:C}", Amortizacion) : LblAntAplicados.Visible = True
|
LblAntAplicados.Text = String.Format("Amortización por Nota de Crédito: {0:C}", Amortizacion) : LblAntAplicados.Visible = True
|
||||||
|
HdnAnticipos.Value = Amortizacion.RoundSQL(2).ToString()
|
||||||
Amortizacion = 0
|
Amortizacion = 0
|
||||||
HdnTipoDescuento.Value = "-1"
|
HdnTipoDescuento.Value = "-1"
|
||||||
HdnDescuento.Value = "0"
|
HdnDescuento.Value = "0"
|
||||||
@@ -15015,6 +15070,8 @@ Partial Class Ventas
|
|||||||
If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
|
If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
|
||||||
TmpDT = ObjVentas.DtResultados
|
TmpDT = ObjVentas.DtResultados
|
||||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||||
End If
|
End If
|
||||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||||
Else
|
Else
|
||||||
@@ -16221,6 +16278,14 @@ Partial Class Ventas
|
|||||||
Descuento += ((Cantidad * PU) - TotalFinal)
|
Descuento += ((Cantidad * PU) - TotalFinal)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'SI TIENE PRONTO PAGO CALCULA EL IMPORTE
|
||||||
|
If RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then
|
||||||
|
Dim TotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento
|
||||||
|
Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D
|
||||||
|
|
||||||
|
ObjDescuento.ImporteProntoPago = (TotalProntoPago * PorcentajeProntoPago).RoundSQL(2)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -16254,6 +16319,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||||
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
|
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
|
||||||
|
|
||||||
Dim ObjDescuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
Dim ObjDescuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||||
If ObjDescuento.EsPUModificado Then
|
If ObjDescuento.EsPUModificado Then
|
||||||
PU = ObjDescuento.PU
|
PU = ObjDescuento.PU
|
||||||
@@ -16262,7 +16328,8 @@ Partial Class Ventas
|
|||||||
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
|
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
|
||||||
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
||||||
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
||||||
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle)
|
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
|
||||||
|
ImporteProntoPago:=ObjDescuento.ImporteProntoPago)
|
||||||
|
|
||||||
CalculaUsados()
|
CalculaUsados()
|
||||||
|
|
||||||
@@ -16396,7 +16463,8 @@ Partial Class Ventas
|
|||||||
PU As Decimal, Descuento As Decimal, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, Optional Serie As String = "", Optional TiempoEntrega As String = "",
|
PU As Decimal, Descuento As Decimal, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, Optional Serie As String = "", Optional TiempoEntrega As String = "",
|
||||||
Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
|
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
|
||||||
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False) As Boolean
|
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
|
||||||
|
Optional ImporteProntoPago As Decimal = 0) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
Try
|
Try
|
||||||
@@ -16405,10 +16473,10 @@ Partial Class Ventas
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If (Obs.Length + PS.Length > 1000) AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then
|
'If (Obs.Length + PS.Length > 1000) AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then
|
||||||
Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
|
' Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
|
||||||
Return False
|
' Return False
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'VALIDA CONCEPTOS EN CERO - YA SE VALIDA ANTES CON FUNCIONALIDAD - A MIRAS DE ELIMINAR - IPP 28 AGOSTO 2017
|
'VALIDA CONCEPTOS EN CERO - YA SE VALIDA ANTES CON FUNCIONALIDAD - A MIRAS DE ELIMINAR - IPP 28 AGOSTO 2017
|
||||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "Ant") Then
|
If Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "Ant") Then
|
||||||
@@ -16425,7 +16493,7 @@ Partial Class Ventas
|
|||||||
Dim Row As DataRow = Nothing
|
Dim Row As DataRow = Nothing
|
||||||
Dim TotalCalculableImpuestos As Decimal = 0
|
Dim TotalCalculableImpuestos As Decimal = 0
|
||||||
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
||||||
PU = PU.RoundAD(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||||
|
|
||||||
If Not TmpDT.Columns.Contains("RetIVA") Then
|
If Not TmpDT.Columns.Contains("RetIVA") Then
|
||||||
TmpDT.Columns.Add("RetIVA", GetType(Decimal))
|
TmpDT.Columns.Add("RetIVA", GetType(Decimal))
|
||||||
@@ -16555,24 +16623,24 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
Row("IVA") = Row("PorcentajeIVA")
|
Row("IVA") = Row("PorcentajeIVA")
|
||||||
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
|
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
|
||||||
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||||
|
|
||||||
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||||
Row("PorcentajeRetIVA") = ClienteRetIVA
|
Row("PorcentajeRetIVA") = ClienteRetIVA
|
||||||
Row("PorcentajeRetISR") = ClienteRetISR
|
Row("PorcentajeRetISR") = ClienteRetISR
|
||||||
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
|
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
|
||||||
Row("ImporteIEPS") = (DrPS("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
Row("ImporteIEPS") = (DrPS("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||||
Row("IEPS") = Row("ImporteIEPS")
|
Row("IEPS") = Row("ImporteIEPS")
|
||||||
Row("Descuento") = (Descuento).RoundAD(NumeroDecimales)
|
Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
|
||||||
Row("TipoDescuento") = HdnTipoDescuento.Value
|
Row("TipoDescuento") = HdnTipoDescuento.Value
|
||||||
Row("CvePromocionDetalle") = CvePromocionDetalle
|
Row("CvePromocionDetalle") = CvePromocionDetalle
|
||||||
Row("Total") = (Cantidad * PU)
|
Row("Total") = (Cantidad * PU)
|
||||||
Row("TotalImporte") = (Cantidad * PU).RoundAD(NumeroDecimales)
|
Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
||||||
|
|
||||||
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
|
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
|
||||||
' Row("IdCtaContVentas") = IdCtaContable
|
' Row("IdCtaContVentas") = IdCtaContable
|
||||||
@@ -16598,6 +16666,14 @@ Partial Class Ventas
|
|||||||
Row("EsOutSourcing") = DrPS("EsOutSourcing")
|
Row("EsOutSourcing") = DrPS("EsOutSourcing")
|
||||||
Row("EsCargo") = EsCargo
|
Row("EsCargo") = EsCargo
|
||||||
|
|
||||||
|
If ImporteProntoPago > 0 Then
|
||||||
|
Row("ImporteProntoPago") = ImporteProntoPago
|
||||||
|
Row("TieneProntoPago") = "Si"
|
||||||
|
GvPS.Columns(22).Visible = True
|
||||||
|
thProntoPago.Visible = True
|
||||||
|
thProntoPago2.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 119 Then
|
If UsuarioActual.CveEmpresa = 119 Then
|
||||||
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
|
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
|
||||||
|
|
||||||
@@ -16817,9 +16893,15 @@ Partial Class Ventas
|
|||||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||||
|
|
||||||
|
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||||
|
|
||||||
TmpDT.Columns("EsOutSourcing").DefaultValue = False
|
TmpDT.Columns("EsOutSourcing").DefaultValue = False
|
||||||
TmpDT.Columns("EsCargo").DefaultValue = False
|
TmpDT.Columns("EsCargo").DefaultValue = False
|
||||||
|
|
||||||
|
TmpDT.Columns("TieneProntoPago").DefaultValue = "No"
|
||||||
|
TmpDT.Columns("ImporteProntoPago").DefaultValue = 0
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CreaDTmpC()
|
Private Sub CreaDTmpC()
|
||||||
DTmpC = New DataTable
|
DTmpC = New DataTable
|
||||||
@@ -17242,6 +17324,8 @@ Partial Class Ventas
|
|||||||
Dim Total As Decimal = 0
|
Dim Total As Decimal = 0
|
||||||
Dim TotalImpuestosLocales As Decimal = 0
|
Dim TotalImpuestosLocales As Decimal = 0
|
||||||
|
|
||||||
|
Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal
|
||||||
|
|
||||||
If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos
|
If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos
|
||||||
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then
|
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then
|
||||||
For Each dr As DataRow In TmpDT.Rows
|
For Each dr As DataRow In TmpDT.Rows
|
||||||
@@ -17309,6 +17393,9 @@ Partial Class Ventas
|
|||||||
TxtIEPS.Text = TotalIEPS.FormatoNumero
|
TxtIEPS.Text = TotalIEPS.FormatoNumero
|
||||||
TxtTotal.Text = Total.FormatoNumero
|
TxtTotal.Text = Total.FormatoNumero
|
||||||
|
|
||||||
|
HdnProntoPago.Value = TotalProntoPago.ToString()
|
||||||
|
LblProntoPago.Text = TotalProntoPago.FormatoNumero(2)
|
||||||
|
|
||||||
LblAmort.Text = TxtSubTotal.Text
|
LblAmort.Text = TxtSubTotal.Text
|
||||||
If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then
|
If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then
|
||||||
HdnVentaSaldo.Value = Total.ToString()
|
HdnVentaSaldo.Value = Total.ToString()
|
||||||
@@ -24827,7 +24914,14 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
|
|
||||||
Dim Obs = RowUsado("CodigoPS").ToString()
|
Dim CvePSCargo As Integer = RowUsado("CvePS").ToString().ToEntero()
|
||||||
|
Dim Obs = ""
|
||||||
|
'SI ES ACUMULADOR LAS OBSERVACIOENS DEBEN SER EL NOMBRE DEL ACUMULADOR
|
||||||
|
If GlobalDTAcumTamaños().FiltroPrimero($"CvePSCargo = {CvePSCargo}") IsNot Nothing Then
|
||||||
|
Obs = RowUsado("CodigoPS").ToString()
|
||||||
|
Else
|
||||||
|
Obs = RowUsado("Obs").ToString()
|
||||||
|
End If
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
|
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
|
||||||
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
|
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
|
||||||
@@ -24898,12 +24992,20 @@ Partial Class Ventas
|
|||||||
For Each RNC In ListaNC
|
For Each RNC In ListaNC
|
||||||
Dim UltimoRenglonRNC As Integer = 1
|
Dim UltimoRenglonRNC As Integer = 1
|
||||||
Dim TotalAcumuladoRNC As Decimal = 0
|
Dim TotalAcumuladoRNC As Decimal = 0
|
||||||
|
Dim Terminar As Boolean = False
|
||||||
|
|
||||||
For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows
|
For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows
|
||||||
|
|
||||||
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
|
|
||||||
Dim Obs = RowUsado("CodigoPS").ToString()
|
Dim CvePSCargo As Integer = RowUsado("CvePS").ToString().ToEntero()
|
||||||
|
Dim Obs = ""
|
||||||
|
'SI ES ACUMULADOR LAS OBSERVACIOENS DEBEN SER EL NOMBRE DEL ACUMULADOR
|
||||||
|
If GlobalDTAcumTamaños().FiltroPrimero($"CvePSCargo = {CvePSCargo}") IsNot Nothing Then
|
||||||
|
Obs = RowUsado("CodigoPS").ToString()
|
||||||
|
Else
|
||||||
|
Obs = RowUsado("Obs").ToString()
|
||||||
|
End If
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
|
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
|
||||||
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
|
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
|
||||||
@@ -24921,8 +25023,32 @@ Partial Class Ventas
|
|||||||
|
|
||||||
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA)
|
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA)
|
||||||
|
|
||||||
|
|
||||||
|
'SI EL IMPORTE ES MAYOR REALIZA EL AJUSTE
|
||||||
|
If TotalAcumuladoRNC > RNC.TotalRemNCAplicado Then
|
||||||
|
Terminar = True
|
||||||
|
'RESTA LO SUMANDO DEL ACUMULADO
|
||||||
|
TotalAcumuladoRNC -= (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
|
||||||
|
|
||||||
|
Dim Diferencia As Decimal = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
|
||||||
|
|
||||||
|
Dim TotalPartida As Decimal = (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
|
||||||
|
|
||||||
|
Dim PorcentajePorAplicar As Decimal = (Diferencia / TotalPartida)
|
||||||
|
|
||||||
|
Cantidad = Cantidad * PorcentajePorAplicar
|
||||||
|
|
||||||
|
TotalCalculableImpuestos = (Cantidad * ImportePU)
|
||||||
|
ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
|
||||||
|
|
||||||
|
|
||||||
|
ImporteTotal = TotalCalculableImpuestos
|
||||||
|
|
||||||
|
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
|
||||||
|
End If
|
||||||
|
|
||||||
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
|
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
|
||||||
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
|
If UltimoRenglonRNC = Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows.Count OrElse Terminar Then
|
||||||
Dim Ajuste As Decimal = 0
|
Dim Ajuste As Decimal = 0
|
||||||
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
|
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
|
||||||
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
|
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
|
||||||
@@ -24937,6 +25063,10 @@ Partial Class Ventas
|
|||||||
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
|
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
|
||||||
0, ImporteRetISR, 0, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
|
0, ImporteRetISR, 0, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
|
||||||
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero())
|
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero())
|
||||||
|
|
||||||
|
If Terminar Then
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Next
|
Next
|
||||||
@@ -25047,6 +25177,8 @@ Partial Class Ventas
|
|||||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If AplicaNCMasiva OrElse AplicaNCUsado Then
|
If AplicaNCMasiva OrElse AplicaNCUsado Then
|
||||||
@@ -26516,6 +26648,12 @@ Partial Class Ventas
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End Function
|
End Function
|
||||||
Private Function AgregaPSCotizacion() As Boolean
|
Private Function AgregaPSCotizacion() As Boolean
|
||||||
|
'Dim ObjFactCotizacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
'Dim TotalCotizacion As Decimal = ObjFactCotizacion.Total 'TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
|
||||||
|
|
||||||
|
'ObjFactCotizacion.Dispose()
|
||||||
|
|
||||||
If DtCotizacionesPS IsNot Nothing Then
|
If DtCotizacionesPS IsNot Nothing Then
|
||||||
Dim tCantidad As Decimal = 0
|
Dim tCantidad As Decimal = 0
|
||||||
For Each Dr As DataRow In DtCotizacionesPS.Select()
|
For Each Dr As DataRow In DtCotizacionesPS.Select()
|
||||||
@@ -26525,6 +26663,15 @@ Partial Class Ventas
|
|||||||
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),
|
||||||
CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True)
|
CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero(), CveVentaDetalleCotizacion:=Dr("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True)
|
||||||
Next
|
Next
|
||||||
|
'Dim TotalFactura = TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
|
||||||
|
|
||||||
|
'Dim Diferencia As Decimal = TotalCotizacion - TotalFactura
|
||||||
|
|
||||||
|
'If Diferencia <> 0 Then
|
||||||
|
' Dim LastRow As DataRow = TmpDT.Rows(TmpDT.Rows.Count - 1)
|
||||||
|
' LastRow("ImporteIVA") = LastRow("ImporteIVA").ToString().ToDecimal() - Diferencia
|
||||||
|
'End If
|
||||||
|
|
||||||
CalculaTotalesVenta()
|
CalculaTotalesVenta()
|
||||||
Return True
|
Return True
|
||||||
Else
|
Else
|
||||||
@@ -26537,6 +26684,9 @@ Partial Class Ventas
|
|||||||
#Region " COTIZACIONES - FACTURAR "
|
#Region " COTIZACIONES - FACTURAR "
|
||||||
Private Function PreparaFacturarCotizacion() As Boolean
|
Private Function PreparaFacturarCotizacion() As Boolean
|
||||||
'LIMPIAMOS
|
'LIMPIAMOS
|
||||||
|
|
||||||
|
'Dim TotalCotizacion As Decimal = TxtTotal.Text.Replace(",", "").ToDecimal()
|
||||||
|
|
||||||
TmpDT.Rows.Clear()
|
TmpDT.Rows.Clear()
|
||||||
TxtSubTotal.Text = "0.00"
|
TxtSubTotal.Text = "0.00"
|
||||||
TxtSubTotal2.Text = "0.00"
|
TxtSubTotal2.Text = "0.00"
|
||||||
@@ -26565,6 +26715,18 @@ Partial Class Ventas
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'Dim TotalFactura As Decimal = TmpDT.SUM("TotalImporte").ToDecimal() + TmpDT.SUM("ImporteIVA").ToDecimal() + TmpDT.SUM("ImporteIEPS").ToDecimal() - TmpDT.SUM("ImporteRetIVA").ToDecimal() - TmpDT.SUM("ImporteRetISR").ToDecimal()
|
||||||
|
|
||||||
|
'Dim Diferencia As Decimal = TotalCotizacion - TotalFactura
|
||||||
|
|
||||||
|
'If Diferencia <> 0 Then
|
||||||
|
' Dim LastRow As DataRow = TmpDT.Rows(TmpDT.Rows.Count - 1)
|
||||||
|
|
||||||
|
' LastRow("ImporteIVA") = LastRow("ImporteIVA").ToString().ToDecimal() + Diferencia
|
||||||
|
|
||||||
|
' CalculaTotalesVenta()
|
||||||
|
'End If
|
||||||
|
|
||||||
If TmpDT.Rows.Count = 0 Then
|
If TmpDT.Rows.Count = 0 Then
|
||||||
Alert("No hay conceptos por facturar de esta cotización o ha sido cambiada su información. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
Alert("No hay conceptos por facturar de esta cotización o ha sido cambiada su información. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||||
Return False
|
Return False
|
||||||
@@ -27956,17 +28118,17 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, factura As Modelos.Factura) As Boolean
|
Private Function GuardarUsados(CveConcepto As Integer, SqlTransaccion As SqlClient.SqlTransaction, factura As Modelos.Factura) As Boolean
|
||||||
Dim Resultado As Boolean = True
|
Dim Resultado As Boolean = True
|
||||||
|
|
||||||
If ClienteEsDistribuidor AndAlso factura.TipoDocto.Contiene("Ing") Then
|
If ClienteEsDistribuidor Then
|
||||||
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
|
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
|
||||||
|
|
||||||
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
|
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
|
||||||
|
|
||||||
For Each drow As DataRow In factura.DtDetalle.Rows
|
For Each drow As DataRow In factura.DtDetalle.Rows
|
||||||
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
|
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
|
||||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
|
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
|
||||||
UsuarioActual.CveEmpresa, 0D, "") Then
|
UsuarioActual.CveEmpresa, 0D, "") Then
|
||||||
Resultado = False
|
Resultado = False
|
||||||
Exit For
|
Exit For
|
||||||
@@ -28053,7 +28215,7 @@ Partial Class Ventas
|
|||||||
End Select
|
End Select
|
||||||
|
|
||||||
If ChkMostarProductosRNC.Checked Then
|
If ChkMostarProductosRNC.Checked Then
|
||||||
|
Dim TotalAcumulado As Decimal = 0
|
||||||
Me.AplicaRNCXDetalle = True
|
Me.AplicaRNCXDetalle = True
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
|
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
|
||||||
@@ -28061,12 +28223,13 @@ Partial Class Ventas
|
|||||||
If GvRow.FCCheckBox("ChkAplicar").Checked Then
|
If GvRow.FCCheckBox("ChkAplicar").Checked Then
|
||||||
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
|
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
|
||||||
For Each row In Rows
|
For Each row In Rows
|
||||||
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToEntero()
|
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
|
||||||
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
|
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
Dim TerminarCiclo As Boolean = False
|
||||||
|
|
||||||
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
|
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
|
||||||
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
|
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
|
||||||
@@ -28092,6 +28255,14 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
TotalAcumulado += TotalRNC
|
||||||
|
|
||||||
|
'SI SE EXECE RESTA AL ULTIMO
|
||||||
|
If TotalAcumulado > LtlSMU.Text.ToDecimal() Then
|
||||||
|
TerminarCiclo = True
|
||||||
|
TotalAcumulado -= TotalRNC
|
||||||
|
TotalRNC = LtlSMU.Text.ToDecimal() - TotalAcumulado
|
||||||
|
End If
|
||||||
|
|
||||||
RemNC.TotalRemNCAplicado = TotalRNC
|
RemNC.TotalRemNCAplicado = TotalRNC
|
||||||
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
|
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
|
||||||
@@ -28105,6 +28276,10 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ListaRemisionesNC.Add(RemNC)
|
ListaRemisionesNC.Add(RemNC)
|
||||||
|
|
||||||
|
If TerminarCiclo Then
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -28732,6 +28907,7 @@ Partial Class Ventas
|
|||||||
Public CvePromocionDetalle As Integer = -1
|
Public CvePromocionDetalle As Integer = -1
|
||||||
Public PU As Decimal = 0
|
Public PU As Decimal = 0
|
||||||
Public EsPUModificado As Boolean = False
|
Public EsPUModificado As Boolean = False
|
||||||
|
Public ImporteProntoPago As Decimal = 0
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||||
@@ -28993,4 +29169,468 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Region " N O T A - D E - C R E D I T O - P R O N T O - P A G O"
|
||||||
|
|
||||||
|
Private Function GenerarNCProntoPago(SqlTransaccion As SqlClient.SqlTransaction, ByRef ObjCliente As ClsClientes, ByRef ObjConta As ClsContPAQi, ObjFactura As Modelos.Factura) As MensajeProntoPago
|
||||||
|
Dim Retorno As New MensajeProntoPago
|
||||||
|
|
||||||
|
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||||
|
Dim ObjFacturaProntoPago As Modelos.Factura = Nothing
|
||||||
|
|
||||||
|
Try
|
||||||
|
ObjFacturaProntoPago = New Modelos.Factura(UsuarioActual)
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.TextoLimpio
|
||||||
|
ObjFacturaProntoPago.CveUsuario = UsuarioActual.CveUsuario
|
||||||
|
ObjFacturaProntoPago.UsuarioCreo = UsuarioActual.Usuario
|
||||||
|
|
||||||
|
Dim CveSubProyecto As Integer = ObjFactura.CveSubProyecto
|
||||||
|
Dim CveMoneda As Integer = ObjFactura.CveMoneda
|
||||||
|
Dim CveCliente As Integer = ObjFactura.CveCliente
|
||||||
|
|
||||||
|
Dim Folio As Integer = -1
|
||||||
|
Dim Serie As String = "-1"
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveEmpresa = UsuarioActual.CveEmpresa
|
||||||
|
ObjFacturaProntoPago.TipoCambio = If(CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
|
||||||
|
ObjFacturaProntoPago.ConvertirPesos = False
|
||||||
|
ObjFacturaProntoPago.CveMoneda = CveMoneda
|
||||||
|
ObjFacturaProntoPago.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
|
||||||
|
ObjFacturaProntoPago.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
|
||||||
|
ObjFacturaProntoPago.Serie = Serie
|
||||||
|
ObjFacturaProntoPago.Folio = Folio
|
||||||
|
ObjFacturaProntoPago.Fecha = Now
|
||||||
|
ObjFacturaProntoPago.CvePrePoliza = -1
|
||||||
|
ObjFacturaProntoPago.CveMetodoPago = 0
|
||||||
|
ObjFacturaProntoPago.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
|
||||||
|
ObjFacturaProntoPago.FormaPago = 0
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.TipoDocto = "Egs"
|
||||||
|
ObjFacturaProntoPago.Fecha = Now
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.Version = "3.3"
|
||||||
|
ObjFacturaProntoPago.CveMetodoPago33 = 1
|
||||||
|
ObjFacturaProntoPago.MetodoPago33 = "Pago en una sola exhibición"
|
||||||
|
ObjFacturaProntoPago.ClaveMetodoPagoSAT = "PUE"
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveFormaPago33 = 21
|
||||||
|
ObjFacturaProntoPago.FormaPago33 = "Aplicación de anticipos"
|
||||||
|
ObjFacturaProntoPago.FormaPagoSAT33 = "30"
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.MetodoPago = ""
|
||||||
|
ObjFacturaProntoPago.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {ObjFacturaProntoPago.CveMetodoPago33}")
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveSubProyecto = CveSubProyecto
|
||||||
|
ObjFacturaProntoPago.SetSubProyecto()
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveCliente = CveCliente
|
||||||
|
ObjFacturaProntoPago.SetCliente()
|
||||||
|
|
||||||
|
|
||||||
|
If ObjCliente.GetClientes(ObjFacturaProntoPago.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
|
||||||
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveUsoCFDI = ObjCliente.CveUsoCFDI
|
||||||
|
ObjFacturaProntoPago.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||||
|
ObjFacturaProntoPago.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.DtDetalle = CreaDTDetalleNCProntoPago()
|
||||||
|
|
||||||
|
CargaImpuestosProntoPago(ObjFacturaProntoPago, ObjFactura, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA.ToDecimal, ObjCliente.RetISR.ToDecimal)
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjCliente.GetSucursales(CveCliente) Then
|
||||||
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
|
ObjFacturaProntoPago.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
|
||||||
|
Else
|
||||||
|
ObjFacturaProntoPago.CveClienteSucursal = -1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveTipoRelacion = 7
|
||||||
|
ObjFacturaProntoPago.TipoRelacion = "07"
|
||||||
|
|
||||||
|
Dim Fol As New List(Of String)
|
||||||
|
Fol.Add(ObjFactura.FolioFiscal)
|
||||||
|
ObjFacturaProntoPago.UUIDRelacionados = Fol
|
||||||
|
|
||||||
|
Select Case ObjFacturaProntoPago.TipoDocto
|
||||||
|
Case "Ing"
|
||||||
|
ObjFacturaProntoPago.TipoDocumento = "Factura"
|
||||||
|
Case "REM"
|
||||||
|
ObjFacturaProntoPago.TipoDocumento = "Remision"
|
||||||
|
Case "Cot"
|
||||||
|
ObjFacturaProntoPago.TipoDocumento = "Cotizacion"
|
||||||
|
Case "Egs"
|
||||||
|
ObjFacturaProntoPago.TipoDocumento = "Nota de Crédito"
|
||||||
|
Case "Dev"
|
||||||
|
ObjFacturaProntoPago.TipoDocumento = "Nota de Devolución"
|
||||||
|
Case Else
|
||||||
|
ObjFacturaProntoPago.TipoDocumento = ""
|
||||||
|
End Select
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.FechaPago = Now
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.CveCorte = -1
|
||||||
|
ObjFacturaProntoPago.CveMesa = -1
|
||||||
|
ObjFacturaProntoPago.NumeroPersonas = 0
|
||||||
|
ObjFacturaProntoPago.CveContrato = -1
|
||||||
|
ObjFacturaProntoPago.DescripcionContrato = ""
|
||||||
|
ObjFacturaProntoPago.CveClienteSucursal = -1
|
||||||
|
ObjFacturaProntoPago.Entrega = ""
|
||||||
|
ObjFacturaProntoPago.CveAlmacen = -1
|
||||||
|
|
||||||
|
Dim DtVentasNC = InicializaDTVentasNCProntoPago()
|
||||||
|
|
||||||
|
Dim TotalImporte As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("TotalImporte")
|
||||||
|
Dim ImporteIVA As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("ImporteIVA")
|
||||||
|
Dim ImporteRetIVA As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("ImporteRetIVA")
|
||||||
|
Dim ImporteRetISR As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("ImporteRetISR")
|
||||||
|
Dim ImporteIEPS As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("ImporteIEPS")
|
||||||
|
Dim Descuento As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("Descuento")
|
||||||
|
Dim Amortizacion As Decimal = 0
|
||||||
|
|
||||||
|
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
|
||||||
|
|
||||||
|
'DETALLES
|
||||||
|
ObjFacturaProntoPago.SubTotal = TotalImporte
|
||||||
|
ObjFacturaProntoPago.Descuento = Descuento
|
||||||
|
ObjFacturaProntoPago.Amortizacion = Amortizacion
|
||||||
|
ObjFacturaProntoPago.IVA = ImporteIVA
|
||||||
|
ObjFacturaProntoPago.RetIVA = ImporteRetIVA
|
||||||
|
ObjFacturaProntoPago.RetISR = ImporteRetISR
|
||||||
|
ObjFacturaProntoPago.IEPS = ImporteIEPS
|
||||||
|
ObjFacturaProntoPago.Total = Total
|
||||||
|
ObjFacturaProntoPago.TotalOtrosConceptos = 0
|
||||||
|
|
||||||
|
Dim Drt = DtVentasNC.NewRow
|
||||||
|
Drt("CveVenta") = ObjFactura.CveVenta
|
||||||
|
Drt("Importe") = ObjFactura.DescuentoProntoPago
|
||||||
|
Drt("FolioFiscal") = ObjFactura.FolioFiscal
|
||||||
|
|
||||||
|
DtVentasNC.Rows.Add(Drt)
|
||||||
|
DtVentasNC.AcceptChanges()
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.DtVentasNC = DtVentasNC
|
||||||
|
|
||||||
|
Resp = ObjFacturaProntoPago.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
|
||||||
|
|
||||||
|
ObjFacturaProntoPago.Dispose()
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Resp.CveVenta = -1
|
||||||
|
Resp.TieneError = True
|
||||||
|
OnError("Ocurrio un error al generar la nota de credito de pronto pago", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Retorno.ObjFacturaProntoPago = ObjFacturaProntoPago
|
||||||
|
Retorno.Mensaje = Resp
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub AgregaTempDTNCProntoPago(ByRef TmpDT As DataTable, CvePS As Integer, PS As String, Codigo As String, CodigoPS As String, CveTipoPS As Integer, CveTipoInvPS As Integer, CveUM As Integer, UM As String,
|
||||||
|
CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, CveSubProyecto As Integer,
|
||||||
|
Obs As String, Cantidad As Double, PU As Double, PorcentajeIVA As Double, ImporteIVA As Double, PorcentajeRetIVA As Double, ImporteRetIVA As Double,
|
||||||
|
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double,
|
||||||
|
Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
|
||||||
|
SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
|
||||||
|
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer)
|
||||||
|
|
||||||
|
Dim Row As DataRow = Nothing
|
||||||
|
Row = TmpDT.NewRow()
|
||||||
|
|
||||||
|
Row("Consec") = TmpDT.Rows.Count + 1
|
||||||
|
Row("Orden") = TmpDT.Rows.Count + 1
|
||||||
|
|
||||||
|
Row("CvePS") = CvePS
|
||||||
|
Row("PS") = PS
|
||||||
|
Row("Codigo") = Codigo
|
||||||
|
Row("CodigoPS") = CodigoPS
|
||||||
|
Row("CveTipoPS") = CveTipoPS
|
||||||
|
Row("CveTipoInvPS") = CveTipoInvPS
|
||||||
|
|
||||||
|
Row("CveUM") = CveUM
|
||||||
|
Row("UM") = UM
|
||||||
|
|
||||||
|
Row("CveClasificacion") = CveClasificacion
|
||||||
|
Row("Clasificacion") = Clasificacion
|
||||||
|
Row("CveProyecto") = CveProyecto
|
||||||
|
Row("Proyecto") = ""
|
||||||
|
Row("CveSubProyecto") = CveSubProyecto
|
||||||
|
Row("SubProyecto") = ""
|
||||||
|
|
||||||
|
Row("Obs") = Obs
|
||||||
|
Row("Cantidad") = Cantidad
|
||||||
|
Row("PU") = Math.Round(PU, 6)
|
||||||
|
Row("PorcentajeIVA") = PorcentajeIVA
|
||||||
|
Row("IVA") = PorcentajeIVA
|
||||||
|
Row("ImporteIVA") = Math.Round(ImporteIVA, 2)
|
||||||
|
Row("PorcentajeRetIVA") = PorcentajeRetIVA
|
||||||
|
Row("ImporteRetIVA") = Math.Round(ImporteRetIVA, 2)
|
||||||
|
Row("PorcentajeRetISR") = PorcentajeRetISR
|
||||||
|
Row("ImporteRetISR") = Math.Round(ImporteRetISR, 2)
|
||||||
|
Row("PorcentajeIEPS") = PorcentajeIEPS
|
||||||
|
Row("ImporteIEPS") = Math.Round(ImporteIEPS, 2)
|
||||||
|
Row("IEPS") = Math.Round(ImporteIEPS, 2)
|
||||||
|
Row("TipoDescuento") = TipoDescuento
|
||||||
|
Row("Descuento") = Math.Round(Descuento, 2)
|
||||||
|
Row("Total") = Math.Round(Total, 2)
|
||||||
|
Row("TotalImporte") = Math.Round(Total, 2)
|
||||||
|
|
||||||
|
Row("Serie") = Serie
|
||||||
|
Row("TiempoEntrega") = TiempoEntrega
|
||||||
|
Row("CvePresupuestoIngreso") = CvePresupuestoIngreso
|
||||||
|
Row("EntregaDirecta") = EntregaDirecta
|
||||||
|
Row("SATClaveProdServ") = SATClaveProdServ
|
||||||
|
Row("SATClaveUM") = SATClaveUM
|
||||||
|
|
||||||
|
'Contratos
|
||||||
|
Row("CveContratoDetalle") = CveContratoDetalle
|
||||||
|
Row("CveVentaDetalle") = CveVentaDetalle
|
||||||
|
Row("CveMovimientoDetallePedido") = CveMovimientoDetallePedido
|
||||||
|
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
|
||||||
|
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
|
||||||
|
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
|
||||||
|
|
||||||
|
TmpDT.Rows.Add(Row)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaImpuestosProntoPago(ByRef ObjFacturaDevolucion As Modelos.Factura, ObjFactura As Modelos.Factura, ClienteDesglosaIEPS As Boolean, ClienteRetIVA As Decimal, ClienteRetISR As Decimal)
|
||||||
|
Dim DtImpuestos As New DataTable
|
||||||
|
DtImpuestos.Columns.Add("ImportePU", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("ImporteTotal", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("PorcentajeRetISR", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("PorcentajeIEPS", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||||
|
DtImpuestos.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
|
DtImpuestos.AcceptChanges()
|
||||||
|
Dim AcumuladoNC As Decimal = 0
|
||||||
|
|
||||||
|
DtImpuestos.Merge(CargaDtImpuestosNC(ObjFactura.CveVenta, ObjFactura.DescuentoProntoPago), True, MissingSchemaAction.Ignore)
|
||||||
|
|
||||||
|
DtImpuestos = CargaTotalesImpuestosProntoPago(DtImpuestos)
|
||||||
|
|
||||||
|
Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, ObjFacturaDevolucion.CveSubProyecto).Rows(0)
|
||||||
|
|
||||||
|
Dim Cantidad As Decimal = 1
|
||||||
|
Dim CveProyecto As Integer = DrSubProyecto("CveProyecto").ToString().ToEntero()
|
||||||
|
Dim CveSubProyecto = DrSubProyecto("CveSubProyecto").ToString.ToEntero
|
||||||
|
Dim SubProyecto = DrSubProyecto("SubProyecto").ToString
|
||||||
|
Dim Proyecto = DrSubProyecto("Proyecto").ToString
|
||||||
|
|
||||||
|
Dim CveSATNC As Integer
|
||||||
|
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
|
||||||
|
Dim NCBonificacion As Integer = 0
|
||||||
|
If ArrayNC.Length > 6 Then 'CONCEPTO DE PRONTO PAGO
|
||||||
|
CveSATNC = ArrayNC(6).ToEntero()
|
||||||
|
End If
|
||||||
|
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("")
|
||||||
|
|
||||||
|
For Each Dr As DataRow In DtImpuestos.Rows
|
||||||
|
AgregaTempDTNCProntoPago(ObjFacturaDevolucion.DtDetalle, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
|
||||||
|
DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, CveSubProyecto,
|
||||||
|
"", Cantidad, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal,
|
||||||
|
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1,
|
||||||
|
DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1)
|
||||||
|
Next
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function CargaDtImpuestosNCProntoPago(CveVentaNC As Integer, Importe As Decimal) As DataTable
|
||||||
|
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
|
||||||
|
|
||||||
|
Dim TmpDT As DataTable = Nothing
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
|
||||||
|
If ObjVentas.GetVentaDetalle(CveVentaNC) Then
|
||||||
|
TmpDT = ObjVentas.DtResultados
|
||||||
|
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjVentas.GetVenta(CveVentaNC, UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
|
Total = ObjVentas.DtResultados()(0)("Total").ToString.ToDecimal
|
||||||
|
SubTotal = ObjVentas.DtResultados()(0)("SubTotal").ToString.ToDecimal
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
Dim DtImpuestosLocal = TmpDT.FiltraParametros("", "", {"PorcentajeIVA", "PorcentajeRetIVA", "PorcentajeRetISR", "PorcentajeIEPS", "CveSubProyecto"}).Copy
|
||||||
|
DtImpuestosLocal.Columns.Add("ImportePU", GetType(Decimal))
|
||||||
|
DtImpuestosLocal.Columns.Add("ImporteTotal", GetType(Decimal))
|
||||||
|
DtImpuestosLocal.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||||
|
DtImpuestosLocal.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||||
|
DtImpuestosLocal.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||||
|
DtImpuestosLocal.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||||
|
|
||||||
|
Dim ImporteReferencia As Decimal = Total
|
||||||
|
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
|
||||||
|
Dim FiltroStr As String = ""
|
||||||
|
Dim ImporteTotalConcepto As Decimal = 0
|
||||||
|
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"))
|
||||||
|
ImporteTotalConcepto = Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))
|
||||||
|
|
||||||
|
Dr("ImportePU") = ImporteTotalConcepto.RoundSQL(6)
|
||||||
|
Dr("ImporteTotal") = ImporteTotalConcepto.RoundSQL(2)
|
||||||
|
|
||||||
|
Dr("ImporteIVA") = (ImporteTotalConcepto * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
|
||||||
|
Dr("ImporteRetIVA") = (ImporteTotalConcepto * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2)
|
||||||
|
Dr("ImporteRetISR") = (ImporteTotalConcepto * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
|
||||||
|
Dr("ImporteIEPS") = (ImporteTotalConcepto * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2)
|
||||||
|
|
||||||
|
'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", FiltroStr), 2)
|
||||||
|
'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2)
|
||||||
|
'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", FiltroStr), 2)
|
||||||
|
'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2)
|
||||||
|
|
||||||
|
'(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal)
|
||||||
|
Next
|
||||||
|
'codigo para ajuste de centavo, si el importe total no cuadra con los totales
|
||||||
|
Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
|
||||||
|
If Math.Abs(difTmp) >= 0.01 Then
|
||||||
|
'asusto la diferencia en el último concepto
|
||||||
|
Dim ImporteAjustado As Decimal = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString.ToDecimal + difTmp
|
||||||
|
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = ImporteAjustado
|
||||||
|
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImportePU") = ImporteAjustado
|
||||||
|
End If
|
||||||
|
'CARGA FACTURA A LA CUAL SE APLICA LA NC
|
||||||
|
'CargaNCDT(CveVentaNC, Importe.ToDecimal)
|
||||||
|
Return DtImpuestosLocal
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function CargaTotalesImpuestosProntoPago(DtImpuestos As DataTable) As DataTable
|
||||||
|
Dim query = From dr In DtImpuestos
|
||||||
|
Group By PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal,
|
||||||
|
PorcentajeRetIVA = dr("PorcentajeRetIVA").ToString.ToDecimal,
|
||||||
|
PorcentajeRetISR = dr("PorcentajeRetISR").ToString.ToDecimal,
|
||||||
|
PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal
|
||||||
|
Into x = Group
|
||||||
|
Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal),
|
||||||
|
ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal),
|
||||||
|
ImporteIVA = x.Sum(Function(s) Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)), ' Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA,
|
||||||
|
ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImporteRetIVA").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA,
|
||||||
|
ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImporteRetISR").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR,
|
||||||
|
ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImporteIEPS").ToString.ToDecimal, 2)), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS,
|
||||||
|
PorcentajeIVA = PorcentajeIVA,
|
||||||
|
PorcentajeRetIVA = PorcentajeRetIVA,
|
||||||
|
PorcentajeRetISR = PorcentajeRetISR,
|
||||||
|
PorcentajeIEPS = PorcentajeIEPS
|
||||||
|
|
||||||
|
Return query.QueryToDataTable(False)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Protected Function CreaDTDetalleNCProntoPago() As DataTable
|
||||||
|
Dim TmpDT = New DataTable
|
||||||
|
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("UM", GetType(String))
|
||||||
|
TmpDT.Columns.Add("SATClaveUM", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("PS", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||||
|
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
|
||||||
|
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Serie", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||||
|
TmpDT.Columns.Add("Obs", GetType(String))
|
||||||
|
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||||
|
TmpDT.Columns.Add("PU", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("IVA", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("IEPS", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("Descuento", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||||
|
'Para uso del módulo contable
|
||||||
|
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||||
|
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
||||||
|
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
||||||
|
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
|
||||||
|
'Contratos
|
||||||
|
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||||
|
'Remisiones a Facturas
|
||||||
|
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
|
||||||
|
'Pedido2 a Facturas
|
||||||
|
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Origen", GetType(Integer))
|
||||||
|
'Ordenes Servicio
|
||||||
|
TmpDT.Columns.Add("CveOS", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Folio", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("Estatus", GetType(String))
|
||||||
|
'Ordenamiento
|
||||||
|
TmpDT.Columns.Add("Orden", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("TipoDocto", GetType(String))
|
||||||
|
'OC
|
||||||
|
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
|
||||||
|
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
|
||||||
|
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||||
|
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||||
|
|
||||||
|
Return TmpDT
|
||||||
|
End Function
|
||||||
|
Private Function InicializaDTVentasNCProntoPago() As DataTable
|
||||||
|
Dim DtVentasNC = New DataTable
|
||||||
|
DtVentasNC.Columns.Add("CveVenta", GetType(Integer))
|
||||||
|
DtVentasNC.Columns.Add("Importe", GetType(Decimal))
|
||||||
|
DtVentasNC.Columns.Add("FolioFiscal", GetType(String))
|
||||||
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TC", .DataType = GetType(Decimal), .DefaultValue = 1})
|
||||||
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TCCambioValuacion", .DataType = GetType(Decimal), .DefaultValue = 1})
|
||||||
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
|
||||||
|
|
||||||
|
Return DtVentasNC
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Class MensajeProntoPago
|
||||||
|
Public Property ObjFacturaProntoPago As Modelos.Factura
|
||||||
|
Public Property Mensaje As Modelos.Factura.MMensajeFactura
|
||||||
|
End Class
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -150,6 +150,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user