This commit is contained in:
rakcsle
2022-06-06 21:07:31 -07:00
9 changed files with 735 additions and 824 deletions

View File

@@ -466,6 +466,8 @@ Public Class CFDIComplementoPagos
tRetorno.TotalTrasladosImpuestoIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.Importe).Sum()
tRetorno.TotalTrasladosImpuestoIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.Importe).Sum()
tRetorno.TotalRetencionesIEPS = (From c In Retenciones Where c.Impuesto = "003" Select c.Importe).Sum()
Return tRetorno
End Get
End Property

File diff suppressed because it is too large Load Diff

View File

@@ -4113,40 +4113,44 @@ Public Class Timbrado
Totales.TotalTrasladosBaseIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16.RoundSQL
Totales.TotalTrasladosBaseIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0
Totales.TotalTrasladosImpuestoIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16.RoundSQL
Totales.TotalTrasladosImpuestoIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0
Totales.TotalTrasladosImpuestoIVA16Specified = Totales.TotalTrasladosImpuestoIVA16 > 0
Totales.TotalTrasladosBaseIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8.RoundSQL
Totales.TotalTrasladosBaseIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0
Totales.TotalTrasladosImpuestoIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8.RoundSQL
Totales.TotalTrasladosImpuestoIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0
Totales.TotalTrasladosImpuestoIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA8.RoundSQL
Totales.TotalTrasladosImpuestoIVA8Specified = Totales.TotalTrasladosImpuestoIVA8 > 0
Totales.TotalTrasladosBaseIVA0 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0.RoundSQL
Totales.TotalTrasladosBaseIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
Totales.TotalTrasladosImpuestoIVA0 = 0
Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0 ' si hay base > 0, debe de ponerse aunque sea en cero
If ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS > 0 Then
Totales.TotalRetencionesIEPS = ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS.RoundSQL
Totales.TotalRetencionesIEPSSpecified = True
Else
Totales.TotalRetencionesIEPSSpecified = False
End If
Totales.TotalRetencionesIEPSSpecified = False
ComPag.Totales = Totales
ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {}
Dim i As Integer
For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados
ComPag.Pago(0).DoctoRelacionado(i) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado()
ComPag.Pago(0).DoctoRelacionado(i).IdDocumento = doc.IdDocumento
If Not String.IsNullOrEmpty(doc.Serie) Then
ComPag.Pago(0).DoctoRelacionado(i).Serie = doc.Serie
End If
ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio
ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDRSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {}
Dim i As Integer
For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados
ComPag.Pago(0).DoctoRelacionado(i) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado()
ComPag.Pago(0).DoctoRelacionado(i).IdDocumento = doc.IdDocumento
If Not String.IsNullOrEmpty(doc.Serie) Then
ComPag.Pago(0).DoctoRelacionado(i).Serie = doc.Serie
End If
ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio
ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR.RoundSQL(6)
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDRSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
If doc.Impuestos IsNot Nothing Then
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDR
@@ -4154,8 +4158,9 @@ Public Class Timbrado
''retenciones
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
Dim j As Integer = 0
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {}
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {}
If docimp.TrasladooRetencion = "R" Then
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR
Tra.BaseDR = docimp.Base.RoundSQL(6)
@@ -4169,12 +4174,13 @@ Public Class Timbrado
Next
End If
''traslados
''traslados
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
Dim j As Integer = 0
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {}
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {}
If docimp.TrasladooRetencion = "T" Then
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR
Tra.BaseDR = docimp.Base.RoundSQL(6)
@@ -4191,83 +4197,50 @@ Public Class Timbrado
End If
End If
i += 1
Next
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
Dim x As Integer
If ComPag.Pago(0).ImpuestosP(0) Is Nothing Then ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Retenciones).Count - 1) {}
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
x += 1
Next
End If
If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
Dim x As Integer
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 OrElse ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Traslados).Count - 1) {}
For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota.RoundSQL(6)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe.RoundSQL(6)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).BaseP = Tra.Base.RoundSQL(6)
x += 1
Next
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
Dim x As Integer
ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Retenciones).Count - 1) {}
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
x += 1
Next
End If
If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
Dim x As Integer
ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Traslados).Count - 1) {}
For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota.RoundSQL(6)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe.RoundSQL(6)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).BaseP = Tra.Base.RoundSQL(6)
x += 1
Next
End If
End If
''Estos impuestos aplicarían para anticipos
'If ObjCFDITimbre.ComplementoPagos.tota > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then
' ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
' ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
' If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
' Dim x As Integer
' ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T").Count - 1) {}
' For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T")
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe
' x += 1
' Next
' End If
' If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
' Dim x As Integer
' ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R").Count - 1) {}
' For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R")
' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
' x += 1
' Next
' End If
'End If
Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces()
nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20")
Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp)
Dim docComp As New XmlDocument()
docComp.LoadXml(xmlComp)
'comprobante.PagosSpecified = True
LXmlComplementos.Add(docComp.DocumentElement)
TieneComplemento = True
End If
nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20")
Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp)
Dim docComp As New XmlDocument()
docComp.LoadXml(xmlComp)
'comprobante.PagosSpecified = True
LXmlComplementos.Add(docComp.DocumentElement)
TieneComplemento = True
End If
End If
End If
#End Region

