Cambios GlobalDTSubPoryecto

Cambio GlobalDTUsuario
This commit is contained in:
2024-08-01 05:49:07 -07:00
30 changed files with 3675 additions and 1988 deletions

View File

@@ -11,7 +11,7 @@
width: 200px;
}
.btn-xs {
.btn-xs {
padding: 0px 5px;
}
@@ -200,9 +200,9 @@
<li>
<asp:LinkButton ID="LkbRetiro" runat="server" OnClick="LkbRetiro_Click" Visible="false"> <i class="fa fa-ad-excel"></i> Retiro de Efectivo</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkCobrosEnTranscurso" runat="server" OnClick="LnkCobrosEnTranscurso_Click"><i class="fa fa-money"></i> Cobros en Transcurso</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkCobrosEnTranscurso" runat="server" OnClick="LnkCobrosEnTranscurso_Click"><i class="fa fa-money"></i> Cobros en Transcurso</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
@@ -273,13 +273,13 @@
</div>
<div class="portlet-body" style="display: none;">
<div class="row">
<div class="col-md-1">
Solo pagadas:
</div>
<div class="col-md-1" style="padding-top:6px">
<asp:CheckBox ID="ChkMostrarSoloPagados" CssClass="chksino" runat="server" Text="Ver Solo pagadas" />
</div>
<div class="col-md-1" style="padding-top: 6px">
<asp:CheckBox ID="ChkMostrarSoloPagados" CssClass="chksino" runat="server" Text="Ver Solo pagadas" />
</div>
</div>
</div>
</div>
@@ -335,13 +335,18 @@
<div class="col-md-1"><b>Folio:</b></div>
<div class="col-md-2">&nbsp;<label><asp:Literal ID="LtlFolio" runat="server"></asp:Literal></label>&nbsp;</div>
<div class="col-md-1"><b>
<asp:Literal ID="LtLTipoSaldo" runat="server" Text="Total:"></asp:Literal></b></div>
<div class="col-md-1"><b>
<asp:TextBox ID="LtlSaldo" runat="server" Enabled="true" CssClass="TextBoxAsLabel" BorderStyle="None" BackColor="Transparent" ForeColor="#3c763d" Style="text-align: left"></asp:TextBox>
</b></div>
<div class="col-md-1">
<b>
<asp:Literal ID="LtLTipoSaldo" runat="server" Text="Total:"></asp:Literal></b>
</div>
<div class="col-md-1">
<b>
<asp:TextBox ID="LtlSaldo" runat="server" Enabled="true" CssClass="TextBoxAsLabel" BorderStyle="None" BackColor="Transparent" ForeColor="#3c763d" Style="text-align: left"></asp:TextBox>
</b>
</div>
<div class="col-md-1" style="text-align: right;">
<asp:LinkButton ID="LnkLiberar" runat="server" CssClass="btn btn-xs btn-success" Text="Liberar" OnClick="LnkLiberar_Click" /></div>
<asp:LinkButton ID="LnkLiberar" runat="server" CssClass="btn btn-xs btn-success" Text="Liberar" OnClick="LnkLiberar_Click" />
</div>
</div>
</div>
@@ -423,6 +428,20 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender11" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="DivDatosCheque" runat="server" visible="false" style="padding-top: 8px;">
<div class="col-md-12">
<div class="row">
<label class="col-md-2">Clave de autorización:</label>
<div class="col-md-4">
<asp:TextBox ID="TxtClaveAutorizacion" CssClass="form-control input-sm " runat="server" MaxLength="50" Width="100%" ClientIDMode="Static"></asp:TextBox>
</div>
<label class="col-md-2">¿Quién autorizó?:</label>
<div class="col-md-4">
<asp:TextBox ID="TxtAutorizo" CssClass="form-control input-sm " runat="server" MaxLength="50" Width="100%" ClientIDMode="Static"></asp:TextBox>
</div>
</div>
</div>
</div>
</div>
<div class="chequesie1" id="DivTransferencia" runat="server">
@@ -515,43 +534,44 @@
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun corte"
DataKeyNames="CveVenta,CveIE,CveTipoTransaccion,CveCuenta,SerieFolio"
ToolTip="Reporte de Cortes" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" Style="position: static" UseAccessibleHeader="false" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
Serie - Folio
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="LBDescripcion" runat="server" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>' ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblTotal" Text='<%# Eval("ImportePagado", "{0:N2}") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Método Pago" DataField="MetodoPago" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="" ItemStyle-Width="80">
<ItemTemplate>
<asp:LinkButton ID="LnkEditarPago" runat="server" AlternateText="Editar" Visible="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="LnkEditarPago_Click" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun corte"
DataKeyNames="CveVenta,CveIE,CveTipoTransaccion,CveCuenta,SerieFolio"
ToolTip="Reporte de Cortes" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" Style="position: static" UseAccessibleHeader="false" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
Serie - Folio
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="LBDescripcion" runat="server" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblTotal" Text='<%# Eval("ImportePagado", "{0:N2}") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Método Pago" DataField="MetodoPago" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="" ItemStyle-Width="80">
<ItemTemplate>
<asp:LinkButton ID="LnkEditarPago" runat="server" AlternateText="Editar" Visible="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="LnkEditarPago_Click" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
@@ -574,7 +594,7 @@
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
<tr align="left" >
<tr align="left">
<td>
<asp:Label runat="server" Font-Bold="true" ID="Label3">Sucursal:</asp:Label>
</td>
@@ -591,7 +611,7 @@
<asp:RegularExpressionValidator ID="REVCaja" runat="server" ControlToValidate="TxtDineroCaja" Display="None" ErrorMessage="El campo <b>''Dinero''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationExpression="^([1-9]{1}[\d]{0,2}(\,[\d]{3})*(\.[\d]{0,4})?|[1-9]{1}[\d]{0,}(\.[\d]{0,4})?|0(\.[\d]{0,2})?|(\.[\d]{1,4})?)$" ValidationGroup="GprIniciarTruno"></asp:RegularExpressionValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="REVCaja" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
@@ -763,7 +783,7 @@
<asp:DropDownList ID="DdlCuentaGastoDestino" runat="server" CssClass="form-control input-sm select2me" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="row">
@@ -913,54 +933,54 @@
<div id="DVModalPagos" class="modal ADS fade" role="dialog">
<div id="DVModalPagos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalPago" UpdateMode="Conditional">
<ContentTemplate>
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalPago" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Label ID="LblModalPagoTitulo" runat="server">Editar Pago</asp:Label>
</h4>
</div>
<div class="modal-body" >
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Label ID="LblModalPagoTitulo" runat="server">Editar Pago</asp:Label>
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="form-group col-md-12 form-md-line-input">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" ClientIDMode="Static" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardarPago" Width="100%" >
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Transaccion''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOTipoTransaccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoTransaccion" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlTipoTransaccion">Movimiento:</asp:Label>
</div>
</div>
<div class="row">
<div class="row">
<div class="form-group col-md-12 form-md-line-input">
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" ClientIDMode="Static" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardarPago" Enabled="false" Width="100%">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" ClientIDMode="Static" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardarPago" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Transaccion''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOTipoTransaccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoTransaccion" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlTipoTransaccion">Movimiento:</asp:Label>
</div>
</div>
<div class="row">
<div class="form-group col-md-12 form-md-line-input">
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" ClientIDMode="Static" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardarPago" Enabled="false" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuentaModal" runat="server" ControlToValidate="DdlCuenta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuentaModal" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlCuenta">Cuenta:</asp:Label>
</div>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LnkDvModalPagoAceptar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalPagoAceptar_Click" Text="Aceptar" ValidationGroup="GrpGuardarPago" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LnkDvModalPagoAceptar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="LnkDvModalPagoAceptar_Click" Text="Aceptar" ValidationGroup="GrpGuardarPago" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -979,21 +999,21 @@
<div class="modal-body">
<asp:GridView ID="GvModalCobrosEnTranscurso" runat="server" AutoGenerateColumns="False" Width="100%"
EmptyDataText="Cobros en Transcursos" data-sort="true" ToolTip="Cobros en Transcurso"
CssClass="ScrollAD table table-striped table-hover Widthall mysmallbtn" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio">
<Columns>
<asp:BoundField HeaderText="Atención" DataField="AtencionA" />
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Usuario" DataField="UsuarioCobranza" />
</Columns>
</asp:GridView>
EmptyDataText="Cobros en Transcursos" data-sort="true" ToolTip="Cobros en Transcurso"
CssClass="ScrollAD table table-striped table-hover Widthall mysmallbtn" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio">
<Columns>
<asp:BoundField HeaderText="Atención" DataField="AtencionA" />
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Usuario" DataField="UsuarioCobranza" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
@@ -1053,7 +1073,7 @@
}
</script>
</asp:Content>

