diff --git a/Ashx/GenerarPDFFactura.ashx b/Ashx/GenerarPDFFactura.ashx index 2e8cbae2d..c6d59baaf 100644 --- a/Ashx/GenerarPDFFactura.ashx +++ b/Ashx/GenerarPDFFactura.ashx @@ -200,6 +200,10 @@ Public Class GenerarPDFFactura : Implements IHttpHandler parametros.Add(New ReportParameter("complemento_CadenaOriginal", objxml.complemento.CadenaOriginal)) parametros.Add(New ReportParameter("Observaciones", datos.Factura.Observaciones)) + If datos.CFDIVersion = "4.0" Then + rutaReporte = "Empresas\Grales\Formatos\FacturaSALI40.rdlc" + parametros.Add(New ReportParameter("receptor_RegimenFiscal", objxml.receptor.RegimenFiscalReceptorTexto)) + End If Dim ds As New List(Of ReportDataSource) @@ -479,6 +483,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler End Class Public Class ParametroWS + Public Property CFDIVersion As String Public Property Factura As FacturaWS Public Property Cliente As ClienteWS Public Property Empresa As EmpresaWS diff --git a/Bin/APP_Code_CSharp.dll b/Bin/APP_Code_CSharp.dll index becf87606..29ebb5c0c 100644 Binary files a/Bin/APP_Code_CSharp.dll and b/Bin/APP_Code_CSharp.dll differ diff --git a/Bin/APP_Code_CSharp.pdb b/Bin/APP_Code_CSharp.pdb index e08316fcb..57e783bd0 100644 Binary files a/Bin/APP_Code_CSharp.pdb and b/Bin/APP_Code_CSharp.pdb differ diff --git a/Empresas/140/Formatos/Factura.mrt b/Empresas/140/Formatos/Factura.mrt index a95158a9d..c0b134024 100644 --- a/Empresas/140/Formatos/Factura.mrt +++ b/Empresas/140/Formatos/Factura.mrt @@ -176,20 +176,20 @@ None;Black;2;Solid;False;4;Black Transparent - + Transparent - 0,0,21.1,5.4 + 0,0.4,21.1,5.4 Transparent True True - 0,0,21,6 + 0,0,21,5.6 Transparent - 13,1.2,8,2.8 + 13,1.2,8,2.6 Myriad Pro,8,Regular,Point,False,0 @@ -223,7 +223,7 @@ Régimen fiscal: Regimen General de Ley Personas Morales Facturado a: Cliente: {ClienteCodigo} - {ClienteNombre} RFC: {ClienteRFC} -Calle: {ClienteCalle} +Calle: {ClienteCalle} No.Ext:{ClienteNoExt} Colonia: {ClienteColonia} Ciudad: {ClienteCiudad} Estado: {ClienteEstado} Municipio y/o Delegación: {ClienteMunicipio} @@ -3457,7 +3457,7 @@ de Hermosillo SA de CV Transparent True - 12.6,4.12,8.43,1.42 + 12,3.72,9.03,1.62 Myriad Pro,6.7,Bold,Point,False,0 @@ -3475,7 +3475,7 @@ Vendedor: {VendedorNombre} Transparent - 4,4,8.8,1.8 + 4,4,8,1.4 Myriad Pro,8,Regular,Point,False,0 @@ -3621,7 +3621,8 @@ de Hermosillo SA de CV Transparent - 0,27,21.1,0.4 + False + 0,32.48,21.1,0.4 Transparent @@ -3629,7 +3630,7 @@ de Hermosillo SA de CV 7.4,0,2.91,0.6 - Myriad Pro,8,Bold + Myriad Pro,8,Bold,Point,False,0 Right 2,2,2,2 Text35 @@ -3644,7 +3645,7 @@ de Hermosillo SA de CV 10.31,0,4.89,0.6 - Myriad Pro,8 + Myriad Pro,8,Regular,Point,False,0 2,2,2,2 Textbox37 @@ -3661,7 +3662,7 @@ de Hermosillo SA de CV 17.31,0,3.69,0.6 - Myriad Pro,8,Bold + Myriad Pro,8,Bold,Point,False,0 Right 2,2,2,2 Text37 @@ -3683,14 +3684,14 @@ de Hermosillo SA de CV Bottom;Transparent;5;Solid;False;4;Black;True - Transparent + [255:255:0] True True - 0,6.2,21,3.2 + 0,6.2,21.1,13.6 Transparent - 0,0,21,0.5 + 0,0.4,21.1,0.5 [58:65:115] @@ -3840,7 +3841,7 @@ de Hermosillo SA de CV Transparent True - 0,0.5,21,0.42 + 0,1.7,21.1,0.42 Transparent @@ -4024,8 +4025,9 @@ de Hermosillo SA de CV Transparent - 0,0.92,21,16.8 - + True + 0,2.92,21.1,10.6 + Bottom;Transparent;5;Solid;False;4;Black;True Transparent @@ -4037,7 +4039,7 @@ de Hermosillo SA de CV None;[247:150:70];1;Solid;False;8;[247:150:70] Transparent - 0,0,5.2,0.4 + 0,0.4,5.2,0.4 Transparent @@ -4109,7 +4111,6 @@ de Hermosillo SA de CV Text21 - OnlyLastPage Black @@ -4126,7 +4127,6 @@ de Hermosillo SA de CV Text6 - OnlyLastPage {ImporteLetra} Black Expression @@ -4138,7 +4138,7 @@ de Hermosillo SA de CV Transparent - 0,0,5.2,0.6 + 0,0.4,5.2,0.4 [58:65:115] @@ -4195,7 +4195,7 @@ de Hermosillo SA de CV Transparent - 0,0.6,5.2,0 + 0,1.6,5.2,0 Transparent @@ -4256,7 +4256,6 @@ de Hermosillo SA de CV DataBand8 - OnlyLastPage @@ -4265,7 +4264,6 @@ de Hermosillo SA de CV Panel2 - OnlyLastPage Transparent @@ -4294,7 +4292,6 @@ de Hermosillo SA de CV Text7 - OnlyLastPage Black @@ -4404,18 +4401,14 @@ Sello digital del SAT: Panel5 - OnlyLastPage Transparent - True - True - True - 2,8.28,17.2,1 + 2,8.15,17.3,1.2 Transparent - 0,0,17.2,0.6 + 0,0.4,17.3,0.6 [58:65:115] @@ -4490,7 +4483,7 @@ Sello digital del SAT: Transparent - 0,0.6,17.2,0.4 + 0,1.8,17.3,0.4 Transparent @@ -4549,7 +4542,7 @@ Sello digital del SAT: Transparent True - 9.2,0,8,0.37 + 9.4,0,7.82,0.37 Myriad Pro,7.5,Regular,Point,False,0 @@ -4560,6 +4553,9 @@ Sello digital del SAT: {DtDocumentosRelacionados.FolioFiscal} Black + + #,0.00 + DataColumn @@ -4577,15 +4573,14 @@ Sello digital del SAT: - True Panel6 OnlyLastPage - + [58:65:115] - 0,7.28,21.2,0.5 + 0,7.28,21,0.5 False @@ -4603,9 +4598,9 @@ Sello digital del SAT: [255:255:255] Expression - + Transparent - 5.6,7.88,2.4,0.4 + 5.4,7.8,2.4,0.35 False @@ -4623,9 +4618,9 @@ Sello digital del SAT: Black Expression - + Transparent - 8,7.88,9.4,0.4 + 7.8,7.8,9.4,0.35 False @@ -4642,20 +4637,55 @@ Sello digital del SAT: Black Expression - - Bottom, Right + + 14.45,6.88,6.6,0.0254 + Black + + + Black + + + Line4 + + + + Black + + + + + + False + FooterBand1 + + + + + + Top + + True + Panel1 + + + + + Transparent + 0,20.2,21.1,5.4 + + + Transparent + True + True + 0,0,21.1,5.2 + + Transparent - True - True - 0,11.8,21,5 - - - Transparent - 0.6,0,2.58,1.41 - - - 68, 114, 196 - iVBORw0KGgoAAAANSUhEUgAAEHQAAAgICAYAAAC1Y1ExAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz + 0.6,0,2.58,1.41 + + + 68, 114, 196 + iVBORw0KGgoAAAANSUhEUgAAEHQAAAgICAYAAAC1Y1ExAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAuIgAALiIBquLdkgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAP+NSURB VHhe7N3NeSJZsy7QawLPsYDJmWOCTMAETMAEmYAJMgETZAImMLlzPDg38rTqfuro6CoJ8bMjcw3W JAZVApI3iGSz9//5n//5HwAAAAAAAAAAAAAAAAAAAABuqCwCAAAAAAAAAAAAAAAAAAAAcL2yCAAA @@ -7831,221 +7861,197 @@ AADgdsODAAAAAAAAAAAAAAAAAAAAANxueBAAAAAAAAAAAAAAAAAAAACA2w0PAgAAAAAAAAAAAAAA AAAAAHC74UEAAAAAAAAAAAAAAAAAAAAAbjc8CAAAAAAAAAAAAAAAAAAAAMDthgcBAAAAAAAAAAAA AAAAAAAAuN3wIAAAAAAAAAAAAAAAAAAAAAC3Gx4EAAAAAAAAAAAAAAAAAAAA4Fb/v//P/x94RXrG /wp7ygAAAABJRU5ErkJggg== - True - 2,2,2,2 - Image1 - - - True - - - Transparent - True - 3.36,0.56,14.88,0.85 - - - Myriad Pro,8.5,Regular,Point,False,0 - True - 2,2,2,2 - Textbox36 - - - Cliente: {ClienteCodigo} - {ClienteNombre} - {ClienteRFC} + True + 2,2,2,2 + Image1 + + + True + + + Transparent + True + 3.36,0.56,14.88,0.85 + + + Myriad Pro,8.5,Regular,Point,False,0 + True + 2,2,2,2 + Textbox36 + + + Cliente: {ClienteCodigo} - {ClienteNombre} - {ClienteRFC} Domicilio: {ClienteDireccion}, {ClienteCiudad}, {ClienteEstado} - Black - - - Transparent - True - 0,1.54,20.96,2.27 - - - Myriad Pro,7,Bold,Point,False,0 - True - 2,2,2,2 - Textbox76 - - - POR ESTE PAGARÉ PROMETO(EMOS), Y ME (NOS) OBLIGO (AMOS) A PAGAR INCONDICIONALMENTE A LA ORDEN DE BDH BATERIAS DISTRIBUCIONES DE + Black + + + Transparent + True + 0,1.54,20.96,2.27 + + + Myriad Pro,7,Bold,Point,False,0 + True + 2,2,2,2 + Textbox76 + + + POR ESTE PAGARÉ PROMETO(EMOS), Y ME (NOS) OBLIGO (AMOS) A PAGAR INCONDICIONALMENTE A LA ORDEN DE BDH BATERIAS DISTRIBUCIONES DE HERMOSILLO SA DE CV, EN LA CIUDAD DE HERMOSILLO, SONORA, O CUALQUIER OTRA CIUDAD QUE DESIGNE EL TITULAR DEL DOCUMENTO, LA CANTIDAD DE $ {Total} ***SON {ImporteLetra}*** VALOR QUE RECONOZCO (EMOS) ADEUDARLE OBLIGÁNDOME (NOS) A CUBRIR A SU VENCIMIENTO {Vencimiento}, DE NO PAGARSE CAUSARÍA UN INTERÉS MORATORIO DEL 10% POR CIENTO MENSUAL, POR EL TIEMPO QUE PERMANEZCA INSOLUTO EL ADEUDO EXISTENTE, QUEDANDO EXPRESAMENTE CONVENIDO QUE LA FALTA DE PAGO OPORTUNO OCASIONA AL DEUDOR GASTOS DE COBRO JUDICIALES O EXTRAJUDICIALES Y LOS QUE SE OCASIONEN, RENUNCIANDO EL DEUDOR AL FUERO DE SU DOMICILIO QUE PUDIERA CORRESPONDERLE, ESTE PAGARÉ ES MERCANTIL Y ESTÁ PROTEGIDO POR LA LEY GENERAL DE TÍTULOS Y OPERACIONES DE CRÉDITO. - [0:0:0] - Expression - - - Transparent - True - 6.86,4.43,6.65,0.47 - - - Microsoft Sans Serif,8,Regular,Point,False,0 - Center - True - 2,2,2,2 - Textbox47 - - - ACEPTO (AMOS) DE CONFORMIDAD - Black - - - Transparent - True - 6.86,3.67,6.65,0.54 - - - Microsoft Sans Serif,8,Regular,Point,False,0 - Center - True - 2,2,2,2 - Textbox44 - - - Obligado - [0:0:0] - - - True - Transparent - True - 17,0.2,1,0.4 - - - Myriad Pro,10,Bold,Point,False,0 - 0,0,0,0 - Text15 - - - {Serie} - [255:0:0] - Expression - Bottom - - - Transparent - 18,0.2,1,0.4 - - - Myriad Pro,9,Bold,Point,False,0 - Right - 0,0,0,0 - Text16 - - - Folio: - Black - Expression - Bottom - - - True - Transparent - True - 19,0.2,1,0.4 - - - Myriad Pro,10,Bold,Point,False,0 - 0,0,0,0 - Text17 - - - {Folio} - [255:0:0] - Expression - Bottom - - - Transparent - 15.4,0.2,1.6,0.4 - - - Myriad Pro,9,Bold,Point,False,0 - Right - 0,0,0,0 - Text18 - - - Serie: - Black - Expression - Bottom - - - 0,1.44,21,0.0254 - Black - - - Black - - - True - Line1 - - - - Black - - - - 6.86,4.46,6.65,0.0254 - Black - - - Black - - - True - Line3 - - - - Black - - - + [0:0:0] + Expression + + + Transparent + True + 6.86,4.63,6.65,0.47 - Bottom - Rectangle2 + Microsoft Sans Serif,8,Regular,Point,False,0 + Center + True + 2,2,2,2 + Textbox47 - - OnlyLastPage - None - - - 14.45,6.88,6.6,0.0254 + + ACEPTO (AMOS) DE CONFORMIDAD + Black + + + Transparent + True + 6.86,3.67,6.65,0.54 + + + Microsoft Sans Serif,8,Regular,Point,False,0 + Center + True + 2,2,2,2 + Textbox44 + + + Obligado + [0:0:0] + + + True + Transparent + True + 17,0.2,1,0.4 + + + Myriad Pro,10,Bold,Point,False,0 + 0,0,0,0 + Text15 + + + {Serie} + [255:0:0] + Expression + Bottom + + + Transparent + 18,0.2,1,0.4 + + + Myriad Pro,9,Bold,Point,False,0 + Right + 0,0,0,0 + Text16 + + + Folio: + Black + Expression + Bottom + + + True + Transparent + True + 19,0.2,1,0.4 + + + Myriad Pro,10,Bold,Point,False,0 + 0,0,0,0 + Text17 + + + {Folio} + [255:0:0] + Expression + Bottom + + + Transparent + 15.4,0.2,1.6,0.4 + + + Myriad Pro,9,Bold,Point,False,0 + Right + 0,0,0,0 + Text18 + + + Serie: + Black + Expression + Bottom + + + 0,1.44,21,0.0254 Black - + Black - Line4 + True + Line1 - - + + Black - + + + 6.86,4.66,6.65,0.0254 + Black + + + Black + + + True + Line3 + + + + Black + + - FooterBand1 + True + Pagare - - + + OnlyLastPage + - True - Panel1 + FooterBand2 - + @@ -8069,10 +8075,10 @@ ESTE PAGARÉ ES MERCANTIL Y ESTÁ PROTEGIDO POR LA LEY GENERAL DE TÍTULOS Y OPE Stimulsoft.Report.Dll Factura - 12/3/2022 4:12:16 PM + 12/9/2022 10:44:46 AM 7/11/2022 2:49:19 PM C:\inetpub\wwwSIGGIT\Empresas\140\Formatos\Factura.mrt - 37b51e78986c4b0a95ef37a74df287a1 + 3135a03f0de04b128f910e44a3c041ce Factura Centimeters 2022.4.5.0 diff --git a/Inventarios/RepExistenciasCostos.aspx.vb b/Inventarios/RepExistenciasCostos.aspx.vb index 3c6d86118..acb091561 100644 --- a/Inventarios/RepExistenciasCostos.aspx.vb +++ b/Inventarios/RepExistenciasCostos.aspx.vb @@ -273,12 +273,12 @@ Partial Class Inventarios_RepExistenciasCostos Private Sub impimir(Optional reporte As String = "PDF") - Dim Proveedor = If(DdlProveedor.SelectedValue = "-1", "", $" Proveedor: {DdlProveedor.SelectedItem.Text}") - Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $" Moneda: {DdlMoneda.SelectedItem.Text}") - Dim Concepto = If(DdlTipoMovimiento.SelectedValue = "-1", "", $" Concepto: {DdlTipoMovimiento.SelectedItem.Text}") + Dim Proveedor = If(DdlProveedor.SelectedValue = "-1", "", $" Proveedor: {If(DdlProveedor.SelectedItem Is Nothing, "", DdlProveedor.SelectedItem.Text)}") + Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $" Moneda: {If(DdlMoneda.SelectedItem Is Nothing, "", DdlMoneda.SelectedItem.Text)}") + Dim Concepto = If(DdlTipoMovimiento.SelectedValue = "-1", "", $" Concepto: {If(DdlTipoMovimiento.SelectedItem Is Nothing, "", DdlTipoMovimiento.SelectedItem.Text)}") Dim PS = If(HFProducto.Value.ToEntero > 0, $" Producto/Servicio: {GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=HFProducto.Value.ToEntero).Rows(0)("PSCodigo").ToString}", "") - Dim Almacen = If(DdlAlmacen.SelectedValue = " - 1", "", $" Almacen: {DdlAlmacen.SelectedItem.Text}") - Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $" Clasificacion: {DdlClasificacion.SelectedItem.Text}") + Dim Almacen = If(DdlAlmacen.SelectedValue = " - 1", "", $" Almacen: {If(DdlAlmacen.SelectedItem Is Nothing, "", DdlAlmacen.SelectedItem.Text)}") + Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $" Clasificacion{If(DdlClasificacion.SelectedItem Is Nothing, "", DdlClasificacion.SelectedItem.Text)}") Dim FechaIn As String = $" Fecha Inicio: {TxtFechaI.Text}" Dim FechaFn As String = $" Fecha Fin: {TxtFechaF.Text}" If TxtFechaI.Text = "" Then FechaIn = "" diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 12851b38b..a5d62409b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2315,7 +2315,7 @@ Partial Class Ventas Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - + If UsuarioActual.CveEmpresa.Contiene(141, 152, 153, 160, 161, 162) Then System.Threading.Thread.Sleep(2000) If Not IsPostBack Then If IfNull(Request("Opcionx"), "").ToString = "Saldar" And UsuarioActual.CveUsuario = 100 Then @@ -6000,7 +6000,7 @@ Partial Class Ventas DdlMetodoCliente.DataSource = GlobalDTVtaMetodoPago DdlMetodoCliente.DataBind() - If CveMetodoPago = 1 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then + If UsuarioActual.CveRol = 1 AndAlso CveMetodoPago = 1 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then If TmpDT.SUMD("Descuento") > 0 Then Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D Dim RowDescuentos = TmpDT.Select("Descuento > 0") @@ -6171,7 +6171,6 @@ Partial Class Ventas End Sub - Private Sub CargaEmpresaCRM(CveEmpresaCRM As Integer) Dim ObjCRM As New ClsCRM If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) Then @@ -6243,7 +6242,6 @@ Partial Class Ventas ObjCRM.Dispose() End Sub - Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = -1) If CveCliente <= 0 Then Exit Sub @@ -6471,10 +6469,6 @@ Partial Class Ventas ChkEmitirComercioExterior.Checked = True ChkEmitirComercioExterior_CheckedChanged(ChkEmitirComercioExterior, EventArgs.Empty) - If CveCliente = 665317 Then - ChkAplicaDestinatario.Checked = True - ChkAplicaDestinatario_CheckedChanged(ChkAplicaDestinatario, EventArgs.Empty) - End If End If @@ -9103,15 +9097,15 @@ Partial Class Ventas EsValido = True End If - 'If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then - ' CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo) - ' 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA - ' If PU <= CostoMayor Then - ' EsValidoMayor = True - ' End If - 'Else - ' EsValidoMayor = True - 'End If + If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then + CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo) + 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA + If PU <= CostoMayor Then + EsValidoMayor = True + End If + Else + EsValidoMayor = True + End If 'VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR If Not EsValido Or PU = 0 Then @@ -9127,24 +9121,24 @@ Partial Class Ventas End If 'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) - 'If Not EsValido Then + If Not EsValido Then - ' MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado
", dr("PS").ToString()) - ' If TienePermisoImportes Then - ' MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) - ' MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) - ' MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) - ' End If - 'End If + MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado
", dr("PS").ToString()) + If TienePermisoImportes Then + MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) + MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) + MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) + End If + End If - 'If Not EsValidoMayor Then - ' MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio mayor de su rango aceptado
", dr("PS").ToString()) - ' If TienePermisoImportes Then - ' MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) - ' MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor) - ' MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) - ' End If - 'End If + If Not EsValidoMayor Then + MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio mayor de su rango aceptado
", dr("PS").ToString()) + If TienePermisoImportes Then + MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) + MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor) + MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) + End If + End If ' SOLO SI TIENE LA FUNCIONALIDAD DE RESTRICCION VALIDA EL IMPORTE CERO If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 Then @@ -9319,7 +9313,7 @@ Partial Class Ventas TmpDTError = TmpDT.Copy() End If - If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then + If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then If LblDescuentoAdicional.Text.ToDecimal() > 0 Then Dim TotalDescuento As Decimal = LblDescuentoAdicional.Text.ToDecimal() / (1D + TmpDT.MAX("PorcentajeIVA").ToString().ToDecimal()) Dim RowDescuentos = TmpDT.Select("Descuento > 0") @@ -10072,6 +10066,21 @@ Partial Class Ventas End If End If + If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then + + Dim ArchivoCotRdlc As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta)) + Dim ArchivoCotMrt As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta)) + + If ArchivoCotRdlc.Exists Or ArchivoCotMrt.Exists Then + MensajeAlert.AppendFormat("
", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))) + Else + MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ") + End If + End If + + + + 'ERROR DE NO TIMBRADO If Not SeTimbro And (DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue = "Ant") Then MensajeAlert.AppendFormat("La factura no se pudo timbrar. Por favor intentelo de nuevo a traves del boton Emitir.") @@ -10100,6 +10109,10 @@ Partial Class Ventas End If End If + If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then + RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir") + End If + 'DESCARGAR PDF DE CICOVISA 'If UsuarioActual.CveEmpresa = 72 And CveCliente = 70381 Then ' If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then @@ -10194,7 +10207,12 @@ Partial Class Ventas Liga2 = $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}"";" End If - Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False) + If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then + Liga = $"document.location.href=""/CRM/Acercamiento.aspx?CveAcercamiento={CveAcercamientoCRM}&OPTAB=COT"";" + Alert(MensajeAlert.ToString(), TipoMensaje.MsgInformacion, Liga, TextoConfirmacion:="Aceptar", TextoSegundoBoton:=Nothing, JSBtn2:=Nothing, ShowCloseButton:=False) + Else + Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False) + End If MensajeAlert.Clear() @@ -16075,9 +16093,48 @@ Partial Class Ventas For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then + + + Dim FechaUltimaFluctuacion As Date = MinFecha + Dim TipoCambioFluctuacion As Decimal = 1 + Dim tFecha As Date = Now + + Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) + + + If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then + If UltimaFluctuacion.FechaFluctuacion <= tFecha Then + FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion + TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion + 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 + tipoCambioVenta = 1 + tipoCambioVentaValuacion = 1 + PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal + ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN PESOS + tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal + tipoCambioVenta = TxtTipoCambio.Text.ToDecimal + tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) + PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal + ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN DOLARES + tipoCambioPago = gvr.DataKey("TipoCambio").ToString().ToDecimal + tipoCambioVenta = TxtTipoCambio.Text.ToDecimal + tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) + PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal + ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES + tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal + tipoCambioVenta = 1 + tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) + PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal + End If Dim importeMovimiento As Decimal = 0 Dim importeMN As Decimal = 0 + Dim TC As Decimal Dim IdCtaContable As Integer Dim TipoMovimiento As Boolean = True Dim Concepto As String = VentaActual.SerieFolio @@ -16108,14 +16165,23 @@ Partial Class Ventas If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal + importeMN = importeMovimiento + TC = gvr.DataKey("TipoCambio").ToString().ToDecimal ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal + importeMN = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal + TC = gvr.DataKey("TipoCambio").ToString().ToDecimal 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 + importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal + TC = TipoCambioFluctuacion 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 + importeMN = importeMovimiento + TC = gvr.DataKey("TipoCambio").ToString().ToDecimal End If importeMovimiento = importeMovimiento.RoundSQL + importeMN = importeMN.RoundSQL If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(12, CveCliente) Then If ObjConta.DtResultados.Rows.Count > 0 Then @@ -16147,22 +16213,81 @@ Partial Class Ventas If gvr.DataKey("CveIE").ToEntero() > 0 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal + IdCtaContable = IdCtaContClientes If importeMovimiento <> 0 Then Dim Pago As New VentaPago - Pago.ImportePagoVenta = importeMovimiento Pago.ImportePago = importeMovimiento Pago.CveIE = CveIEAnticipo Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero() - Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal - Pago.TipoPago = "I" - Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate + Pago.TipoPago = "A" Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero() + Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1" Pago.Referencia = gvr.DataKey("Folio") ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) + ' Agregamos el 2 + If tipoCambioPago = 1 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then + ErrorConta = True + End If + Else 'Cuando son dolares + If importeMovimiento <> 0 Then + If IdCtaContComplementaria > 0 Or 0 > 0 Then + 'Agregamos la Complementaria + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then + ErrorConta = True + End If + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then + ErrorConta = True + End If + Else + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then + ErrorConta = True + End If + End If + End If + End If + + importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal) + importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) + + + 'Agregamos el 92 + importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) + importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) + IdCtaContable = IdCtaContAnticipos + + If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + If Not tipoCambioPago = 1 Then + IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos + Else + IdCtaContable = ObjCliente.IdCtaContAnticipos + End If + End If + End If + + If UsuarioActual.CveEmpresa.Contiene(119) Then + If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + If Not tipoCambioPago = 1 Then + IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera + Else + IdCtaContable = ObjCliente.IdCtaContClientes + End If + End If + End If + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then + ErrorConta = True + End If + End If End If End Select @@ -18095,7 +18220,7 @@ Partial Class Ventas Return ObjDescuento End If - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Cot") AndAlso CveRinTamañoPS > 0 Then + If UsuarioActual.CveRol = 1 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Cot") AndAlso CveRinTamañoPS > 0 Then If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso Not TbDescuentosAdicionales.Visible Then TbDescuentosAdicionales.Visible = True End If @@ -20443,6 +20568,7 @@ Partial Class Ventas Dim DtCostos As DataTable = Nothing Dim DtCostosDistinct As DataTable = Nothing Dim IdCtaContable As Integer = 0 + Dim ValorInventario As Decimal = 0D Dim TotalCostoAcumulado As Decimal = 0D Dim Cont As Integer = 1 @@ -22467,7 +22593,7 @@ Partial Class Ventas VieneDeCotizacion = True End If - If DdlTipoComprobante.SelectedValue = "Ing" AndAlso (Not VieneDeCotizacion) AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DtPagos IsNot Nothing AndAlso TbDescuentosAdicionales.Visible Then + If UsuarioActual.CveRol = 1 AndAlso DdlTipoComprobante.SelectedValue = "Ing" AndAlso (Not VieneDeCotizacion) AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DtPagos IsNot Nothing AndAlso TbDescuentosAdicionales.Visible Then If TmpDT.SUMD("Descuento") > 0 AndAlso DtPagos.SUMD("Importe", "MesesSinIntereses <=0") = TxtTotal.Text.ToDecimal() Then Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D Dim RowDescuentos = TmpDT.Select("Descuento > 0")