Binary file not shown.

View File

@@ -1684,7 +1684,6 @@ Partial Class PopUpVerFactura
DTRelacionados.Columns.Add(New DataColumn("Relacion", GetType(String)))
DTRelacionados.Columns.Add(New DataColumn("UUID", GetType(String)))
Dim XMLDoc As New XmlDocument
Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", TipoDocto, String.Format("{0}", SerieFolio), "xml")
Dim Archivo As New System.IO.FileInfo(Path)
@@ -1708,13 +1707,16 @@ Partial Class PopUpVerFactura
Dim RutaCBB As String = String.Format("{0}\CBB\{1}.jpg", UsuarioActual.Empresa.Ruta, SerieFolio)
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
Dim nodo As XmlNode = XMLDoc.DocumentElement
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
Dim Version = ValorXML(XMLDoc.DocumentElement, "version")
If Version = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0
cfdVer = "http://www.sat.gob.mx/cfd/4"
End If
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
namespaces.AddNamespace(Prefijo, cfdVer)
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
@@ -1722,6 +1724,7 @@ Partial Class PopUpVerFactura
namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte")
namespaces.AddNamespace("cartaporte20", "http://www.sat.gob.mx/CartaPorte20")
Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces)
If nodeComprobante IsNot Nothing Then
LugarExpedicion = ValorXML(nodeComprobante, "LugarExpedicion")
@@ -1749,13 +1752,10 @@ Partial Class PopUpVerFactura
Row("Descripcion") = ValorXML(node, "Descripcion", "")
Row("ValorUnitario") = ValorXML(node, "ValorUnitario", "")
Row("Importe") = ValorXML(node, "Importe", "")
DtConceptos.Rows.Add(Row)
Next
End If
Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces)
Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante/{0}:Complemento", Prefijo), namespaces)
Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces)
If nodeCartaPorte IsNot Nothing Then
@@ -2712,7 +2712,7 @@ Partial Class PopUpVerFactura
'dt.Rows.Add(row)
'CartaPorte.DataSources.Add(New ReportDataSource() With {.Name = "DataSet1", .Value = dt})
CartaPorte = PreParaImpresionCartaPorte(CveTimbreCartaPorteVenta, AplicaSubReporte:=true)
CartaPorte = PreParaImpresionCartaPorte(CveTimbreCartaPorteVenta, AplicaSubReporte:=True)
End If
End If

View File