View File

@@ -72,6 +72,9 @@ Partial Class Ventas_PVCobranza
If UsuarioActual.TienePermisoProceso(371) Then
CargaCorteCaja()
End If
If UsuarioActual.CveEmpresa = 189 Then
DivDatosCheque.Visible = True
End If
End If
End Sub
@@ -253,9 +256,8 @@ Partial Class Ventas_PVCobranza
End If
ObjMovtos.Dispose()
GvDatos.DataBind()
UpL.Update()
GvDatos.DataBind()
TxtImporteEfectivo.Text = ""
TxtImporteCredito.Text = ""
TxtImporteDebito.Text = ""
@@ -263,6 +265,10 @@ Partial Class Ventas_PVCobranza
TxtImporteTransferencia.Text = ""
TxtImporteOtrosContado.Text = ""
TxtCambio.Text = ""
TxtClaveAutorizacion.Text = ""
TxtAutorizo.Text = ""
UpL.Update()
End Sub
@@ -381,8 +387,16 @@ Partial Class Ventas_PVCobranza
End If
If LtlSaldo.Text.ToDecimal() > Pagado Then
Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
Exit Sub
If UsuarioActual.CveEmpresa = 189 Then
If (LtlSaldo.Text.ToDecimal() - Pagado) > 6 Then
Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim PagadoSinEfectivo As Decimal = Pagado - TxtImporteEfectivo.Text.ToDecimal
@@ -391,6 +405,18 @@ Partial Class Ventas_PVCobranza
If PagadoSinEfectivo > LtlSaldo.Text.ToDecimal() Then
Alert("El pago con los metodos de pago actuales no puede ser mayor al importe de la venta", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DivDatosCheque.Visible AndAlso TxtImporteCheque.Text.ToDecimal() > 0 Then
If String.IsNullOrEmpty(TxtClaveAutorizacion.Text.Trim()) Then
Alert("La clave de autorización es necesaria", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtAutorizo.Text.Trim()) Then
Alert("El nombre de la persona que autorizó es necesario", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
@@ -472,7 +498,12 @@ Partial Class Ventas_PVCobranza
End If
If SaldoPendiente > 0 AndAlso TxtImporteCheque.Text.ToDecimal > 0 Then
MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
Dim Obs As String = ""
If DivDatosCheque.Visible Then
Obs = $"{VentaActual.SerieFolio} - Autorizó: {TxtAutorizo.Text}"
End If
MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim())
SaldoPendiente -= TxtImporteCheque.Text.ToDecimal
PagoAplicado += TxtImporteCheque.Text.ToDecimal
End If
@@ -496,7 +527,13 @@ Partial Class Ventas_PVCobranza
End If
If SaldoPendiente > 0 Then
MsgError = "Tiene saldo pendiente por aplicar"
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If SaldoPendiente > 6 Then
MsgError = "Tiene saldo pendiente por aplicar"
End If
Else
MsgError = "Tiene saldo pendiente por aplicar"
End If
End If
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
@@ -708,11 +745,14 @@ Partial Class Ventas_PVCobranza
Return Retorno
End Function
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer) As String
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "") As String
Dim Retorno As String = ""
Dim CveIEPago As Integer = 0
Dim ErrorConta As Boolean
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, VentaActual.SerieFolio, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte)
If String.IsNullOrEmpty(Obs) Then
Obs = VentaActual.SerieFolio
End If
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion)
If CveIEPago > 0 Then
Dim Pago As New VentaPago
Pago.ImportePagoVenta = ImportePago

