This commit is contained in:
rakcsle
2021-07-29 11:43:24 -07:00
6 changed files with 89 additions and 45 deletions

View File

@@ -58,7 +58,7 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
<asp:TextBox ID="hdnTotal" runat="server" Style="text-align: right; display: none;" AutoComplete="off" Width="145px"></asp:TextBox>
<hr /> <hr />
<div class="row" id="divTipoDevolucion" runat="server" visible="false" style="margin-top: -20px;"> <div class="row" id="divTipoDevolucion" runat="server" visible="false" style="margin-top: -20px;">
<div class="col-md-12"> <div class="col-md-12">
@@ -333,8 +333,9 @@
} else { } else {
txt.value = ""; txt.value = "";
} }
let valor = FormatoNumero(SumaValores(), 2);
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2); $('#hdnTotal').val(valor);
$get('TxtImporte').value = valor;
} }
@@ -353,7 +354,9 @@
} }
} }
var Suma = SumaValores(); var Suma = SumaValores();
$get('TxtImporte').value = FormatoNumero(Suma, 2); let valor = FormatoNumero(SumaValores(), 2);
$('#C_hdnTotal').val(valor);
$get('TxtImporte').value = valor;
if ($get('TxtTotal') != null) { if ($get('TxtTotal') != null) {
$get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtComisiones').value * -1)), 2); $get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtComisiones').value * -1)), 2);

View File

@@ -344,12 +344,26 @@ public partial class Bancos_Devoluciones : ClsPaginas
return; return;
} }
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2 && TxtValor.Text == "") if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2)
{ {
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia); if (TxtValor.Text == "")
return; {
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia);
return;
}
else
{
int valor = (TxtValor.Text.ToEntero() * TxtVecesAplicar.Text.ToEntero()).ToEntero();
int total = hdnTotal.Text.ToEntero();
if (valor <> total)
{
Alert("La cantidad total debe ser igual a lo seleccionado");
}
}
} }
ClsBancos ObjIE = new ClsBancos(); ClsBancos ObjIE = new ClsBancos();
ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL()); ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL());
ClsCompras ObjComp = new ClsCompras(ObjIE.IniciaTransacSQL()); ClsCompras ObjComp = new ClsCompras(ObjIE.IniciaTransacSQL());

View File

@@ -183,20 +183,26 @@ Partial Class Contabilidad_ContabilidadElectronica
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, "0"c), DdlEjercicio.SelectedValue).ToDate Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, "0"c), DdlEjercicio.SelectedValue).ToDate
Dim FechaF = FechaI.LastDayOfMonth Dim FechaF = FechaI.LastDayOfMonth
Dim DtCuentas As New DataTable Dim DtCuentas As New DataTable
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim ObjConpaq As New ClsContPAQi(UsuarioActual.Empresa) Dim objconta As New ClsContabilidad
If ObjConpaq.GetBalanzaElectronica(FechaI, FechaF) Then If objconta.GetBalanzaComprobacion(FechaI, FechaF, UsuarioActual.CveEmpresa) Then
DtCuentas = ObjConpaq.DtResultados DtCuentas = objconta.DtResultados
End If
objconta.Dispose()
Else
Dim ObjConpaq As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConpaq.GetBalanzaElectronica(FechaI, FechaF) Then
DtCuentas = ObjConpaq.DtResultados
End If
ObjConpaq.Dispose()
End If End If
ObjConpaq.Dispose()
If DtCuentas IsNot Nothing AndAlso DtCuentas.Rows.Count > 0 Then If DtCuentas IsNot Nothing AndAlso DtCuentas.Rows.Count > 0 Then
Dim Str As New StringBuilder Dim Str As New StringBuilder
'CABECERA 'CABECERA
Str.Append("<?xml version=""1.0"" encoding=""UTF-8""?>") Str.Append("<?xml version=""1.0"" encoding=""UTF-8""?>")
Str.Append("<BCE:Balanza xsi:schemaLocation=""www.sat.gob.mx/esquemas/ContabilidadE/1_1/BalanzaComprobacion BalanzaComprobacion_1_1.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" Version=""1.1"" ") Str.Append("<BCE:Balanza xsi:schemaLocation=""www.sat.gob.mx/esquemas/ContabilidadE/1_1/BalanzaComprobacion/BalanzaComprobacion_1_1.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" Version=""1.1"" ")
Str.AppendFormat("RFC=""{0}"" ", UsuarioActual.Empresa.RFC) Str.AppendFormat("RFC=""{0}"" ", UsuarioActual.Empresa.RFC)
Str.AppendFormat("Mes=""{0}"" ", DdlPeriodo.SelectedValue) Str.AppendFormat("Mes=""{0}"" ", DdlPeriodo.SelectedValue)
Str.AppendFormat("Anio=""{0}"" ", DdlEjercicio.SelectedValue) Str.AppendFormat("Anio=""{0}"" ", DdlEjercicio.SelectedValue)
@@ -212,11 +218,11 @@ Partial Class Contabilidad_ContabilidadElectronica
'DETALLES 'DETALLES
For Each Dr As DataRow In DtCuentas.Rows For Each Dr As DataRow In DtCuentas.Rows
Str.Append("<BCE:Ctas ") Str.Append("<BCE:Ctas ")
Str.AppendFormat("NumCta=""{0}"" ", Dr("NumCta")) Str.AppendFormat("NumCta=""{0}"" ", Dr("NumCta").ToString)
Str.AppendFormat("SaldoIni=""{0}"" ", Dr("SaldoIni")) Str.AppendFormat("SaldoIni=""{0}"" ", Dr("SaldoIni").ToString)
Str.AppendFormat("Debe=""{0}"" ", Dr("Debe")) Str.AppendFormat("Debe=""{0}"" ", Dr("Debe").ToString)
Str.AppendFormat("Haber=""{0}"" ", Dr("Haber")) Str.AppendFormat("Haber=""{0}"" ", Dr("Haber").ToString)
Str.AppendFormat("SaldoFin=""{0}"" ", Dr("SaldoFin")) Str.AppendFormat("SaldoFin=""{0}"" ", Dr("SaldoFin").ToString)
Str.Append("/>") Str.Append("/>")
Next Next
@@ -225,7 +231,6 @@ Partial Class Contabilidad_ContabilidadElectronica
'FIN 'FIN
Str.Append("</BCE:Balanza>") Str.Append("</BCE:Balanza>")
'GUARDA ARHIVO 'GUARDA ARHIVO
ArchivoBalanza = Server.MapPath(String.Format("~/Empresas/{0}/ContabilidadElectronica/{1}{2}{3}BN.xml", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.RFC, DdlEjercicio.SelectedValue, DdlPeriodo.SelectedValue.PadLeft(2, "0"c))) ArchivoBalanza = Server.MapPath(String.Format("~/Empresas/{0}/ContabilidadElectronica/{1}{2}{3}BN.xml", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.RFC, DdlEjercicio.SelectedValue, DdlPeriodo.SelectedValue.PadLeft(2, "0"c)))