@@ -508,10 +508,7 @@
<label for="<%= DdlEstadoSAT.ClientID.ToString()%>">Estado:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright" runat="server" visible="False" id="dvZH">
<asp:DropDownList ID="DdlZonaHoraria" DataTextField="DisplayText" DataValueField="CveZonaHoraria" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
@@ -533,6 +530,7 @@
</div>
<div class="row" id="divRegimen" runat="server" visible="false" >
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlRegimenFiscal" DataTextField="CodigoRegimenFiscalTexto" Width="100%" DataValueField="CveRegimenFiscal" runat="server" CssClass="form-control input-sm select2me">

View File

@@ -10231,11 +10231,12 @@ Partial Class Clientes
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
End If
DdlRegimenFiscal.DataSource = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal")
DdlRegimenFiscal.DataBind()
UpDatos.Update()
End Sub

View File

@@ -697,8 +697,7 @@ Partial Class PV
Get
Return New Dictionary(Of Integer, Decimal) From {
{20516, 0.21D}, 'Descuento para lubricantes LTH
{20515, 0.25D}, 'Descuento para filtros LTH
{20518, 0.183D} 'Descuento para pilas alcalinas -- segun
{20515, 0.25D} 'Descuento para filtros LTH
}
End Get
End Property
@@ -4393,10 +4392,10 @@ Partial Class PV
End If
End If
Else
If CveMarcaPS = 1092 Then ' E140 - alcalinas LTH
Descuento = ((Cantidad * PU) * 0.183D).RoundSQL(2)
End If
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515, 20518) Then
'If CveMarcaPS = 1092 Then ' E140 - alcalinas LTH
' Descuento = ((Cantidad * PU) * 0.183D).RoundSQL(2)
'End If
If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then
Descuento = ((Cantidad * PU) * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)).RoundSQL(2)
End If
End If

View File

