diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 4ca46507c..5d751b497 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -904,7 +904,8 @@ Public Class ClsCompras Public Function GetRepProductosServicios(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoGasto As String = "-1", - Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1, Optional CveCultivo As String = "-1") As Boolean + Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1, Optional CveCultivo As String = "-1", + Optional CveTipoProveedor As Integer = -1, Optional CveProveedorClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_GetRepPS") @@ -934,6 +935,8 @@ Public Class ClsCompras .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@Deducible", SqlDbType.Int).Value = Deducible .Add("@CveCultivo", SqlDbType.VarChar).Value = CveCultivo + .Add("@CveTipoProveedor", SqlDbType.VarChar).Value = CveTipoProveedor + .Add("@CveProveedorClasificacion", SqlDbType.VarChar).Value = CveProveedorClasificacion End With diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 2c3753280..077de40dc 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3208,6 +3208,18 @@ Public Class ClsNominas Return retorno End Function + Public Function RepFiniquitos(cveSubproyecto As Int32, CveEstatusFiniquito As Int32, cveEmpresa As Int32, FechaInicio As String, FechaFin As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_RepFiniquitos", CommandType.StoredProcedure) + addParameters("@CveSubProyecto", SqlDbType.Int, cveSubproyecto) + addParameters("@CveEstatusFiniquito", SqlDbType.Int, CveEstatusFiniquito) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@FechaInicio", SqlDbType.VarChar, FechaInicio) + addParameters("@FechaFin", SqlDbType.VarChar, FechaFin) + retorno = RunQuery("Ocurrió un error al obtener el Embarque Manifiesto .") + Return retorno + End Function + Public Function EmbarquePalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32, Optional agrupado As Boolean = False) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Agro_Embarque_PalletGet", CommandType.StoredProcedure) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7bb89b66e..3674d029d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4989,6 +4989,7 @@ Public Class ClsPaginas PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712) PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038) PaginaDict.Add("/General/CatMedidaEquivalencia.aspx".ToUpper(), 773) + PaginaDict.Add("/General/RepIndicadorResumen.aspx".ToUpper(), 110) #End Region @@ -5163,6 +5164,7 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/ConceptoNomina.aspx".ToUpper(), 172) PaginaDict.Add("/Nomina/CatPeriodos.aspx".ToUpper(), 177) PaginaDict.Add("/Nomina/Finiquito.aspx".ToUpper(), 197) + PaginaDict.Add("/Nomina/RepFiniquito.aspx".ToUpper(), 989) PaginaDict.Add("/Nomina/CatSatBancos.aspx".ToUpper(), 255) PaginaDict.Add("/Nomina/CatSatConceptos.aspx".ToUpper(), 256) PaginaDict.Add("/Nomina/CatSatRegimenContratacion.aspx".ToUpper(), 257) @@ -7184,7 +7186,7 @@ Public Class ClsPaginas CEId = "" Try - CEId = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).SelectSingleNode("//cce11:Destinatario", namespaces).Attributes("NumRegIdTrib").InnerText 'XmlDoc.SelectNodes("//cfdi:Complemento/tfd:TimbreFiscalDigital/cce11:Destinatario") + CEId = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).SelectSingleNode("//cce11:Receptor", namespaces).Attributes("NumRegIdTrib").InnerText 'XmlDoc.SelectNodes("//cfdi:Complemento/tfd:TimbreFiscalDigital/cce11:Destinatario") Catch ex As Exception End Try @@ -8216,7 +8218,7 @@ Public Class ClsPaginas TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) - If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then Dim dtVentas As DataTable = ObjVentas.DtResultados ' se rellenan los campos de la factura diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 95e4fa60c..58c329720 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -211,6 +211,9 @@ Partial Class PopUpVerFactura If Request("onlyPrint").ToString() = "PalletCaja" AndAlso Not IsNothing(Request("CvePallet")) Then imprimirpallet(Request("CvePallet").ToString.ToEntero()) End If + If Request("onlyPrint").ToString() = "PalletCaja2" AndAlso Not IsNothing(Request("CvePallet")) Then + imprimirpalletWalamart(Request("CvePallet").ToString.ToEntero()) + End If If Request("onlyPrint").ToString() = "manifiesto" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero()) @@ -857,6 +860,141 @@ Partial Class PopUpVerFactura '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" ImprimirPDF("GPS/PalletEtiqueta2.rdlc", lrds, params, "Pallet", Content_Disposition:="Inline") End Sub + + + Private Sub imprimirpalletWalamart(cvePallet As Integer) + Dim Envase As String = "" + Dim Tamano As String = "" + Dim Cultivo As String = "" + Dim Cultivoingles As String = "" + Dim noPallet As String = "" + Dim FormatoImpresion As String = "" + Dim Consecutivo As String = "" + Dim Fecha As String = "" + Dim NoCajas As String = "" + Dim NumberOfCode As String = "" + Dim CvetypeImpresion As Integer + Dim NumberSmall As String = "" + Dim NumberBig As String = "" + Dim GTINAll As String = "" + Dim Peso As String = "" + Dim GTIN As String = "" + Dim PLU As String = "" + 'Envase = "1 1/9" + 'Tamano = "Small" + 'Cultivo = "Tomate" + 'noPallet = "000001" + Using objnom As New ClsNominas + If objnom.EmbarquePalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then + Dim row As DataRow = objnom.DtResultados.Rows(0) + Envase = row("Envase").ToString() + Tamano = row("Tamaño").ToString() + Cultivo = row("Cultivo").ToString() + Cultivoingles = row("Cultivoingles").ToString() + noPallet = row("Codigo").ToString() + FormatoImpresion = row("FormatoImpresion").ToString() + Consecutivo = row("Consecutivo").ToString() + NoCajas = row("NoCajas").ToString() + Fecha = String.Format("{0:MMM dd}", row("Fecha")).Replace(".", "").ToUpper() + CvetypeImpresion = row("CvetypeImpresion").ToString().ToEntero() + NumberOfCode = String.Format("(00)00000000000000(00){1:ddMMyy}(00){0}00", Right(String.Format("0{0}", Regex.Match(row("Cuadro").ToString(), "\d+")), 2), row("Fecha")) + 'NumberSmall = String.Format("{0:00}", noPallet.ToEntero()) + 'NumberBig = String.Format("{0:00}", row("Consecutivo").ToString().ToEntero()) ' String.Format("{0:dd}", row("Fecha")) + + + NumberSmall = row("NumberSmall").ToString() + NumberBig = row("NumberBig").ToString() + GTINAll = row("GTINAll").ToString() + Peso = row("PesoText").ToString() + GTIN = row("GTIN").ToString() + PLU = row("PLU").ToString() + + End If + End Using + Dim params As New List(Of ReportParameter) + + params.Add(New ReportParameter("Tamano", Tamano)) + params.Add(New ReportParameter("noPallet", noPallet)) + params.Add(New ReportParameter("FormatoImpresion", FormatoImpresion)) + params.Add(New ReportParameter("Consecutivo", Consecutivo)) + params.Add(New ReportParameter("Fecha", Fecha)) + params.Add(New ReportParameter("CveFormato", If(Cultivo.ToLower().Contains("tomate"), "3", CvetypeImpresion.ToString()))) + params.Add(New ReportParameter("NoCajas", NoCajas)) + params.Add(New ReportParameter("NumberOfCode", NumberOfCode)) + params.Add(New ReportParameter("Cultivo", If(CvetypeImpresion = 2, Cultivoingles, Cultivo))) + params.Add(New ReportParameter("Envase", If(CvetypeImpresion = 2, "PLU 4062", Envase))) + params.Add(New ReportParameter("NumberSmall", NumberSmall)) + params.Add(New ReportParameter("NumberBig", NumberBig)) + params.Add(New ReportParameter("GTINAll", GTINAll)) + params.Add(New ReportParameter("Peso", Peso)) + params.Add(New ReportParameter("GTIN", GTIN)) + params.Add(New ReportParameter("PLU", PLU)) + + + + Dim tablaReporte As New DataTable + tablaReporte.Columns.Add(New DataColumn("Codigo", GetType(String))) + tablaReporte.Rows.Add(tablaReporte.NewRow) + tablaReporte.Rows.Add(tablaReporte.NewRow) + + Dim lrds As New List(Of ReportDataSource) + + 'img + Dim dtqr As New DataTable + Dim column As DataColumn = New DataColumn("ImagenByte") + column.DataType = System.Type.[GetType]("System.Byte[]") + column.AllowDBNull = True + column.Caption = "ImagenByte" + dtqr.Columns.Add(column) + Dim rowqr As DataRow = dtqr.NewRow() + + + Dim bcode As New BarcodeLib.Barcode() + Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTIN), 500, 200) + Dim barcodebyte As Byte() + Using ms = New MemoryStream() + img.Save(ms, System.Drawing.Imaging.ImageFormat.Png) + barcodebyte = ms.ToArray() + End Using + rowqr("ImagenByte") = barcodebyte + + dtqr.Rows.Add(rowqr) + Dim rds2 As New ReportDataSource With {.Name = "dsImagenes", .Value = dtqr} + rds2.Name = "dsImagenes" + rds2.Value = dtqr + lrds.Add(rds2) + 'endimg + + + Dim dtqr2 As DataTable = dtqr.Clone() + + Dim bcode2 As New BarcodeLib.Barcode() + Dim img2 = bcode2.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTINAll.Replace("(", "").Replace(")", "")), 900, 100) + Dim barcodebyte2 As Byte() + Using ms = New MemoryStream() + img2.Save(ms, System.Drawing.Imaging.ImageFormat.Png) + barcodebyte2 = ms.ToArray() + End Using + Dim rowqr2 As DataRow = dtqr2.NewRow() + rowqr2("ImagenByte") = barcodebyte2 + dtqr2.Rows.Add(rowqr2) + Dim rds22 As New ReportDataSource With {.Name = "dsImagenesGTIN", .Value = dtqr2} + lrds.Add(rds22) + + + + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte} + lrds.Add(rds) + + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + Dim ruta As String = "GPS/PalletEtiquetaWalmart.rdlc" + 'If CvetypeImpresion = 2 Then + ' ruta = "GPS/PalletEtiqueta_2.rdlc" + 'End If + ImprimirPDF(ruta, lrds, params, "Pallet Caja", Content_Disposition:="Inline") + End Sub + Private Sub imprimirpallet(cvePallet As Integer) Dim Envase As String = "" Dim Tamano As String = "" diff --git a/GPS/PalletEtiquetaWalmart.rdlc b/GPS/PalletEtiquetaWalmart.rdlc new file mode 100644 index 000000000..05f8985f9 --- /dev/null +++ b/GPS/PalletEtiquetaWalmart.rdlc @@ -0,0 +1,2485 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 06ae5329-8ff5-42b5-b7f4-6d68e5186421 + + + + System.Data.DataSet + /* Local Connection */ + + 06ae5329-8ff5-42b5-b7f4-6d68e5142861 + + + + System.Data.DataSet + /* Local Connection */ + + db271139-498f-42f1-b0bc-9c6d57014da7 + + + + + + dsImagenes + /* Local Query */ + + + + ImagenByte + System.Byte[] + + + + dsImagenes + C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite3\App_Code\DataSet.xsd + dtImagenes + + + + + + + + dsImagenesGTIN + /* Local Query */ + + + + ImagenByte + System.Byte[] + + + + dsImagenesGTIN + C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite3\App_Code\DataSet.xsd + dtImagenesGTIN + + + + + + + + DataSet + /* Local Query */ + + + + Codigo + System.String + + + + DataSet + C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite3\App_Code\DataSet.xsd + DataTable1 + + + + + + + + + + + + + + + 1.6cm + + + 1.07125cm + + + 0.60348cm + + + 0.16cm + + + 0.84cm + + + 0.85cm + + + 0.25cm + + + 1.6cm + + + 0.84cm + + + 0.46cm + + + 0.16cm + + + 0.84cm + + + 0.95583cm + + + + + 0.70407cm + + + + + Database + =First(Fields!ImagenByte.Value, "dsImagenesGTIN") + image/png + FitProportional + + + 1pt + + + 6 + + + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + Database + =First(Fields!ImagenByte.Value, "dsImagenesGTIN") + image/png + FitProportional + + + 1pt + + + 6 + + + + + + + + + + + 0.44125cm + + + + + true + true + + + + + =Parameters!GTINAll.Value + + + + + + + Textbox129 + + + 1pt + 1pt + + + 6 + + + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!GTINAll.Value + + + + + + + Textbox135 + + + 1pt + 1pt + + + 6 + + + + + + + + + + + 0.36187cm + + + + + true + true + + + + + =Microsoft.VisualBasic.Strings.Trim(Parameters!Cultivo.Value) + + + + + + 1pt + 1pt + 1pt + + + 3 + + + + + + + + true + true + + + + + Harvest Date + + + + + + + Textbox628 + + + 1pt + 1pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Microsoft.VisualBasic.Strings.Trim(Parameters!Cultivo.Value) + + + + + + 1pt + 1pt + 1pt + + + 3 + + + + + + + + true + true + + + + + Harvest Date + + + + + + + Textbox628 + + + 1pt + 1pt + + + 3 + + + + + + + + 0.44125cm + + + + + true + true + + + + + =Parameters!Peso.Value + + + + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox71 + + + 1pt + 1pt + 1pt + 1pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Peso.Value + + + + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox71 + + + 1pt + 1pt + 1pt + 1pt + + + 2 + + + + + + + 0.2825cm + + + + + true + true + + + + + US #1 + + + + + + + + 2 + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + PLU + + + + + + + Textbox149 + + + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + US #1 + + + + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + PLU + + + + + + + Textbox149 + + + + + 2 + + + + + + + 0.38834cm + + + + + true + true + + + + + Product of México + + + + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + =Parameters!PLU.Value + + + + + + + Textbox208 + + + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Product of México + + + + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + =Parameters!PLU.Value + + + + + + + Textbox208 + + + + + 2 + + + + + + + 0.36187cm + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + + + 6 + + + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + + + 6 + + + + + + + + + + + 0.6cm + + + + + true + true + + + + + CARR. A BAHIA DE KINO KM12 HERMOSILLO, SONORA + + + + + + + + 6 + + + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CARR. A BAHIA DE KINO KM12 HERMOSILLO, SONORA + + + + + + + + 6 + + + + + + + + + + + 0.6cm + + + + + Database + =First(Fields!ImagenByte.Value, "dsImagenes") + image/png + FitProportional + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + =Parameters!NumberSmall.Value + + + + + + + Textbox851 + + + Black + Middle + + + + + + + + true + true + + + + + =Parameters!NumberBig.Value + + + + + + + Textbox852 + + + Black + Middle + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + Database + =First(Fields!ImagenByte.Value, "dsImagenes") + image/png + FitProportional + + + + + 3 + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + =Parameters!NumberSmall.Value + + + + + + + Textbox851 + + + Black + Middle + + + + + + + + true + true + + + + + =Parameters!NumberBig.Value + + + + + + + Textbox852 + + + Black + Middle + + + + + + + + 0.30896cm + + + + + true + true + + + + + =Parameters!GTIN.Value + + + + + + + Textbox558 + + + 1pt + 1pt + + + 2 + true + + + + + + + true + true + + + + + + + + + + + + Textbox42 + + + 1pt + 1pt + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!GTIN.Value + + + + + + + Textbox558 + + + 1pt + 1pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox44 + + + 1pt + 1pt + + + + + + + + true + true + + + + + + + + + + + 1pt + 1pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + =Parameters!FormatoImpresion.Value = "Sencillas" + + + + + + =Parameters!FormatoImpresion.Value = "Sencillas" + + + + + =Parameters!FormatoImpresion.Value = "Sencillas" + + + + + =Parameters!FormatoImpresion.Value = "Sencillas" + + + + + =Parameters!FormatoImpresion.Value = "Sencillas" + + + + + + + + + + + + + + + + + + + + + + + + DataSet1 + 4.49011cm + 10.23056cm + + + + + + 1.82354in + + + + Reporte de Resumen de Indicadores + + + + <%--Tabla con los campos para filtrar--%> + + +
+
+
+ + "> + +
+
+
+ +
Fecha Inicio
+
+
+ + + + +
+ + +
+ +
Fecha Fin
+
+
+ + + + +
+ + +
+ +
SubProyecto
+
+ + +
+ +
+ +
+
+
> +
+
+ + + + + + +
+
+ + +
+
+ + Ventas por Productos +
+
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+ +
+ + +
+
+ + Ventas por Productos - Gráfica +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+ + Compras por Productos - Proveedor Productor +
+
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+ +
+ + +
+
+ + Compras por Productos - Proveedor Productor - Gráfica +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+ + Compras por Productos +
+
+
+
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+ +
+ + +
+
+ + Compras por Productos - Gráfica +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+ + Cuentas por cobrar por Cliente +
+
+
+
+
+
+ +
+
+
+ + + + + + +
+
+
+
+ +
+ + +
+
+ + Cuentas por cobrar por Cliente - Gráfica +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+ + Cuentas por pagar por Proveedor +
+
+
+
+
+
+ +
+
+
+ + + + + + +
+
+
+
+ +
+ + +
+
+ + Cuentas por pagar por Proveedor - Gráfica +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+ + + + +
+ +
+
+ +
+ + + + + + + + + + + diff --git a/General/RepIndicadorResumen.aspx.vb b/General/RepIndicadorResumen.aspx.vb new file mode 100644 index 000000000..64dd89557 --- /dev/null +++ b/General/RepIndicadorResumen.aspx.vb @@ -0,0 +1,485 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class General_RepIndicadorResumen + Inherits ClsPaginas +#Region "propiedades" + + Private Property VxP As DataTable + Get + + If ViewState("VxP") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("VxP"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("VxP") = value + End Set + End Property + Private Property CxP As DataTable + Get + + If ViewState("CxP") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("CxP"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("CxP") = value + End Set + End Property + Private Property CxP192 As DataTable + Get + + If ViewState("CxP192") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("CxP192"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("CxP192") = value + End Set + End Property + + Private Property CCxC As DataTable + Get + + If ViewState("CCxC") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("CCxC"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("CCxC") = value + End Set + End Property + Private Property CPxP As DataTable + Get + + If ViewState("CPxP") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("CPxP"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("CPxP") = value + End Set + End Property + + Private Property DtColor As DataTable + Get + + If ViewState("DtColor") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DtColor"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DtColor") = value + End Set + End Property + +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaCombos() + CargaDatos() + End If + End Sub + + + Private Sub CargaCombos() + + 'Carga SubProyectos + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + + TxtFechaI.Text = $"01/{Now.Month}/{Now.Year}" + TxtFechaF.Text = Now.ToString("dd/MM/yyyy") + + CreaDataTableColor() + End Sub + + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click + CargaDatos() + End Sub + + + Private Sub CargaDatos() + + Dim ObjVentas As New ClsVentas + Dim ObjCompras As New ClsCompras + Dim ObjMovtos As New ClsMovimientos() + + If ObjVentas.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), MinFecha, MaxFecha, -1, + -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=1) Then + VxP = ObjVentas.DtResultados + GvVxP.DataSource = VxP + Else + GvVxP.DataSource = Nothing + VxP = Nothing + End If + + If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1, + UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then + CxP192 = ObjCompras.DtResultados + GvCxP192.DataSource = CxP192 + Else + GvCxP192.DataSource = Nothing + CxP192 = Nothing + End If + + If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1, + UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=1) Then + CxP = ObjCompras.DtResultados + GvCxP.DataSource = CxP + Else + GvCxP.DataSource = Nothing + CxP = Nothing + End If + + Dim FechaCorte As String = $"31/12/{Now.Year}" + + If ObjMovtos.GetCxC(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1, + "-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + + CCxC = ObjMovtos.DtResultados + GvCCxC.DataSource = CCxC + Else + GvCCxC.DataSource = Nothing + CCxC = Nothing + End If + + If ObjMovtos.GetCxP(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1, + "-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + + CPxP = ObjMovtos.DtResultados + GvCPxP.DataSource = CPxP + Else + GvCPxP.DataSource = Nothing + CPxP = Nothing + End If + + ObjVentas.Dispose() + ObjCompras.Dispose() + ObjMovtos.Dispose() + + GvVxP.DataBind() + GvCxP192.DataBind() + GvCxP.DataBind() + GvCCxC.DataBind() + GvCPxP.DataBind() + + ' Mostrar gráficos solo si hay datos en su respectiva tabla + If GvVxP.Rows.Count > 0 Then + UPGraficaVxP.Visible = True + Else + UPGraficaVxP.Visible = False + End If + If GvCxP.Rows.Count > 0 Then + UPGraficaCxP.Visible = True + Else + UPGraficaCxP.Visible = False + End If + If GvCxP192.Rows.Count > 0 Then + UPGraficaCxP192.Visible = True + Else + UPGraficaCxP192.Visible = False + End If + If GvCCxC.Rows.Count > 0 Then + UPGraficaCCxC.Visible = True + Else + UPGraficaCCxC.Visible = False + End If + If GvCPxP.Rows.Count > 0 Then + UPGraficaCPxP.Visible = True + Else + UPGraficaCPxP.Visible = False + End If + + ' Si no había datos en ninguna tabla no cargar función de gráficos + If (GvVxP.Rows.Count = 0 AndAlso GvCxP.Rows.Count = 0 AndAlso GvCxP192.Rows.Count = 0 AndAlso GvCCxC.Rows.Count = 0 AndAlso GvCPxP.Rows.Count = 0) Then Exit Sub + GraficasPastel() + 'GraficasBarras() + End Sub + Protected Sub GvVxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVxP.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("Orden") = "" Then + e.Row.CssClass = "Totales" + End If + End If + End Sub + Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("Orden") = "" Then + e.Row.CssClass = "Totales" + End If + End If + End Sub + Protected Sub GvCCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCCxC.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("Orden") = "" Then + e.Row.CssClass = "Totales" + End If + End If + End Sub + Protected Sub GvCPxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCPxP.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("Orden") = "" Then + e.Row.CssClass = "Totales" + End If + End If + End Sub + Private Sub CreaDataTableColor() + DtColor = New DataTable + DtColor.Columns.Add("Color") + Dim RowColor As DataRow = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#FF0F00" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#FF6600" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#FF9E01" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#FCD202" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#F8FF01" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#B0DE09" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#04D215" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#0D8ECF" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#0D52D1" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#2A0CD0" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#8A0CCF" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#CD0D74" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#754DEB" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#DDDDDD" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#999999" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#333333" + DtColor.Rows.Add(RowColor) + RowColor = Nothing + RowColor = DtColor.NewRow() + RowColor("Color") = "#000000" + DtColor.Rows.Add(RowColor) + End Sub + + Private Sub GraficasPastel() + + Dim DtVxP, DtCxP, DtCxP192, DtCCxC, DtCPxP As New DataTable + Dim RowColorIndex As Integer = 0 + + 'Ventas x Producto + DtVxP.Reset() + DtVxP.Columns.Add("Texto") + DtVxP.Columns.Add("Valor") + DtVxP.Columns.Add("Color") + DtVxP.Columns.Add("Moneda") + RowColorIndex = 0 + For Each Dr As DataRow In VxP.Rows + If Not Dr("Orden").ToString = "" Then + Dim Row As DataRow = Nothing + Row = DtVxP.NewRow() + Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}" + Row("Valor") = Dr("SubTotal").ToString.FormatoNumero + Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString + Row("Moneda") = Dr("Moneda").ToString + DtVxP.Rows.Add(Row) + RowColorIndex += 1 + If RowColorIndex = 17 Then + RowColorIndex = 0 + End If + End If + Next + Dim query_vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()} + + 'Compras x Producto TipoProveedor=1 + DtCxP.Reset() + DtCxP.Columns.Add("Texto") + DtCxP.Columns.Add("Valor") + DtCxP.Columns.Add("Color") + DtCxP.Columns.Add("Moneda") + RowColorIndex = 0 + For Each Dr As DataRow In CxP.Rows + If Not Dr("Orden").ToString = "" Then + Dim Row As DataRow = Nothing + Row = DtCxP.NewRow() + Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}" + Row("Valor") = Dr("SubTotal").ToString.FormatoNumero + Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString + Row("Moneda") = Dr("Moneda").ToString + DtCxP.Rows.Add(Row) + RowColorIndex += 1 + If RowColorIndex = 17 Then + RowColorIndex = 0 + End If + End If + Next + Dim query_cxp = From s In DtCxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()} + + 'Compras x Producto ProveedorClasificacion=192 + DtCxP192.Reset() + DtCxP192.Columns.Add("Texto") + DtCxP192.Columns.Add("Valor") + DtCxP192.Columns.Add("Color") + DtCxP192.Columns.Add("Moneda") + RowColorIndex = 0 + For Each Dr As DataRow In CxP192.Rows + If Not Dr("Orden").ToString = "" Then + Dim Row As DataRow = Nothing + Row = DtCxP192.NewRow() + Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}" + Row("Valor") = Dr("SubTotal").ToString.FormatoNumero + Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString + Row("Moneda") = Dr("Moneda").ToString + DtCxP192.Rows.Add(Row) + RowColorIndex += 1 + If RowColorIndex = 17 Then + RowColorIndex = 0 + End If + End If + Next + Dim query_cxp192 = From s In DtCxP192.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()} + + 'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows)) + + 'Cuentas por cobrar x Cliente + DtCCxC.Reset() + DtCCxC.Columns.Add("Texto") + DtCCxC.Columns.Add("Valor") + DtCCxC.Columns.Add("Color") + DtCCxC.Columns.Add("Moneda") + RowColorIndex = 0 + For Each Dr As DataRow In CCxC.Rows + If Not Dr("Orden").ToString = "" Then + Dim Row As DataRow = Nothing + Row = DtCCxC.NewRow() + Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}" + Row("Valor") = Dr("Saldo").ToString.FormatoNumero + Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString + Row("Moneda") = Dr("Moneda").ToString + DtCCxC.Rows.Add(Row) + RowColorIndex += 1 + If RowColorIndex = 17 Then + RowColorIndex = 0 + End If + End If + Next + Dim query_ccxc = From s In DtCCxC.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()} + + 'Cuentas por pagar x Proveedor + DtCPxP.Reset() + DtCPxP.Columns.Add("Texto") + DtCPxP.Columns.Add("Valor") + DtCPxP.Columns.Add("Color") + DtCPxP.Columns.Add("Moneda") + RowColorIndex = 0 + For Each Dr As DataRow In CPxP.Rows + If Not Dr("Orden").ToString = "" Then + Dim Row As DataRow = Nothing + Row = DtCPxP.NewRow() + Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}" + Row("Valor") = Dr("Saldo").ToString.FormatoNumero + Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString + Row("Moneda") = Dr("Moneda").ToString + DtCPxP.Rows.Add(Row) + RowColorIndex += 1 + If RowColorIndex = 17 Then + RowColorIndex = 0 + End If + End If + Next + Dim query_cpxp = From s In DtCPxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()} + + 'Serializar datos agrupándolos en su respectivo DataTable, todos en un solo JSON + Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CxP = query_cxp, .CxP192 = query_cxp192, .CCxC = query_ccxc, .CPxP = query_cpxp}) + 'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CCxC = New String() {}}) + 'Alert(json) + RegistraScript($"CargaGraficasPastel({json})", "22") + UPPMov.Update() + End Sub + Private Sub GraficasBarras() + 'Dim Dt As New DataTable() + 'Dt.Columns.Add("Texto") + 'Dt.Columns.Add("Valor") + 'Dt.Columns.Add("Color") + 'Dt.Columns.Add("Moneda") + 'Dim RowColorIndex As Integer = 0 + 'For Each Dr As DataRow In VxC.Rows + ' If Not Dr("Orden").ToString = "" Then + ' Dim Row As DataRow = Nothing + ' Row = Dt.NewRow() + ' Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}" + ' Row("Valor") = Dr("SubTotal").ToString.FormatoNumero + ' Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString + ' Row("Moneda") = Dr("Moneda").ToString + ' Dt.Rows.Add(Row) + ' RowColorIndex += 1 + ' If RowColorIndex = 17 Then + ' RowColorIndex = 0 + ' End If + ' End If + 'Next + + 'Dim query = From s In Dt.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()} + 'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query) + 'RegistraScript($"CargaGraficasBarras({json})", "22") + 'UPPMov.Update() + End Sub +End Class diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index c2c8e6347..b5069e9dd 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -609,6 +609,12 @@ +
+ +
+ +
+
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index cbccac8d7..3b1b0db67 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1460,6 +1460,9 @@ Partial Class Inventarios_TraspasoAlmacen End Sub Private Sub CargaRecepcion() + DivRealizarDevolucion.Visible = False + ChkRealizarDevolucion.Checked = False + Dim Dtt As DataTable = Nothing FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero) @@ -1506,6 +1509,11 @@ Partial Class Inventarios_TraspasoAlmacen If UsuarioActual.TienePermisoProceso(290) Then BtnCancelarTraspaso.Visible = True End If + + If UsuarioActual.Empresa.Funcionalidad(162) = "1" Then + DivRealizarDevolucion.Visible = True + ChkRealizarDevolucion.Checked = True + End If End If @@ -1518,6 +1526,7 @@ Partial Class Inventarios_TraspasoAlmacen UpDatosRecepcion.Update() UPDivCodigoSeriePSRecepcion.Update() + UPDatosAlmacen.Update() End Sub Protected Sub GvDatosRecepcion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosRecepcion.RowDataBound @@ -1815,6 +1824,225 @@ Partial Class Inventarios_TraspasoAlmacen End Sub + Private Class MCancelacionTraspaso + Public Property TieneError As Boolean = False + Public Property MsgError As String = "" + Public Property CveMovimientoEntrada As Integer = -1 + Public Property FolioEntrada As Integer = 0 + Public Property CveMovimientoSalidaTransitorio As Integer = -1 + Public Property FolioSalidaTransitorio As Integer = 0 + End Class + + Private Function CancelarTraspaso(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, CveAlmacenDestino As Integer, Fecha As DateTime) As MCancelacionTraspaso + Dim Retorno As New MCancelacionTraspaso() + Dim ErrorMovInv As Boolean = False + Try + Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDestino, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, + Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=CveAlmacenDestino, + CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/C") + If CveMovimientoEntrada <= 0 Then + Retorno.MsgError = "No se pudo generar el movimiento" + ErrorMovInv = True + End If + + Retorno.CveMovimientoEntrada = CveMovimientoEntrada + Retorno.FolioEntrada = ObjInventario.Folio + + 'AGREGAMOS LA SALIDA + Dim CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenTransitorio, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, + Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=CveAlmacenDestino, + CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/G12") + + Retorno.CveMovimientoSalidaTransitorio = CveMovimientoSalidaTransitorio + + Dim CvePrePoliza As Integer = -1 + Dim Concepto As String = TxtObservacionesRecepcion.Text + If Concepto = "" Then Concepto = "Cancelación Traspaso" + + If Not ErrorMovInv Then + Retorno.FolioSalidaTransitorio = ObjInventario.Folio + CvePrePoliza = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If CvePrePoliza <= 0 Then + Retorno.MsgError = "No se pudo generar la Poliza para la cancelación" + ErrorMovInv = True + End If + End If + + If CveMovimientoEntrada <= 0 And Not ErrorMovInv Then + Retorno.MsgError = "No se pudo generar el movimiento de entrada correctamente" + ErrorMovInv = True + Else + Dim CveMovimientoDetalleSalida As Integer = 0 + Dim importe As Double = 0 + + Dim Dtt As DataTable = Nothing + + FolioBusqueda = TxtFolioRecepcion.Text.ToEntero + + If ObjInventario.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + Dtt = ObjInventario.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4")) + Else + Dtt = Nothing + End If + + If Dtt IsNot Nothing Then + For Each GvRow As DataRow In Dtt.Rows + Dim CvePS As Integer = GvRow("CvePS").ToString().ToEntero + 'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR + If CvePS > 0 Then + CveMovimientoDetalleSalida = GvRow("CveMovimientoDetalle").ToString.ToEntero + Dim Cantidad As Decimal = GvRow("Cantidad").ToString.ToDecimal + Dim PrecioUnitario As Decimal = GvRow("PU").ToString.ToDecimal + If CveMovimientoDetalleSalida <= 0 Then + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al guardar los movimientos de salida" + Exit For + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow("CveUM").ToString().ToEntero, CvePS, PrecioUnitario, -1, -1, Serie:=GvRow("Serie").ToString, Lote:=GvRow("Lote").ToString(), FechaCaducidad:=GvRow("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al guardar los movimientos de entrada" + Exit For + End If + 'MOV, Alm, Transito + If GvRow("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, Cantidad, GvRow("CveUM").ToString.ToEntero, CvePS, PrecioUnitario, CveSeccionAlmacen:=-3, Serie:=GvRow("Serie").ToString, Lote:=GvRow("Lote").ToString, FechaCaducidad:=GvRow("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=GvRow("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al guardar los movimientos de salida" + Exit For + End If + Else + CveMovimientoSalidaTransitorio = 0 + End If + importe += Cantidad * PrecioUnitario + End If + Next + Else + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al guardar los movimientos de salida" + End If + + + 'VIRTUAL ENTRADA + + If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then + + Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero() + Dim CveAlmacenVirtualSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenTransitorio).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero() + + 'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO + 'Dim CveAlmacenVirtual As Integer = -1 + 'If CveTipoAlmacenOrigen = 27 Then + ' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero() + 'Else + ' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero() + 'End If + + Dim CveMovimientoVirtualEntrada As Integer = -1 + Dim CveMovimientoVirtualSalida As Integer = -1 + + 'VERIFICA SI TIENE ALMACEN VIRTUAL ASIGNADA + If CveAlmacenVirtual > 0 And CveAlmacenVirtualSalida > 0 Then + + Dim dtvirtual As DataTable = Nothing + Dim importePoliza As Decimal = 0 + + If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoSalida) Then + dtvirtual = ObjInventario.DtResultados + If dtvirtual.Rows.Count > 0 Then + + CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/C2") + + CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalidaTransitorio, Modulo:="TA/C3") + + Dim FolioVirtualEntrada = ObjInventario.Folio + + For Each RowVirtual As DataRow In dtvirtual.Rows + Dim CvePS = RowVirtual("CvePS").ToString().ToEntero() + Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal() + Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal() + Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero() + Dim CostoIndirecto As Decimal = RowVirtual("CostoIndirecto").ToString().ToDecimal() + + + importePoliza = importePoliza + (CantidadUsado * PU) + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For + End If + + Next + End If + + 'Else + ' TextoError = "No se pudo registrar el movimiento virtual" + ' ErrorMovInv = True + End If + + + If Not ErrorMovInv AndAlso (CveMovimientoSalida > 0 And CveMovimientoVirtualEntrada > 0) Then + + Dim CvePrePolizaMovVirtual As Integer = ObjConta.AddPrePolizas("TA/C2|TA/C3", 53, importePoliza, importePoliza, 1, TxtFecha.Text.ToDate, "TA/C2|TA/C3", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CvePrePolizaMovVirtual > 0 Then + If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaMovVirtual, True, importePoliza, importePoliza, 68, TxtObservacionesRecepcion.Text, TxtObservacionesRecepcion.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoVirtualSalida, Contabilizable:=False) Then + ErrorMovInv = True + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaMovVirtual, False, importePoliza, importePoliza, 68, TxtObservacionesRecepcion.Text, TxtObservacionesRecepcion.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, Contabilizable:=False) Then + ErrorMovInv = True + End If + Else + ErrorMovInv = True + End If + + End If + 'Else + ' TextoError = "La Sucursal no tiene creado un almacen virtual" + ' ErrorMovInv = True + End If + + End If + + If Not ErrorMovInv Then + Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundAD + Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, + CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al cancelar el traspaso" + End If + + If CveMovimientoSalidaTransitorio > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, + CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al cancelar el traspaso" + End If + End If + + End If + + End If + + Catch ex As Exception + ErrorMovInv = True + Retorno.MsgError = "Ocurrió un error al cancelar el traspaso" + OnError("Ocurrió un erro al cancelar el traspaso", ex) + End Try + + Retorno.TieneError = ErrorMovInv + + Return Retorno + End Function + Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs) If GvDatosRecepcion.Rows.Count > 0 Then 'Valida Movimientos @@ -2039,6 +2267,13 @@ Partial Class Inventarios_TraspasoAlmacen End If End If + Dim CancelacionTraspaso As MCancelacionTraspaso = Nothing + If UsuarioActual.Empresa.Funcionalidad(162) = "1" AndAlso ChkRealizarDevolucion.Checked AndAlso Not ErrorMovInv Then + CancelacionTraspaso = CancelarTraspaso(ObjInventario, ObjConta, GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, TxtFechaRecepcion.Text.ToDateTime()) + If CancelacionTraspaso IsNot Nothing Then + ErrorMovInv = CancelacionTraspaso.TieneError + End If + End If If Not ErrorMovInv Then @@ -2053,6 +2288,9 @@ Partial Class Inventarios_TraspasoAlmacen Mensaje.AppendFormat("
Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()' If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("