View File

@@ -570,15 +570,17 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
else
{
//SI REGISTRA SALIDA DE ALMACÉN EN AUTOMÁTICO Y ES DEVOLUCION QUE REALIZE EL MOVMIENTO DE SALIDA DE ALMACEN
if (UsuarioActual.Empresa.Funcionalidad(567) == "1" && factura.TipoDocto == "Dev" && factura.SaldoAlmacen != 0)
if ((UsuarioActual.Empresa.Funcionalidad(567) == "1" || UsuarioActual.Empresa.Funcionalidad(531) == "1") && factura.TipoDocto == "Dev" && factura.SaldoAlmacen != 0)
{
factura.RealizarDevolucionAlmacen = true;
}
bool AplicaCancelacionConPagos = false;
if (UsuarioActual.Empresa.Funcionalidad(382) == "1")
if (UsuarioActual.Empresa.Funcionalidad(382) == "1" || UsuarioActual.Empresa.Funcionalidad(109) == "1" )
{
AplicaCancelacionConPagos = true;
}
if (UsuarioActual.TienePermisoProceso(269) && UsuarioActual.Empresa.Funcionalidad(109) == "1" && factura.TipoDocto == "Ing" && factura.SaldoAlmacen != 0)
{
factura.RealizarDevolucionAlmacen = true;

View File

@@ -430,7 +430,12 @@
<asp:BoundField HeaderText="Fecha Hora de Emisión" DataField="FechaIng" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Center" Visible="false" />
<%--19--%>
<asp:BoundField HeaderText="Num. Turnos" DataField="NumTurnos" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" Visible="false" />
<%--20--%>
<asp:BoundField HeaderText="O. C." DataField="OC_noOrden" ItemStyle-Width="5%" Visible="false" />
<%--21--%>
<asp:BoundField HeaderText="Kilogramos" DataField="OC_Kilogramos" ItemStyle-Width="5%" Visible="false" />
<%--22--%>
<asp:BoundField HeaderText="Cantiadad" DataField="OC_Cantidad" ItemStyle-Width="5%" Visible="false" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
@@ -471,6 +476,18 @@
<td style="text-align: left;">
<asp:CheckBox ID="ChkFormaPago" runat="server" Text="Forma de Pago" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkOC_noOrden" runat="server" Text="O. C." />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkOC_Kilogramos" runat="server" Text="O. C. Kilogramos" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkOC_Cantidad" runat="server" Text="O. C. Cantiadad" />
</td>
</tr>
<tr>
<td style="text-align: left;">

View File

@@ -555,6 +555,12 @@ Partial Class Ventas_RepProductosServiciosDetalle
GvDatos.Columns(18).Visible = ChkFechaHoraEmision.Checked
GvDatos.Columns(19).Visible = ChkNumTurnos.Checked
GvDatos.Columns(20).Visible = ChkOC_noOrden.Checked
GvDatos.Columns(21).Visible = ChkOC_Kilogramos.Checked
GvDatos.Columns(22).Visible = ChkOC_Cantidad.Checked
CargaDatos()
UPDatos.Update()
End Sub

View File

@@ -1479,7 +1479,7 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkExistencias" runat="server" Visible="false" AlternateText="Ver Existencias" CausesValidation="False" CommandName="Existencias" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-eye'></i>" />
CssClass="btn btn-circle btn-sm purple" Text="<i class='fa fa-eye'></i>" />
<asp:LinkButton ID="LnkDescuentos" runat="server" Visible="false" AlternateText="Descuento" CausesValidation="False" CommandName="Descuento" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-percent'></i>" />
<asp:LinkButton ID="imgClone" runat="server" AlternateText="Clonar" CausesValidation="False" CommandName="Clonar" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
@@ -4298,8 +4298,8 @@
<asp:LinkButton ID="BtnAdjuntar" runat="server" Visible="false" Text="<i class='fa-upload fa' style=' color: white;'></i> Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
<br />
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar el archivo?" data-btn-ok-label="si" />
<asp:LinkButton ID="BtnReemplazarAdjunto" runat="server" Visible="false" AlternateText="Reemplazar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa-upload fa' style=' color: white;'></i>" data-toggle="modal" data-target="#ModalAdjuntar" />
</td>
</tr>
</table>
@@ -8197,6 +8197,14 @@
<i></i>
</div>
</div>
<div class="row" id="divGiro" runat="server" visible="false" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:DropDownList ID="DdlGiro" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" Width="100%" runat="server" CssClass="form-control select2me">
</asp:DropDownList>
<label for="<%= DdlGiro.ClientID.ToString()%>">Giro:</label>
<i></i>
</div>
</div>
</div>
<div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer">
<asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" />

View File

@@ -3733,7 +3733,7 @@ Partial Class Ventas
End Sub
Private Sub CargaListasPreciosSubProyectos(CvePS As Integer)
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If UsuarioActual.CveEmpresa = 189 Then
DivPrecioLista.Visible = True
Using ObjVta As New ClsVentas
@@ -5025,6 +5025,7 @@ Partial Class Ventas
BtnArchivoAdjunto.Visible = True
BtnEliminarAdjunto.Visible = False
BtnAdjuntar.Visible = False
BtnReemplazarAdjunto.Visible = True
End If
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
@@ -8790,7 +8791,7 @@ Partial Class Ventas
End If
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If UsuarioActual.CveEmpresa = 189 Then
e.Row.FCLinkButton("LnkExistencias").Visible = True
End If
@@ -9149,7 +9150,11 @@ Partial Class Ventas
Dim PrecioLista As String = ""
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(360) = "1" Then
CvePrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedValue.ToEntero()
PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text.Split("-"c)(0)
If UsuarioActual.CveEmpresa = 189 Then
PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text.Split("-"c)(0)
Else
PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text
End If
End If
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text,
@@ -16835,6 +16840,11 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DtMovtos = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('RNC','IxC','Ant') {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")} ", "")}")
End If
GVAnticipos.DataSource = DtMovtos
If ObjMovtos.DtResultados.SUM("Saldo", "Saldo > 0 AND SaldoSubtotal > 0 AND Tipo = 'Ant'") > 0 Then
@@ -17937,7 +17947,7 @@ Partial Class Ventas
If ObjPrecioSugerido.CvePrecioLista > 0 AndAlso DivPrecioLista.Visible Then
DdlPrecioLista.SelectedValueExist(ObjPrecioSugerido.CvePrecioLista)
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If UsuarioActual.CveEmpresa = 189 Then
If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
If dt IsNot Nothing Then
@@ -19456,7 +19466,12 @@ Partial Class Ventas
If DivPrecioLista.Visible Then
If DdlPrecioLista.SelectedValue.ToEntero() > 0 AndAlso DdlPrecioLista.SelectedValue.ToEntero() = Me.CvePrecioLista Then
CvePrecioListaPS = Me.CvePrecioLista
PrecioListaPS = DdlPrecioLista.SelectedItem.Text.Split("-"c)(0)
If UsuarioActual.CveEmpresa = 189 Then
PrecioListaPS = DdlPrecioLista.SelectedItem.Text.Split("-"c)(0)
Else
PrecioListaPS = DdlPrecioLista.SelectedItem.Text
End If
Else
'sino es la seleccionada se recalcula de nuevo
CargaPrecioLista(DdlPS.SelectedValue.ToEntero)
@@ -24457,10 +24472,15 @@ Partial Class Ventas
DivBotonesAgregarCliente.Visible = False
DivFormaCliente.Visible = False
divRegimenCliente.Visible = False
divGiro.Visible = False
UpAgregarCliente.Update()
CargaEstados()
TxtRFCCliente.Focus()
If UsuarioActual.CveEmpresa = 189 Then
CargaGiro()
End If
RegistraScript("showDivEC();")
End Sub
@@ -24538,6 +24558,10 @@ Partial Class Ventas
End If
If UsuarioActual.CveEmpresa = 189 Then
divGiro.Visible = True
End If
End Sub
Private Sub CargaComboCFDICliente()
@@ -24630,7 +24654,7 @@ Partial Class Ventas
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero,
TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista,
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI) Then
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI, CveClienteClasificacion:=DdlGiro.SelectedValue.ToEntero()) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();")
@@ -25346,15 +25370,9 @@ Partial Class Ventas
LtlVerExistenciasPS.Text = $"Existencias: {GvRow.DataKey("PS")}"
Dim RestringirAlmacenes As Integer = -1
If UsuarioActual.CveEmpresa = 119 Then
RestringirAlmacenes = 1 'restringue los almacenes:Consignación,Productos Financieros Asignados,,roductos Financieros,Consumo Interno,Activo Fijo,Merma,Consignación de Contrato,Devolucion proveedor,
End If
Dim RestringirAlmacenes As Integer = -1
Dim BuscarEnTabla As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(715) = "1" Then
BuscarEnTabla = True
End If
Dim BuscarEnTabla As Boolean = True
Dim ObjInventarios As New ClsInventarios()
If ObjInventarios.GetExistenciasProducto(GvRow.DataKey("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
@@ -36259,6 +36277,10 @@ Partial Class Ventas
End Sub
Protected Sub btnGuardarAdjunto_Click(sender As Object, e As System.EventArgs) Handles btnGuardarAdjunto.Click
GuardarArchivoAdjunto()
End Sub
Private Sub GuardarArchivoAdjunto()
If Not txtAdjuntar.getfiles().Archivos.Count > 0 Then
Alert("Tiene que cargar un archivo.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -36275,7 +36297,7 @@ Partial Class Ventas
Try
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Adjunto = String.Format("{0}-{1}.{2}", LblSerie.Text, TxtFolio.Text, FileExtension)
Dim objVentas As New ClsVentas
Dim Path As String
Path = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta)
If Not Directory.Exists(Path) Then
@@ -36286,17 +36308,24 @@ Partial Class Ventas
File.Delete(Path)
End If
My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path)
If File.Exists(Path) AndAlso Me.CveVenta > 0 Then
Using ObjVta As New ClsVentasTemp
If ObjVta.UpdateVentaAdjunto(Me.CveVenta, Adjunto, UsuarioActual.CveEmpresa) Then
Alert("Documento cargado", TipoMensaje.MsgInformacion)
End If
End Using
End If
BtnAdjuntar.Visible = False
BtnArchivoAdjunto.Text = Adjunto
BtnArchivoAdjunto.Visible = True
BtnEliminarAdjunto.Visible = True
Alert("Documento cargado", TipoMensaje.MsgInformacion)
objVentas.Dispose()
BtnReemplazarAdjunto.Visible = False
Catch ex As Exception
OnError("Error al cargar archivo", ex)
End Try
End Sub
Protected Sub BtnArchivoAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnArchivoAdjunto.Click
@@ -38891,5 +38920,192 @@ Partial Class Ventas
End If
End If
End Sub
Private Sub CargaGiro()
Dim Dt As DataTable = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
DdlGiro.DataSource = Dt
DdlGiro.DataBind()
DdlGiro.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpAgregarCliente.Update()
End Sub
Public Class ClsVentasTemp
Implements IDisposable
#Region "Campos"
'SQL
Private SqlConexion As SqlClient.SqlConnection
Private SqlAdapter As SqlClient.SqlDataAdapter
Private SqlCommand As SqlClient.SqlCommand
Private SqlTransacc As SqlClient.SqlTransaction
Private Data As DataTable
Private Dataset As DataSet
'Atributos de la clase
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
Private CveConexion As Integer = 0
Private EsTransaccionCompartida As Boolean = False
#End Region
#Region "Propiedades"
Public ReadOnly Property DtResultados() As DataTable
Get
DtResultados = Data
End Get
End Property
#End Region
Public Function IniciaTransacSQL() As SqlClient.SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
Return SqlTransacc
End Function
Public Sub Commit()
SqlTransacc.Commit()
End Sub
Public Sub RollBack()
SqlTransacc.Rollback()
End Sub
Sub New(Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlClient.SqlConnection
SqlConexion.ConnectionString = If(UsuarioActual IsNot Nothing, UsuarioActual.RutaDB, ClsPaginas.UsuarioActualRutaDB)
Try
SqlConexion.Open()
Catch ex As Exception
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try
Else
SqlConexion = TransaccionCompartida.Connection
SqlTransacc = TransaccionCompartida
EsTransaccionCompartida = True
End If
SqlAdapter = New SqlClient.SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub
Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand
.Parameters.Clear()
.CommandText = pStrSQL
.CommandType = TipoComando
End With
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable
End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
DataAdapter("PA_Sis_RegistrarConexion")
With SqlAdapter.SelectCommand.Parameters
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
End With
SqlAdapter.Fill(Data)
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
End If
End Sub
Private Sub ConexionClose()
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
Try
SqlAdapter.Fill(Data)
Catch ex As Exception
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
CveConexion = 0
End If
End Sub
#End Region
Public Function UpdateVentaAdjunto(CveVenta As Integer, Adjunto As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaAdjuntoUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@Adjunto", SqlDbType.VarChar).Value = Adjunto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el adjunto de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region "IDisposable Support"
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
If Not Dataset Is Nothing Then Dataset.Dispose() : Dataset = Nothing
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
End Class