@@ -2351,7 +2351,7 @@ Partial Class Ventas
UpFacturar.Update()
'CargaTiposDocumentos()
TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 1 Then
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 13 Then
DivCartaPorte.Visible = True
End If
ViewState("EstablecioFolio") = False
@@ -6113,8 +6113,6 @@ Partial Class Ventas
End If
End If
CargaDireccionCP()
ViewState("Vendedor") = ObjCliente.Vendedor
ViewState("CtaContable") = ObjCliente.CuentaContable
ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes
@@ -6165,7 +6163,7 @@ Partial Class Ventas
End If
'HABILITA LA OPCION DE DIRECCION DE ENVIO
If UsuarioActual.CveEmpresa.Contiene(1, 13, 72, 119, 140) Then
If UsuarioActual.CveEmpresa.Contiene(1, 72, 119, 140) Then
trDireccionEnvio.Visible = True
CargaDireccionesEnvio()
End If
@@ -7197,8 +7195,6 @@ Partial Class Ventas
CargaVendedores()
CargaDireccionCP()
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
If CveVenta <= 0 Then
Dim EsModuloCotizacion As Boolean = False
@@ -14972,7 +14968,7 @@ Partial Class Ventas
'TIMBRADO NUEVO
Try
Dim ObjetoPDF As Byte() = DescargarFactura(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)
Dim ObjetoPDF As Byte() = DescargarFactura(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True)
If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then
PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0"))
@@ -15339,11 +15335,11 @@ Partial Class Ventas
Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL())
Dim ObjContpaq As ClsContPAQi = Nothing
Dim CvePrepoliza As Integer
Dim CvePrePoliza As Integer
Dim ErrorConta As Boolean
Dim CveIEAnticipo As Integer
Dim CvePlantillaPoliza As Integer = 10
Dim PorcentajeAmortizacion As Decimal = 0
Dim PorcentajeAmortizacion As Decimal
Dim sumaAmorticaciones As Decimal = 0
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
Dim CveCuentaContabilizacion As Integer = 1
@@ -15351,17 +15347,7 @@ Partial Class Ventas
Dim ContaIdPoliza As Integer = 0
Dim ConceptoAmortizacion As Integer = 0
Dim UsaComplementariaClientes As Boolean = True
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
'Dim FechaMaxima As Date = MinFecha
'For Each gvr As GridViewRow In GVAnticipos.Rows
' If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
' If gvr.FCLiteral("LtlFecha").Text.ToDate > FechaMaxima Then
' FechaMaxima = gvr.FCLiteral("LtlFecha").Text.ToDate
' End If
' End If
'Next
Dim SimplificaPrePoliza As Boolean = True
''[IPP] PARCHE TEMPORAL PARA ANTICIPOS DE JAM
'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then
@@ -15385,7 +15371,6 @@ Partial Class Ventas
Dim IdCtaIVAXTrasladar As Integer = 0
Dim IdCtaIVATrasladado As Integer = 0
Dim CveSubProyectoVenta As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
Dim Importe91 As Decimal = 0
@@ -15413,19 +15398,7 @@ Partial Class Ventas
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
tipoCambioPago = 1
@@ -15481,8 +15454,8 @@ Partial Class Ventas
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento
End If
importeMovimiento = Math.Round(importeMovimiento, 2)
importeMX = Math.Round(importeMX, 2)
importeMovimiento = importeMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioVentaValuacion
If CveMonedaVenta = 1 Then
@@ -15549,26 +15522,26 @@ Partial Class Ventas
importeMovimiento = 0
Case 91 'Amortizacion Nota de Credito
Dim TC As Decimal = 1
If gvr.DataKey("CveConceptoContable").ToString().ToEntero() = 12 Then
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 1 Then
If gvr.DataKey("CveConceptoContable").ToEntero() = 12 Then
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 2 Then
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 2 Then
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = TipoCambioFluctuacion
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 1 Then
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
End If
importeMovimiento = Math.Round(importeMovimiento, 2)
importeMX = Math.Round(importeMX, 2)
importeMovimiento = importeMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If ObjConta.GetRetCuenta(ConceptoContable, CveCliente) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
@@ -15845,6 +15818,7 @@ Partial Class Ventas
Case 39 ' IEPS Trasladado
If gvr.DataKey("RegresarImpuesto") = "1" Then
SimplificaPrePoliza = False
CveIEAnticipo = gvr.DataKey("CveIE").ToEntero()
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.DataKey("DevolucionImportePagado").ToDecimal
PorcentajeImpuesto = 0
@@ -15888,7 +15862,7 @@ Partial Class Ventas
ErrorConta = True
End If
If Not ErrorConta AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrepoliza, UsuarioActual.CveEmpresa) Then
If Not ErrorConta AndAlso SimplificaPrePoliza AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrepoliza, UsuarioActual.CveEmpresa) Then
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If
@@ -16300,12 +16274,14 @@ Partial Class Ventas
Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
Exit Sub
If ChkEmitirCartaPorte.Checked Then
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
@@ -17408,8 +17384,6 @@ Partial Class Ventas
RecargaSucursalPartidas()
End If
CargaDireccionSucursalOrigen(GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(""))
DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
@@ -18041,6 +18015,11 @@ Partial Class Ventas
End If
End If
If Descuento < 0 Then
Descuento = 0
Alert("No se calculó el descuento correctamente", TipoMensaje.MsgAdvertencia)
End If
ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2)
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
If SeAjustoPU Then
@@ -22926,15 +22905,9 @@ Partial Class Ventas
If ChkDireccionEnvio.Checked Then
DdlDireccionEnvio.Visible = True
LnkOtraDireccion.Visible = True
'DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
Else
DdlDireccionEnvio.Visible = False
LnkOtraDireccion.Visible = False
If SucursalDestinoCP IsNot Nothing Then
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
'TxtDestinoCP.Text = ""
End If
End If
End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
@@ -34228,14 +34201,6 @@ Partial Class Ventas
#Region "C A R T A - P O R T E"
Public Sub CargaDireccionCP()
LblDireccion.Text = "Dirección"
LblColonia.Text = "Colonia"
LblCiudad.Text = "Ciudad"
LblEstado.Text = "Estado"
LblCP.Text = "00000"
End Sub
Public Sub CargarCamiones()
TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")