View File

@@ -369,9 +369,14 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIFD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIFD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
<div style="display: inline-block;" id="SumFiltra"></div> <div style="display: inline-block;" id="SumFiltra"></div>
</div> </div>
<asp:GridView ID="GvIFD" ClientIDMode="Static" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveInventarioFisicoDetalle, CvePS, SerieLote, Lote, FechaCaducidad, Cantidad, CveUnidadMedida" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall"> <asp:GridView ID="GvIFD" ClientIDMode="Static" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveInventarioFisicoDetalle, CvePS, SerieLote, Lote, FechaCaducidad, Cantidad, CveUnidadMedida, AplicaSerie, AplicaLote, AplicaCaducidad" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall">
<Columns> <Columns>
<asp:BoundField HeaderText="Fecha" DataField="FechaInvFisico" DataFormatString="{0:g}"></asp:BoundField> <asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal runat="server" ID="ltlFecha" Text='<%#Eval("FechaInvFisico")%>'></asp:Literal>
</ItemTemplate>
<HeaderStyle Width="160px"/>
</asp:TemplateField>
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left"></asp:BoundField> <asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left"></asp:BoundField> <asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left"></asp:BoundField> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
@@ -380,15 +385,15 @@
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField> <asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false" DataFormatString="{0:d}"></asp:BoundField> <asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false" DataFormatString="{0:d}"></asp:BoundField>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField> <asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center"> <asp:BoundField HeaderText="Mal Estado" DataField="MalEstado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<ItemTemplate> <asp:BoundField HeaderText="No Vendible" DataField="NoVendible" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate> <asp:TemplateField HeaderText="Comandos" ItemStyle-HorizontalAlign="Center">
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Estas seguro que desea eliminar el registro?" data-btn-ok-label="si" /> <asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Estas seguro que desea eliminar el registro?" data-btn-ok-label="si" />
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Center"/>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -296,10 +296,14 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim Inventario As New ClsInventarios Dim Inventario As New ClsInventarios
If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
If Inventario.DtResultados.Rows.Count > 0 Then If Inventario.DtResultados.Rows.Count > 0 Then
GvIFD.Columns(1).Visible = Inventario.DtResultados.MAX("CodigoBarras") <> ""
GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0 GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0
GvIFD.Columns(5).Visible = Inventario.DtResultados.MAX("SerieLote") <> "" GvIFD.Columns(5).Visible = Inventario.DtResultados.MAX("SerieLote") <> ""
GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> "" GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> ""
GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha
GvIFD.Columns(9).Visible = Inventario.DtResultados.MAX("MalEstado", "MalEstado IS NOT NULL").ToEntero > 0
GvIFD.Columns(10).Visible = Inventario.DtResultados.MAX("NoVendible", "NoVendible IS NOT NULL").ToEntero > 0
GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable
Else Else
GvIFD.DataSource = Nothing GvIFD.DataSource = Nothing
@@ -648,15 +652,19 @@ Partial Class Inventarios_InventarioFisicoDetalle
Private Sub LnkExcelUniverso_Click(sender As Object, e As EventArgs) Handles LnkExcelUniverso.Click Private Sub LnkExcelUniverso_Click(sender As Object, e As EventArgs) Handles LnkExcelUniverso.Click
Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder
Dim ObjInventario As New ClsInventarios Dim ObjInventario As New ClsInventarios
Dim DtPS As DataTable
If ObjInventario.GetInventarioFisicoUniversoProductos(CveInventarioFisico, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInventarioFisicoUniversoProductos(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
DtPS = ObjInventario.DtResultados.FiltraParametros("", "", {"Codigo", "PS", "Clasificacion", "RazonSocial"})
Else
Alert("Error al consultar la informacion")
End If
End If End If
Dim NombreArchivo As String Dim NombreArchivo As String
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim workbook As New ExcelFile() Dim workbook As New ExcelFile()
Dim worksheet = workbook.Worksheets.Add("Productos") Dim worksheet = workbook.Worksheets.Add("Productos")
worksheet.InsertDataTable(ObjInventario.DtResultados, New InsertDataTableOptions() With worksheet.InsertDataTable(DtPS, New InsertDataTableOptions() With
{ {
.ColumnHeaders = True, .ColumnHeaders = True,
.StartRow = 0, .StartRow = 0,
@@ -726,9 +734,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
HfCvePS.Value = GvRow.DataKey("CvePS").ToString HfCvePS.Value = GvRow.DataKey("CvePS").ToString
HfCveUM.Value = GvRow.DataKey("CveUnidadMedida").ToString HfCveUM.Value = GvRow.DataKey("CveUnidadMedida").ToString
TxtSerieLote.Text = GvRow.DataKey("SerieLote").ToString TxtSerieLote.Text = If(Convert.ToBoolean(GvRow.DataKey("AplicaSerie").ToString), GvRow.DataKey("SerieLote").ToString, "")
TxtLoteEdit.Text = GvRow.DataKey("Lote").ToString TxtLoteEdit.Text = If(Convert.ToBoolean(GvRow.DataKey("AplicaLote").ToString), GvRow.DataKey("Lote").ToString, "")
TxtFechaCaducida.Text = GvRow.DataKey("FechaCaducidad").ToString TxtFechaCaducida.Text = If(Convert.ToBoolean(GvRow.DataKey("AplicaCaducidad").ToString), If(GvRow.DataKey("FechaCaducidad").ToString <> "", GvRow.DataKey("FechaCaducidad").ToString.ToDate.ToShortDateString, ""), "")
TxtSerieLote.Enabled = Convert.ToBoolean(GvRow.DataKey("AplicaSerie").ToString)
TxtLoteEdit.Enabled = Convert.ToBoolean(GvRow.DataKey("AplicaLote").ToString)
TxtFechaCaducida.Enabled = Convert.ToBoolean(GvRow.DataKey("AplicaCaducidad").ToString)
TxtCantidad.Text = GvRow.DataKey("Cantidad").ToString TxtCantidad.Text = GvRow.DataKey("Cantidad").ToString
UpEditarPS.Update() UpEditarPS.Update()

View File

@@ -2110,14 +2110,16 @@ Partial Class OC
DrPSValidar("Cantidad") = TxtCant.Text.Trim.ToDecimal DrPSValidar("Cantidad") = TxtCant.Text.Trim.ToDecimal
DrPSValidar("PU") = txtPrecioUnitario.Text.Trim.ToDecimal DrPSValidar("PU") = txtPrecioUnitario.Text.Trim.ToDecimal
dttemp.Rows.Add(DrPSValidar) dttemp.Rows.Add(DrPSValidar)
If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then
Dim dtPSInvalidos As String = ValidarPSContrato(dttemp) Dim dtPSInvalidos As String = ValidarPSContrato(dttemp)
If dtPSInvalidos <> "" Then If dtPSInvalidos <> "" Then
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia) Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If
End If End If
If DtDetalle IsNot Nothing Then If DtDetalle IsNot Nothing Then
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("") Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("")
If DrPS Is Nothing Then If DrPS Is Nothing Then
@@ -2485,12 +2487,15 @@ Partial Class OC
TieneError = True TieneError = True
End If End If
Dim dtPSInvalidos As String = ValidarPSContrato(DtDetalle.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"})) If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then
If dtPSInvalidos <> "" Then Dim dtPSInvalidos As String = ValidarPSContrato(DtDetalle.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"}))
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia) If dtPSInvalidos <> "" Then
TieneError = True Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
TieneError = True
End If
End If End If
Return TieneError Return TieneError
End Function End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click