Folio Virtual {2}
Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()' + If CancelacionTraspaso IsNot Nothing Then + If CancelacionTraspaso.CveMovimientoEntrada > 0 Then Mensaje.AppendFormat("


Folio Devolución {2}
Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CancelacionTraspaso.CveMovimientoEntrada)), CancelacionTraspaso.CveMovimientoEntrada, CancelacionTraspaso.FolioEntrada) 'onclick='ImprimirTraslado()' + End If Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) diff --git a/Nomina/RepFiniquito.aspx b/Nomina/RepFiniquito.aspx new file mode 100644 index 000000000..a45ba461e --- /dev/null +++ b/Nomina/RepFiniquito.aspx @@ -0,0 +1,140 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepFiniquito.aspx.cs" Inherits="Nomina_RepFiniquito" %> + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+ + + +
+ + + + + + + +
+ +
+
+
+ + + + + + + + +
+
+
+ +
+
+
+ + + + + + + + +
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/Nomina/RepFiniquito.aspx.cs b/Nomina/RepFiniquito.aspx.cs new file mode 100644 index 000000000..4c0d7a710 --- /dev/null +++ b/Nomina/RepFiniquito.aspx.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Nomina_RepFiniquito : ClsPaginas +{ + #region Propiedades + private int RcveEstatusFiniquito + { + get { return (ViewState["RcveEstatusFiniquito"] == null) ? 0 : Convert.ToInt32(ViewState["RcveEstatusFiniquito"]); } + set { ViewState["RcveEstatusFiniquito"] = value; } + } + private int RcveSubProyecto + { + get { return (ViewState["RcveSubProyecto"] == null) ? 0 : Convert.ToInt32(ViewState["RcveSubProyecto"]); } + set { ViewState["RcveSubProyecto"] = value; } + } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + RcveEstatusFiniquito = Request["cveEstatusFiniquito"] == null ? 0 : Request["cveEstatusFiniquito"].ToString().ToEntero(); + RcveSubProyecto = Request["cveSubProyecto"] == null ? 0 : Request["cveSubProyecto"].ToString().ToEntero(); + + + CargaRepFiniquitos(); + } + } + + protected void CargaRepFiniquitos() + { + ClsNominas ObjRepF = new ClsNominas(); + ObjRepF.RepFiniquitos(RcveSubProyecto, RcveEstatusFiniquito, UsuarioActual.CveEmpresa, "",""); + GVRepFiniquitos.DataSource = ObjRepF.DtResultados; + ObjRepF.Dispose(); + GVRepFiniquitos.DataBind(); + upDatosRepF.Update(); + } + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaRepFiniquitos(); + } +} diff --git a/RH/Asistencias.aspx b/RH/Asistencias.aspx index 332d945fe..93e67ba2d 100644 --- a/RH/Asistencias.aspx +++ b/RH/Asistencias.aspx @@ -175,7 +175,7 @@ 3  -  Se registró asistencia y fue modificada +  Se registró asistencia y fue modificada diff --git a/RH/Asistencias.aspx.vb b/RH/Asistencias.aspx.vb index 363c8f057..3a5c22951 100644 --- a/RH/Asistencias.aspx.vb +++ b/RH/Asistencias.aspx.vb @@ -211,8 +211,8 @@ Partial Class RH_Asistencias e.Row.Cells(0).BackColor = Drawing.Color.LightBlue e.Row.Cells(1).BackColor = Drawing.Color.LightBlue ElseIf e.Row.DBCampo("SeModifico") = "1" Then - e.Row.Cells(0).ForeColor = Drawing.Color.Red - e.Row.Cells(1).ForeColor = Drawing.Color.Red + e.Row.Cells(0).BackColor = Drawing.Color.FromArgb(242, 222, 222) '"#f2dede" 'Drawing.Color.Red + e.Row.Cells(1).BackColor = Drawing.Color.FromArgb(242, 222, 222) 'Drawing.Color.Red End If End If diff --git a/Ventas/RepVentasResumen.aspx.vb b/Ventas/RepVentasResumen.aspx.vb index 87e2f0f68..13b684f15 100644 --- a/Ventas/RepVentasResumen.aspx.vb +++ b/Ventas/RepVentasResumen.aspx.vb @@ -73,8 +73,6 @@ Partial Class Ventas_RepVentasResumen CargaCombos() CargaDatos() - GraficaPastel() - GraficaBarras() End If End Sub @@ -142,19 +140,16 @@ Partial Class Ventas_RepVentasResumen Datos = Nothing End If + ObjVentas.Dispose() + ObjMovtos.Dispose() GvVxP.DataBind() GvVxC.DataBind() GvPxC.DataBind() GvCxC.DataBind() - ObjVentas.Dispose() - ObjMovtos.Dispose() - - GvVxP.Dispose() - GvVxC.Dispose() - GvPxC.Dispose() - GvCxC.Dispose() + GraficaPastel() + GraficaBarras() End Sub Protected Sub GvVxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVxP.RowDataBound diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index ede09d720..af25c390a 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1415,6 +1415,29 @@
+ + + + + + + + + + + + + + + + +
Descuento Adicional Por Pago: +   +
Total Original: +   +
Total a Pagar: +   +
@@ -2458,127 +2481,127 @@
- - - -
- -
- -
- -
- -
-
-
-
- -
-
- - -
-
-
- -
- -
- -
- -
-
-
-
- - -
-
Nombre:
-
- -
-
-
-
Calle:
-
- -
-
Núm.
-
- -
-
CP.
-
- -
-
-
-
Pais:
-
- - -
-
Estado:
-
- - -
-
-
-
Municipio:
-
- - -
-
Colonia:
-
- - -
-
-
-
+ + +
+ +
+ +
+ +
+ +
-
-
-
- Convertir a unidad Aduana +
+
+ +
+
+ + +
+
+
+ <%-- +
+ +
--%> + +
+ +
+
+
+
+ + +
+
Nombre:
+
+ +
+
+
+
Calle:
+
+ +
+
Núm.
+
+ +
+
CP.
+
+ +
+
+
+
Pais:
+
+ + +
+
Estado:
+
+ + +
+
+
+
Municipio:
+
+ + +
+
Colonia:
+
+ + +
+
+
+
+ +
+
+
+
+ Convertir a unidad Aduana - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-
- - + +
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 350a63a20..c60c002ed 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2407,7 +2407,7 @@ Partial Class Ventas UpFacturar.Update() 'CargaTiposDocumentos() TrEmitir.Visible = False - If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83) Then + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83, 172, 173) Then DivCartaPorte.Visible = True End If ViewState("EstablecioFolio") = False @@ -5999,6 +5999,21 @@ Partial Class Ventas DdlFormaCliente.DataBind() DdlMetodoCliente.DataSource = GlobalDTVtaMetodoPago DdlMetodoCliente.DataBind() + + If 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") + + If RowDescuentos IsNot Nothing Then + LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2) + CalculaTotalesVenta() + End If + Else + LblDescuentoAdicional.Text = "0.00" + End If + UpPS.Update() + End If 'End If End Sub Private Sub CargaUsoCFDI() @@ -6458,9 +6473,9 @@ Partial Class Ventas End If If ObjCliente.AplicaComercioExterior Then - DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado - DdlSATMotivoTraslado.DataBind() - DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado) + 'DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado + 'DdlSATMotivoTraslado.DataBind() + 'DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado) DdlIncoterm.Items.Clear() DdlIncoterm.DataSource = GlobalDTIncoterm() DdlIncoterm.DataBind() @@ -7333,7 +7348,9 @@ Partial Class Ventas LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString() 'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString() LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString() - LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString() + If Not UsuarioActual.Empresa.Funcionalidad(350) = "1" Then + LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString() + End If ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString() ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString() ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString() @@ -8592,7 +8609,6 @@ Partial Class Ventas #End Region #Region " EMITIR IMPRIMIR - GUARDAR " - Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click Try EmitirImprimir() @@ -9219,11 +9235,12 @@ Partial Class Ventas Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta)) Dim ArchivoSti2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta)) + Dim ArchivoSti3 As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta)) LnkImprimir.Visible = False 'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then - If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then + If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then HplDownPDF.Visible = True HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))) If UsuarioActual.CveRol = 1 Then @@ -9253,10 +9270,8 @@ Partial Class Ventas Exit Sub End If - CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo) - 'Verifica versión 3.3.() - If ObjFactura.Version = "3.3" AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then + If (Not UsuarioActual.Empresa.Funcionalidad(350) = "1") AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ") If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then Dim str As New StringBuilder @@ -9288,6 +9303,40 @@ Partial Class Ventas End If End If + 'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT + If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then + TmpDTError = TmpDT.Copy() + End If + + If 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") + + If RowDescuentos IsNot Nothing Then + + Dim Row As DataRow = RowDescuentos(0) + Row("Descuento") = Row("Descuento").ToString().ToDecimal() + TotalDescuento + + Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal() * Row("PU").ToString().ToDecimal()) - Row("Descuento").ToString().ToDecimal() + Row("ImporteIVA") = (TotalCalculableImpuestos * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2) + + CalculaTotalesVenta(RecalcularTotalOriginal:=False) + + 'UpPS.Update() + 'VALIDA EL CALCULO DE LOS DESCUENTOS + If (LblTotalOriginal.Text.ToDecimal() - LblDescuentoAdicional.Text.ToDecimal()) <> TxtTotal.Text.ToDecimal() Then + TmpDT = TmpDTError.Copy() + CalculaTotalesVenta(RecalcularTotalOriginal:=False) + Alert("Ocurrió un error al procesar los datos de la Venta. Los descuentos no coinciden con el importe final", TipoMensaje.MsgError) + Exit Sub + End If + End If + End If + End If + + CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo) + If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError) ObjFactura = Nothing @@ -10173,6 +10222,7 @@ Partial Class Ventas MensajeAlert = Nothing If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() TmpDT = TmpDTError.Copy + CalculaTotalesVenta(RecalcularTotalOriginal:=False) Else ObjVentas.RollBack() @@ -10196,7 +10246,7 @@ Partial Class Ventas MensajeAlert = Nothing If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() TmpDT = TmpDTError.Copy - + CalculaTotalesVenta(RecalcularTotalOriginal:=False) End If ObjFactura = Nothing ListaNotasCreditoGeneradas = Nothing @@ -12232,115 +12282,116 @@ Partial Class Ventas i += 1 Next - Dim AplicaComercioExteriorSubProyecto As Boolean + Dim AplicaComercioExteriorSubProyecto As Boolean = True If ChkEmitirComercioExterior.Checked Then - AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False) + 'AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False) Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto - If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then - 'DATOS GENERALES + 'DATOS GENERALES - Timbre.Comprobante.Exportacion = "02" - Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString() - Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString() - Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0" - Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}") - Timbre.Complementos.ComercioExterior11.Subdivision = "0" + Timbre.Comprobante.Exportacion = "02" + Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString() + Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString() + Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0" + Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}") + Timbre.Complementos.ComercioExterior11.Subdivision = "0" - Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio) - If Timbre.Comprobante.TipoComprobante = "T" Then - Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}") - Else - Timbre.Complementos.ComercioExterior11.MotivoTraslado = "" - End If + Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio) - 'EMISOR - Dim Dr As DataRow - Dr = Nothing - If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then - Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0) - End If - Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP - Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.Localidad = "" - Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString() - Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString() + Timbre.Complementos.ComercioExterior11.MotivoTraslado = "" - Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String - ComExtColonia = "" : ComExtMunicipio = "" - ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}") - ComExtCalle = TxtComExtCalle.Text.Trim - ComExtNumero = TxtComExtNumero.Text.Trim - ComExtCP = TxtComExtCP.Text.Trim + 'If Timbre.Comprobante.TipoComprobante = "T" Then + ' Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}") + 'Else + ' Timbre.Complementos.ComercioExterior11.MotivoTraslado = "" + 'End If - If ComExtPais = "MEX" Then + 'EMISOR + Dim Dr As DataRow + Dr = Nothing + If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then + Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0) + End If + Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP + Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.Localidad = "" + Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString() + Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString() + + Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String + ComExtColonia = "" : ComExtMunicipio = "" + ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}") + ComExtCalle = TxtComExtCalle.Text.Trim + ComExtNumero = TxtComExtNumero.Text.Trim + ComExtCP = TxtComExtCP.Text.Trim + + If ComExtPais = "MEX" Then + ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}") + ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}") + ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "") + Else + If ComExtPais.Contiene("USA", "CAN") Then ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}") - ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}") - ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "") Else - If ComExtPais.Contiene("USA", "CAN") Then - ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}") - Else - ComExtEstado = TxtComExtEstado.Text.Trim - End If - ComExtMunicipio = TxtComExtMunicipio.Text.Trim - ComExtColonia = TxtComExtColonia.Text.Trim + ComExtEstado = TxtComExtEstado.Text.Trim End If + ComExtMunicipio = TxtComExtMunicipio.Text.Trim + ComExtColonia = TxtComExtColonia.Text.Trim + End If - 'RECEPTOR - Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR - Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle - Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero - Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = "" - Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia - Timbre.Complementos.ComercioExterior11.Receptor.Localidad = "" - Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal - Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio - Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP - Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado - Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais - Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais - Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib + 'RECEPTOR + Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR + Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle + Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero + Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = "" + Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia + Timbre.Complementos.ComercioExterior11.Receptor.Localidad = "" + Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal + Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio + Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP + Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado + Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais + Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais + Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib - 'DESTINATARIO - Timbre.Complementos.ComercioExterior11.Destinatario = Nothing + 'DESTINATARIO + Timbre.Complementos.ComercioExterior11.Destinatario = Nothing - 'Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim - 'Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle - 'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero - 'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = "" - 'Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia - 'Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = "" - 'Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal - 'Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio - 'Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP - 'Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado - 'Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais - 'Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim + 'Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim + 'Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle + 'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero + 'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = "" + 'Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia + 'Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = "" + 'Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal + 'Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio + 'Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP + 'Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado + 'Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais + 'Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim - 'MERCANCIAS - For Each Gvr As GridViewRow In GvComercioExterior.Rows - Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal, + 'MERCANCIAS + For Each Gvr As GridViewRow In GvComercioExterior.Rows + Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal, .FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(), .UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(), .ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2), .ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, .NoIdentificacion = Gvr.DataKey("Codigo")} - If Gvr.FCTextBox("TxtMarca").Text <> "" Then - mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text - End If + If Gvr.FCTextBox("TxtMarca").Text <> "" Then + mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text + End If - Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia) - i += 1 - Next - End If + Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia) + i += 1 + Next Else @@ -17785,7 +17836,7 @@ Partial Class Ventas End If 'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS - If Not UsuarioActual.Empresa.Funcionalidad(524) <> "" Then + If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0) If DrPS IsNot Nothing Then @@ -18004,6 +18055,12 @@ Partial Class Ventas ObjDescuento.ImporteDescuento = 0 Return ObjDescuento End If + + If 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 + End If End If Dim dr As DataRow = Nothing @@ -19276,7 +19333,7 @@ Partial Class Ventas ConfiguraTipoDocto() End If End Sub - Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False) + Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False, Optional RecalcularTotalOriginal As Boolean = True) Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte") Dim TotalSubTotalRef As Decimal = TotalSubTotal @@ -19381,6 +19438,12 @@ Partial Class Ventas LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero + If RecalcularTotalOriginal Then + LblTotalOriginal.Text = (TxtTotal.Text.ToDecimal()).FormatoNumero + End If + + LblTotalAPagarAdicional.Text = (LblTotalOriginal.Text.ToDecimal() - LblDescuentoAdicional.Text.ToDecimal()).FormatoNumero + LblAmort.Text = TxtSubTotal.Text If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then HdnVentaSaldo.Value = Total.ToString() @@ -22106,6 +22169,9 @@ Partial Class Ventas Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString() + LblDescuentoAdicional.Text = "0.00" + CalculaTotalesVenta() + CargaGridContado() UpContado.Update() End Sub @@ -22357,6 +22423,40 @@ Partial Class Ventas End If End If + Dim VieneDeCotizacion As Boolean = False + If DtCotizacionesPS IsNot Nothing AndAlso DtCotizacionesPS.Rows.Count > 0 Then + 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 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") + + If RowDescuentos IsNot Nothing Then + LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2) + + 'Dim Row As DataRow = RowDescuentos(0) + 'Row("Descuento") = Row("Descuento").ToString().ToDecimal() + TotalDescuento + + 'Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal() * Row("PU").ToString().ToDecimal()) - Row("Descuento").ToString().ToDecimal() + 'Row("ImporteIVA") = (TotalCalculableImpuestos * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2) + + 'BtnAgregarPago.Enabled = False + + CalculaTotalesVenta() + + Dim RowPago = DtPagos.Rows(0) + RowPago("Importe") = LblTotalAPagarAdicional.Text.ToDecimal() + + + End If + Else + LblDescuentoAdicional.Text = "0.00" + End If + UpPS.Update() + End If + CargaGridContado() UpContado.Update() @@ -22395,7 +22495,7 @@ Partial Class Ventas If (Not PermiteCredito OrElse RBLPago.SelectedValue = "2") AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC - If TotalPago <> TxtTotal.Text.ToDecimal Then + If TotalPago <> (TxtTotal.Text.ToDecimal - LblDescuentoAdicional.Text.ToDecimal()) Then If MostrarAlertas Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) End If @@ -29516,7 +29616,8 @@ Partial Class Ventas Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal) Dim Total As Decimal = (Cantidad * PU) Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento - Dim ImporteIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal + Dim TotalCalculableImpuestosIVA = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal) + Dim ImporteIVA As Decimal = TotalCalculableImpuestosIVA * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal @@ -35570,6 +35671,9 @@ Partial Class Ventas Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs) If CveVenta <= 0 OrElse EsCreaApartirDe Then + + ViewState("AplicaComercioExterior") = ChkEmitirComercioExterior.Checked + If ChkEmitirComercioExterior.Checked Then DdlMoneda.SelectedValueExist("2") CambiaMoneda() diff --git a/vwd.webinfo b/vwd.webinfo deleted file mode 100644 index d54ddc206..000000000 --- a/vwd.webinfo +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file
Descuentos RNC: