This commit is contained in:
Jorge Luis caudillo esparza
2025-04-11 10:45:41 -07:00
23 changed files with 1892 additions and 198 deletions

View File

@@ -13,6 +13,12 @@ color: #666;
font-size: 12px;
}
.fa-xs {
padding: 0px 0px 0px 0px;
font-size: 12px;
margin: 0px 0px 0px 0px;
}
</style>
</asp:Content>
@@ -129,6 +135,7 @@ font-size: 12px;
<asp:BoundField HeaderText="Cultivo" DataField="Cultivo" />
<asp:BoundField HeaderText="Variedad" DataField="CultivoVariedad" />
<asp:BoundField HeaderText="Tamaño" DataField="Tamaño" />
<asp:BoundField HeaderText="PalletNum" DataField="PalletNum" />
<asp:BoundField HeaderText="Referencia" DataField="Referencia" />
<asp:BoundField HeaderText="Fecha Vta" DataField="InvDate" ItemStyle-Width="110px" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="False" />
<asp:BoundField HeaderText="Cantidad" DataField="CantidadVendida" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
@@ -176,13 +183,13 @@ font-size: 12px;
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1">
<div class="col-md-2" style="width:100px">
Fecha Inicio:
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtModalFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="100px"></asp:TextBox>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtModalFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
@@ -191,13 +198,13 @@ font-size: 12px;
<ajax:CalendarExtender runat="server" ID="CETxtModalFechaInicio" TargetControlID="TxtModalFechaInicio" PopupButtonID="LnkTxtModalFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<div class="col-md-1">
<div class="col-md-2" style="width:100px">
Fecha Fin:
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtModalFechaFin" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="100px"></asp:TextBox>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtModalFechaFin" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
@@ -206,13 +213,10 @@ font-size: 12px;
<ajax:CalendarExtender runat="server" ID="CETxtModalFechaFin" TargetControlID="TxtModalFechaFin" PopupButtonID="LnkTxtModalFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<div class="col-md-2" ></div>
<div class="col-md-2" style="text-align: right">
<div class="col-md-2" style="width:100px" ></div>
<div class="col-md-2" style="text-align: right;margin-left:150px">
<asp:LinkButton ID="LnkModalBuscar" runat="server" CssClass="btn btn-primary" OnClick="LnkModalBuscar_Click"> Consultar</asp:LinkButton>
</div>
<div class="col-md-2" style="text-align: left">
<asp:LinkButton ID="LnkModalMuestra" runat="server" CssClass="btn btn-primary" OnClick="LnkModalMuestraAdd_Click"><i class="fa fa-plus" aria-hidden="true"></i> Agregar</asp:LinkButton>
</div>
</div>
</div>
</div>
@@ -224,6 +228,21 @@ font-size: 12px;
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-8">
</div>
<div class="col-md-1" style="margin-top:-5px">
<asp:LinkButton ID="LnkModalMuestra" runat="server" OnClick="LnkModalMuestraAdd_Click" CssClass="btn btn-circle btn-default" Text="<i class='fa fa-plus'></i> Agregar" ></asp:LinkButton>
</div>
<div class="col-md-3">
<div class="" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GVPrecioVentaFecha.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GVPrecioVentaFecha.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
@@ -241,12 +260,12 @@ font-size: 12px;
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="LnkEditarPrecioVentaFecha" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="LnkEditarPrecioVentaFecha_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="LnkEditarPrecioVentaFecha" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="LnkEditarPrecioVentaFecha_Click" CssClass="btn btn-circle btn-sm green" > <i class='fa fa-pencil fa-xs' ></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarPrecioVentaFecha" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="LnkEliminarPrecioVentaFecha_Click" 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="LnkEliminarPrecioVentaFecha" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="LnkEliminarPrecioVentaFecha_Click" CssClass="btn btn-circle btn-sm red" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" ><i class='icon-trash fa-xs'></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -335,8 +354,8 @@ font-size: 12px;
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<label for="<%= TxtModalFecha.ClientID.ToString()%>" style="color: #888888;">Fecha: </label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtModalFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="100px"></asp:TextBox>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox ID="TxtModalFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>

View File

@@ -142,7 +142,7 @@ Partial Class Agrupecuaria_RepPreciosVentaManifiesto
Dim ObjVentas As New ClsVentas
If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then
DdlModalCultivo.DataSource = ObjVentas.DtResultados
DdlModalCultivo.DataSource = ObjVentas.DtResultados.FiltraParametros("", "Cultivo")
Else
DdlModalCultivo.DataSource = Nothing
End If
@@ -163,7 +163,7 @@ Partial Class Agrupecuaria_RepPreciosVentaManifiesto
Dim objVentas As New ClsVentas
If objVentas.GetCultivosVariedad(CveCultivo, -1, UsuarioActual.CveEmpresa) Then
DdlModalCultivoVariedad.DataSource = objVentas.DtResultados
DdlModalCultivoVariedad.DataSource = objVentas.DtResultados.FiltraParametros("", "CultivoVariedad")
End If
objVentas.Dispose()
@@ -182,7 +182,7 @@ Partial Class Agrupecuaria_RepPreciosVentaManifiesto
Dim objVentas As New ClsVentas
If objVentas.GetEmbarqueTamaño(-1, -1, UsuarioActual.CveEmpresa) Then
DdlModalTamaño.DataSource = objVentas.DtResultados
DdlModalTamaño.DataSource = objVentas.DtResultados.FiltraParametros("", "Tamaño")
End If
objVentas.Dispose()

View File

@@ -528,6 +528,25 @@ Public Class ClsClientes
Return Retorno
End Function
Public Function GetClienteInformacionCompleta(CveCliente As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClientesInformacionCompletaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener la información completa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddCliente(Nombre As String, NombreComercial As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, Pais As String, RFC As String, CP As String, Telefono As String,
Contacto As String, Mail As String, MailCotizacion As String, Notificar As String, Pagina As String, Giro As String, CvePrecioLista As Integer, EnviarFactura As Boolean, RetIVA As Double, RetISR As Double,
@@ -544,7 +563,7 @@ Public Class ClsClientes
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1, Optional InformacionCompleta As Boolean = True) As Boolean
Dim Retorno As Boolean = False
@@ -683,6 +702,7 @@ Public Class ClsClientes
.Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial
.Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora
.Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
.Add("@InformacionCompleta", SqlDbType.Bit).Value = InformacionCompleta
End With
Try
SqlAdapter.Fill(Data)
@@ -729,7 +749,7 @@ Public Class ClsClientes
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1, Optional InformacionCompleta As Boolean = True) As Boolean
Dim Retorno As Boolean = False
@@ -878,6 +898,7 @@ Public Class ClsClientes
.Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial
.Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora
.Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
.Add("@InformacionCompleta", SqlDbType.Bit).Value = InformacionCompleta
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -4,7 +4,7 @@ Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
Imports iText.StyledXmlParser.Css.Resolve.Shorthand.Impl
Public Class ClsCompras
Implements IDisposable
@@ -200,7 +200,7 @@ Public Class ClsCompras
Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Decimal = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1,
Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Integer = 0, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Decimal = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1,
Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1,
Optional CveCompraRelacionada As Integer = -1) As Boolean
Optional CveCompraRelacionada As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -256,7 +256,7 @@ Public Class ClsCompras
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@DoctosRelacionados", SqlDbType.VarChar).Value = DoctosRelacionados
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada
.Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada
End With
Try
@@ -3250,13 +3250,14 @@ Public Class ClsCompras
Return Retorno
End Function
Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer) As Boolean
Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComprasFechaVencimientoUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -6269,6 +6269,7 @@ Public Class ClsPaginas
DtMercancias.Columns.Add(New DataColumn("PesoEnKg", GetType(String)))
DtMercancias.Columns.Add(New DataColumn("CveMaterialPeligroso", GetType(String)))
DtMercancias.Columns.Add(New DataColumn("MaterialPeligroso", GetType(String)))
DtMercancias.Columns.Add(New DataColumn("Embalaje", GetType(String)))
DtMercancias.Columns.Add(New DataColumn("SectorCOFEPRIS", GetType(String)))
@@ -6461,6 +6462,7 @@ Public Class ClsPaginas
Row("PesoEnKg") = ValorXML(node, "PesoEnKg", "")
Row("CveMaterialPeligroso") = ValorXML(node, "CveMaterialPeligroso", "")
Row("MaterialPeligroso") = If(ValorXML(node, "MaterialPeligroso", "").ToUpper() = "SÍ", "Sí", "No")
Row("Embalaje") = ValorXML(node, "Embalaje", "")
Row("SectorCOFEPRIS") = ValorXML(node, "SectorCOFEPRIS", "")

View File

@@ -7358,7 +7358,7 @@ Public Class ClsVentas
End Function
Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuarioAtendio As Integer, CveUsuarioConsulta As Integer, CveTipoVenta As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean
Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuarioAtendio As Integer, CveUsuarioConsulta As Integer, CveTipoVenta As Integer, CveMarca As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasRepGet")
@@ -7371,6 +7371,7 @@ Public Class ClsVentas
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveUsuarioAtendio", SqlDbType.Int).Value = CveUsuarioAtendio
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
.Add("@FechaInicioPago", SqlDbType.Date).Value = FechaInicioPago
@@ -7717,6 +7718,33 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function AddPreciosVentaManifiesto(PalletNum As String, CveCultivo As Integer, CveTamaño As Integer, CveCultivoVariedad As Integer, Referencia As String, LdDate As Date, InvDate As Date, PDDate As Date, CantidadVendida As Decimal, PUVenta As Decimal, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaManifiestoAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@PalletNum", SqlDbType.VarChar).Value = PalletNum
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
.Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@LdDate", SqlDbType.Date).Value = LdDate
.Add("@InvDate", SqlDbType.Date).Value = InvDate
.Add("@PDDate", SqlDbType.Date).Value = PDDate
.Add("@CantidadVendida", SqlDbType.Money).Value = CantidadVendida
.Add("@PUVenta", SqlDbType.Money).Value = PUVenta
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar los datos de manifiesto de ventaa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetPreciosVentaManifiesto(FechaInicio As Date, FechaFin As Date, CveEmbarqueManifiesto As Integer, CveSubProyecto As Integer, CveCultivo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -7733,7 +7761,7 @@ Public Class ClsVentas
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los indicadores de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
OnError("Ocurrió un error al obtener los datos de manifiesto de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
@@ -7744,7 +7772,6 @@ Public Class ClsVentas
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaFechaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion

View File

@@ -23,6 +23,7 @@ Imports System.Xml
Imports System.Diagnostics
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.ComponentModel
@@ -76,8 +77,8 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState
End Sub
Private Function PreciosVentaCultivo(ByVal CveEmpresa As Integer, ByVal context As HttpContext) As Boolean
Dim Respuesta As Boolean = False
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim Respuesta As Boolean = True
Dim UsuarioActual As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
' Crear una instancia del servicio web
Dim wsservice As New GrowerService.Service()
@@ -93,8 +94,134 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState
Dim Parametro6 As Integer = 0
Dim Parametro6Date As Date = Now.AddDays(-3)
'Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6)
Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6)
'DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema)
'DTresp.FiltraParametros("", "", {"CommodityDesc"}).WriteXml("C:\temp\GrowerService\CommodityDesc.xml", XmlWriteMode.WriteSchema)
'DTresp.FiltraParametros("", "", {"VarietyDesc"}).WriteXml("C:\temp\GrowerService\VarietyDesc.xml", XmlWriteMode.WriteSchema)
'DTresp.FiltraParametros("", "", {"SizeDesc"}).WriteXml("C:\temp\GrowerService\SizeDesc.xml", XmlWriteMode.WriteSchema)
DTresp.Columns.Add("InvoiceDateReal", GetType(DateTime))
For Each row As DataRow In DTresp.Rows
Dim fechaTexto As String = row("InvoiceDate").ToString().Trim()
If DateTime.TryParseExact(fechaTexto, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing) Then
row("InvoiceDateReal") = DateTime.ParseExact(fechaTexto, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture)
Else
row("InvoiceDateReal") = DBNull.Value
End If
Next
DTresp = DTresp.FiltraParametros(" InvoiceDateReal >= #01/01/2025# ")
Dim ObjVentas As New ClsVentas
Dim DTCultivo As New DataTable
Dim DTCultivoVariedad As New DataTable
Dim DTTamaño As New DataTable
If ObjVentas.GetCultivos(-1, CveEmpresa) Then
DTCultivo = ObjVentas.DtResultados
Else
Respuesta = False
End If
If ObjVentas.GetCultivosVariedad(-1, -1, CveEmpresa) Then
DTCultivoVariedad = ObjVentas.DtResultados
Else
Respuesta = False
End If
If ObjVentas.GetEmbarqueTamaño(-1, -1, CveEmpresa) Then
DTTamaño = ObjVentas.DtResultados
Else
Respuesta = False
End If
If Respuesta Then
ObjVentas.IniciaTransacSQL()
For Each dRow As DataRow In DTresp.Rows
Dim PalletNum As String = dRow("PalletNum").ToString
Try
Dim CveCultivo As Integer = DTCultivo.FiltroPrimeroValor("CveCultivo", $" Alias = '{dRow("CommodityDesc").ToString}' ").ToEntero
If Not CveCultivo > 0 Then
GuardaLog($"No se encontro el cultivo {dRow("CommodityDesc").ToString}")
Exit For
End If
Dim CveCultivoVariedad As Integer = DTCultivoVariedad.FiltroPrimeroValor("CveCultivoVariedad", $" Alias = '{dRow("VarietyDesc").ToString}' ").ToEntero
If Not CveCultivoVariedad > 0 Then
GuardaLog($"No se encontro la variedad {dRow("VarietyDesc").ToString}")
Exit For
End If
Dim CveTamaño As Integer = DTTamaño.FiltroPrimeroValor("CveTamaño", $" Alias = '{dRow("SizeDesc").ToString.Replace("'", "''")}' ").ToEntero
If Not CveTamaño > 0 Then
GuardaLog($"No se encontro el tamaño {dRow("SizeDesc").ToString}")
Exit For
End If
Dim LoadDate As Date = DateTime.ParseExact(dRow("LoadDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture)
Dim InvoiceDate As Date = DateTime.ParseExact(dRow("InvoiceDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture)
Dim PaidDate As Date = MinFecha
If dRow("PaidDate").ToString.Trim.Length > 0 Then
PaidDate = DateTime.ParseExact(dRow("PaidDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture)
End If
If Not ObjVentas.AddPreciosVentaManifiesto(dRow("PalletNum").ToString, CveCultivo, CveTamaño, CveCultivoVariedad, dRow("GroReference").ToString,
LoadDate, InvoiceDate, PaidDate,
dRow("InvPkgs").ToString.ToDecimal, dRow("NetProdPrice").ToString.ToDecimal, dRow("ProductDesc").ToString,
UsuarioActual.CveUsuario, CveEmpresa) Then
Respuesta = False
Exit For
End If
Catch ex As Exception
GuardaLog($"Error PalletNum: {PalletNum} {ex.Message} --> {ex.StackTrace}")
Respuesta = False
End Try
Next
If Respuesta Then
ObjVentas.Commit()
Else
ObjVentas.RollBack()
End If
End If
ObjVentas.Dispose()
'For Each dRow As DataRow In DTresp.Rows
'Next
'Dim ObjVentas As New ClsVentas
'If ObjVentas.AddPreciosVentaManifiesto() Then
'End If
'ObjVentas.Dispose()
'DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema)
'Dim DTAdjustements As DataTable = wsservice.GetAdjustements(Parametro1, Parametro2, Parametro4, Parametro5, Parametro6)
'DTAdjustements.WriteXml("C:\temp\GrowerService\Adjustements.xml", XmlWriteMode.WriteSchema)
@@ -107,8 +234,8 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState
'Dim DTLotexpenses As DataTable = wsservice.GetLotExpenses(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6, expenseID:=)
'DTLotexpenses.WriteXml("C:\temp\GrowerService\Lotexpenses.xml", XmlWriteMode.WriteSchema)
Dim DTTodayInvoices As DataTable = wsservice.GetTodayInvoices(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6Date, ContractFilter:=1)
DTTodayInvoices.WriteXml("C:\temp\GrowerService\TodayInvoices.xml", XmlWriteMode.WriteSchema)
'Dim DTTodayInvoices As DataTable = wsservice.GetTodayInvoices(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6Date, ContractFilter:=1)
'DTTodayInvoices.WriteXml("C:\temp\GrowerService\TodayInvoices.xml", XmlWriteMode.WriteSchema)
Dim InvParametro1 As Integer = 9
Dim InvParametro2 As Integer = 1

View File

@@ -151,12 +151,15 @@
<label style="">Cuenta:</label>
</div>
<div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%" AutoPostBack ="true" OnSelectedIndexChanged="DdlCuentaDeposito_SelectedIndexChanged"></asp:DropDownList>
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlCuentaDeposito_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" InitialValue="-1" CssClass="help-block errorimput" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida">
</asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRfvDdlCuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlCuentaDeposito" Width="350px"></ajax:ValidatorCalloutExtender>
<div id="divtcdeposito" runat="server" visible="False">TC: <asp:TextBox ID="TxtTCDeposito" Width="60px" runat="server"></asp:TextBox></div>
<div id="divtcdeposito" runat="server" visible="False">
TC:
<asp:TextBox ID="TxtTCDeposito" Width="60px" runat="server"></asp:TextBox>
</div>
</div>
<div class="col-md-1">
@@ -403,6 +406,12 @@
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sob/Fal" ItemStyle-Width="20px">
<ItemTemplate>
<asp:Literal ID="LtlSobranteFaltante" runat="server" ClientIDMode="Static" Text='<%# Eval("SobranteFaltante", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Literal ID="LtImporte" runat="server" ClientIDMode="Static" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Literal>

View File

@@ -94,6 +94,14 @@ Partial Class Bancos_ProveedoresAbonar
ViewState("CveAplicaNC") = value
End Set
End Property
Private Property ProveedorPlazoPago As Integer
Get
Return ViewState("ProveedorPlazoPago").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("ProveedorPlazoPago") = value
End Set
End Property
Private Property CveMoneda As Integer
Get
@@ -468,6 +476,7 @@ Partial Class Bancos_ProveedoresAbonar
TxtImporte.Attributes.Add("disabled", "disabled")
If DdlTipoTransaccion.SelectedValue = "1" Then RFVFolio.Enabled = True Else RFVFolio.Enabled = False
TxtNotificarA.Text = $"{ObjProveedor.NotificarA.Trim}"
ProveedorPlazoPago = ObjProveedor.PlazoPago
If ObjProveedor.CorreoCobranza.Trim <> "" Then TxtNotificarA.Text = $"{TxtNotificarA.Text};{ObjProveedor.CorreoCobranza.Trim}"
'Sección de pago a proveedor
@@ -525,6 +534,11 @@ Partial Class Bancos_ProveedoresAbonar
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo"))
e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format(" RNCAutocheck = true;FnCambia({0},this,{1},2,'{2}',2);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo"))
End If
'si el vencimiento es diferente al configurado en el proveedor, se pone en rojo
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DateDiff(DateInterval.Day, e.Row.DBCampo("Fecha").ToDate, e.Row.DBCampo("FechaVencimiento").ToDate) <> ProveedorPlazoPago Then
e.Row.Cells(6).ForeColor = Drawing.Color.Red
e.Row.Cells(6).ToolTip = $"Dias de Vencimiento ({DateDiff(DateInterval.Day, e.Row.DBCampo("Fecha").ToDate, e.Row.DBCampo("FechaVencimiento").ToDate)}) diferente al configurado en el proveedor ({ProveedorPlazoPago})"
End If
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red
@@ -581,15 +595,10 @@ Partial Class Bancos_ProveedoresAbonar
e.Row.FCTextBox("TxtAbonar").Enabled = True
End If
End If
End If
e.Row.FCLiteral("LtlAux").Text = String.Format("<a Class=""Texto thickbox"" href=""/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=370&width=900"" />Ir</a>", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra"))
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv))
If Not PermiteModificarImporte Then e.Row.FCTextBox("TxtAbonar").Enabled = False
If e.Row.DBCampo("CveCompraNC").ToEntero > 0 Then
e.Row.FCHyperLink("HplNC").Visible = True
@@ -622,11 +631,9 @@ Partial Class Bancos_ProveedoresAbonar
If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then
e.Row.FCCheckBox("Chk").Enabled = False
End If
e.Row.FCTextBox("TxtDescuento").Attributes.Add("onkeyup", $" calculaDescuentoEscalonado({e.Row.DBCampo("Saldo")},'{e.Row.FCTextBox("TxtDescuento").ClientID}',{e.Row.FCTextBox("TxtAbonar").ClientID},{e.Row.FCCheckBox("Chk").ClientID},'El Importe no debe de exceder el saldo',1)")
Else
e.Row.FCTextBox("TxtDescuento").Visible = False
End If
End If
End Sub

View File

@@ -216,6 +216,11 @@ Partial Class Compras_Compras
Return ViewState("CveTipoProveedor").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveTipoFechaVencimiento As Integer
Get
Return ViewState("CveTipoFechaVencimiento").ToString.ToEntero
End Get
End Property
Private ReadOnly Property NombreProveedor As String
Get
@@ -3788,6 +3793,7 @@ Partial Class Compras_Compras
ViewState("CveProveedor") = ObjProveedor.CveProveedor
HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString
ViewState("CveTipoFechaVencimiento") = ObjProveedor.CveTipoFechaVencimiento
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
@@ -5166,6 +5172,18 @@ Partial Class Compras_Compras
If (tNoDeducible > 0) Then
tNoDeducible = If(TmpDT.MIN("NoDeducible", "IVA > 0") = "False", 2, 1)
End If
'cuando es el cálculo de la fecha de vencimiento por entrada almacen
If CveTipoFechaVencimiento = 2 Then
'verificar que tenga seleccionado entrada en almacen.
Dim ConEntradaDirecta As Boolean = False
For Each gvr As GridViewRow In GvInv.Rows
If gvr.FCCheckBox("cbinv").Checked Then
ConEntradaDirecta = True : Exit For
End If
Next
If ConEntradaDirecta Then TxtFechaPago.Text = (Now.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
End If
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDecimal, TxtDescuento.Text.ToDecimal,
LblAmortizacion.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtRetIVA.Text.ToDecimal, TxtRetISR.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtOtrosImpuestos.Text.ToDecimal,
TxtRedondeo.Text.ToDecimal, TxtTotal.Text.ToDecimal, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura,
@@ -15136,11 +15154,6 @@ Partial Class Compras_Compras
End If
Dim DiasCreditoOCActual As Integer = DTOCTemp.FiltroPrimeroValor("DiasCreditoOC").ToEntero
If DiasCreditoOCActual > DiasCredito Then
DiasCredito = DiasCreditoOCActual
End If
IvaAcumulado += ObjOC.DtResultados.Rows(0)("IVA").ToString.ToDouble
@@ -15263,10 +15276,6 @@ Partial Class Compras_Compras
DivOCPromocion.Visible = True
End If
If DiasCredito > 0 Then
TxtFechaPago.Text = Now.AddDays(DiasCredito).ToString("dd/MM/yyyy")
UPCondicionesPago.Update()
End If
'CARGA DATOS DE OC
CargaVinculacionOC(True)
@@ -21048,7 +21057,7 @@ Partial Class Compras_Compras
Exit Sub
End If
If ObjComp.UpdateFechaVencimientoCompra(CveCompra, TxtFechaPago.Text.ToDate, UsuarioActual.CveEmpresa) Then
If ObjComp.UpdateFechaVencimientoCompra(CveCompra, TxtFechaPago.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Alert("Fecha de pago actualizada correctamente.")
End If

View File

@@ -1167,6 +1167,17 @@ Partial Class Compras_eFacturas
' End If
'End If
Dim Funcionalidad123 As Integer = UsuarioActual.Empresa.Funcionalidad(123).ToEntero
If Funcionalidad123 > 0 Then
If NowADS().Day >= Funcionalidad123 Then
Dim FechaLimite As Date = New Date(NowADS().Year, NowADS().Month, 1)
If e.Row.DBCampo("FechaFactura").ToDate < FechaLimite Then
e.Row.FCHyperLink("HplAgregar").Visible = False
End If
End If
End If
e.Row.FCCheckBox("chkRegistraFactura").Attributes.Add("onclick", "ChkRegsitraFacturas()")
End If

View File

@@ -1217,7 +1217,8 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>CAMELIA 619 LIBERTAD HERMOSILLO</Value>
<Value>CAMELIA No.Ext: 619, Col: Libertad,
CP: 83130, Hermosillo,Sonora, México</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
@@ -1230,7 +1231,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>HERMOSILLO SONORA CP 83130 MEXICO</Value>
<Value />
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
@@ -1277,18 +1278,13 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Expedido en Sucursal: 2</Value>
<Value>Expedido en Sucursal: </Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Sucursal.Value</Value>
<Style>
@@ -1313,6 +1309,19 @@
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>

File diff suppressed because it is too large Load Diff

View File

@@ -508,14 +508,15 @@
</td>
</tr>
<tr id="TrDescuentoProntoPago" runat="server" visible="false">
<td><b>%Desc. Pronto Pago:</b></td>
<td><b>
<asp:Label ID="Label2" runat="server" Text="%. P. P:" ToolTip="% descuento de pronto pago"></asp:Label></b></td>
<td>
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control " runat="server" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
<asp:TextBox ID="TxtPorcentajeProntoPago" CssClass="form-control input-sm" runat="server" MaxLength="50" Width="80px" ></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." />
</td>
<td><b>Días Crédito:</b></td>
<td>
<asp:TextBox runat="server" ID="TxtDiasCreditoOC" MaxLength="50" Width="80px" Height="28px"></asp:TextBox>
<asp:TextBox runat="server" ID="TxtDiasCreditoOC" CssClass="form-control input-sm" MaxLength="50" Width="45px" Enabled="False"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDiasCreditoOC" FilterType="Custom" ValidChars="0123456789" />
</td>
</tr>

View File

@@ -1078,6 +1078,9 @@ Partial Class OC_OC
DdlSubProyectoGral.Visible = True
TrDescuentoEscalonado.Visible = True
TrDescuentoProntoPago.Visible = True
If UsuarioActual.TienePermisoProceso(401) Then
TxtDiasCreditoOC.Enabled = True
End If
End If

View File

@@ -67,7 +67,11 @@
<asp:ListItem Text="GlobalDTAC" Value="GlobalDTAC"></asp:ListItem>
<asp:ListItem Text="GlobalDTSATUsosCFDI" Value="GlobalDTSATUsosCFDI"></asp:ListItem>
<asp:ListItem Text="GlobalDTVtaCondicionesEntrega" Value="GlobalDTVtaCondicionesEntrega"></asp:ListItem>
<<<<<<< HEAD
<asp:ListItem Text="GlobalDTTipoVenta" Value="GlobalDTTipoVenta"></asp:ListItem>
=======
<asp:ListItem Text="GlobalDTDIOTTipoOperacion" Value="GlobalDTDIOTTipoOperacion"></asp:ListItem>
>>>>>>> 5f99bce007430083b8e29bf39512f4aa4b51efae
</asp:DropDownList>&nbsp;&nbsp;

View File

@@ -111,8 +111,13 @@ Partial Class Sistemas_CatSesiones
CargaUsosCFDI()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVtaCondicionesEntrega" Then
CargaCondicionesEntrega()
<<<<<<< HEAD
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTTipoVenta" Then
CargaTipoVenta()
=======
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTDIOTTipoOperacion" Then
CargaDIOTTipoOperacion()
>>>>>>> 5f99bce007430083b8e29bf39512f4aa4b51efae
End If
@@ -705,6 +710,10 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaDTInvPSSeccionesAlmacen()
GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) = Nothing
End Sub
Private Sub CargaTipoVenta()
GlobalDTTipoVenta(UsuarioActual.CveEmpresa) = Nothing
End Sub
End Class

View File

@@ -3785,6 +3785,10 @@
<asp:CheckBox ID="ChkEstado" runat="server" CssClass="make-switchsd" data-size="small" />
</div>
<div class="form-group" id="DivInfoCompleta" runat="server" visible="false">
Información Completa:
<asp:CheckBox ID="ChkInformacionCompleta" runat="server" CssClass="make-switchsd" data-size="small" />
</div>
<div class="form-group">
Fecha de Captura:

View File

@@ -682,6 +682,9 @@ Partial Class Clientes
RegistraScript("CargaHeader();")
CargaCombosDirecionesClientesSAT()
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
DivInfoCompleta.Visible = True
End If
If UsuarioActual.Empresa.CvePlataforma = 3 Then 'SI ES USUARIO GPS
TabFiscalContable.Visible = True
@@ -1764,6 +1767,8 @@ Partial Class Clientes
End If
ChkInformacionCompleta.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("InformacionCompleta").ToString())
'Horario
TxtHorario.Text = ObjClientes.Horario
TxtObsDiasRevision.Text = ObjClientes.ObservacionRevision
@@ -2574,19 +2579,51 @@ Partial Class Clientes
Alert("El uso del cfdi debe ser <b>'S01 - Sin efectos fiscales'</b> cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'CargaSucursal()
'If UsuarioActual.TienePermisoProceso(170) AndAlso TxtCodigo.Text.Trim = "" Then
' Alert("Es necesario ingresar un Código", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
'Dim rowcodigo As DataTable = GlobalDTCliente.FiltraParametros(String.Format("Codigo='{0}' AND CveEmpresa={1} ", TxtCodigo.Text.Trim, UsuarioActual.CveEmpresa))
'If (Not IsNothing(rowcodigo)) AndAlso (rowcodigo.Rows.Count > 0) AndAlso (rowcodigo.Rows(0)("CveCliente").ToString().Toentero() <> CveCliente) Then
' Alert(String.Format("ya existe un Cliente Con este Codigo '{0}'", TxtCodigo.Text.Trim), TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
End If
Dim InformacionCompleta As Boolean = True
'validación de información completa
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If TxtRFC.Text.Trim() = "" Then InformacionCompleta = False
If ChkPermiteCredito.Checked Then
If TxtLimiteCredito.Text.ToDecimal = 0 OrElse TxtCobranzaContacto.Text.Trim = "" OrElse TxtCobranzaTelefono.Text.Trim = "" OrElse TxtDiasEspecifico.Text.Trim = "" OrElse TxtCobranzaCorreo.Text.Trim = "" Then
InformacionCompleta = False
End If
End If
If TxtContacto.Text.Trim() = "" Then InformacionCompleta = False
If TxtTelefono.Text.Trim() = "" Then InformacionCompleta = False
If TxtEmail.Text.Trim() = "" Then InformacionCompleta = False
If TxtRepresentanteLegal.Text.Trim() = "" Then InformacionCompleta = False
'si es el concepto de pagaré
Dim tPagare As Integer = 0
For Each dRow As GridViewRow In GvDocumentosCliente.Rows
Dim CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToEntero()
If CveDocumentacion = 265 Then tPagare = 1
Next
If tPagare = 0 Then InformacionCompleta = False
tPagare = 0 'valida que cuando menos tenga una cuenta
For Each dRow As GridViewRow In GvBancosCuentas.Rows
tPagare = 1
Next
If tPagare = 0 Then InformacionCompleta = False
'If DivInfoCompleta.Visible Then
' InformacionCompleta = ChkInformacionCompleta.Checked
'End If
End If
'CargaSucursal()
'If UsuarioActual.TienePermisoProceso(170) AndAlso TxtCodigo.Text.Trim = "" Then
' Alert("Es necesario ingresar un Código", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
'Dim rowcodigo As DataTable = GlobalDTCliente.FiltraParametros(String.Format("Codigo='{0}' AND CveEmpresa={1} ", TxtCodigo.Text.Trim, UsuarioActual.CveEmpresa))
'If (Not IsNothing(rowcodigo)) AndAlso (rowcodigo.Rows.Count > 0) AndAlso (rowcodigo.Rows(0)("CveCliente").ToString().Toentero() <> CveCliente) Then
' Alert(String.Format("ya existe un Cliente Con este Codigo '{0}'", TxtCodigo.Text.Trim), TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim ObjClientes As New ClsClientes()
Dim objDoc As New ClsEdocumentacion(ObjClientes.IniciaTransacSQL())
Dim ObjVentas As New ClsVentas(ObjClientes.IniciaTransacSQL())
@@ -2629,8 +2666,6 @@ Partial Class Clientes
Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1))
Dim GeneroCliente As Boolean = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False)
'If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then
' CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0)
' If CvePrecioListaNuevo > 0 Then
@@ -2683,7 +2718,7 @@ Partial Class Clientes
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, Genero:=GeneroCliente,
CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then
CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero(), InformacionCompleta:=InformacionCompleta) Then
CveClienteNuevo = ObjClientes.CveCliente
@@ -2768,7 +2803,7 @@ Partial Class Clientes
CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
NoDesglosaIVA:=Not ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito,
Genero:=GeneroCliente, CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenConsignacion:=DdlAlmacenConsignacion.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked,
EnQuebranto:=ChkEnQuebranto.Checked, EnDemanda:=ChkEnDemanda.Checked, CreditoRegistroFirmas:=TxtNombreFirmas.Text.Trim, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then
EnQuebranto:=ChkEnQuebranto.Checked, EnDemanda:=ChkEnDemanda.Checked, CreditoRegistroFirmas:=TxtNombreFirmas.Text.Trim, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero(), InformacionCompleta:=InformacionCompleta) Then
If Not ObjClientes.LimpiaImpuestosLocales(Me.CveCliente) Then
ErrorProceso = True

View File

@@ -6,6 +6,43 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
div.chksino, span.chksino {
border: 1px solid #B8B8B8;
max-width: 77px;
overflow: hidden;
max-height: 28px;
display: inline-block;
text-align: left;
vertical-align: middle;
}
.chksino label::after {
content: 'No';
padding: 1px;
padding-left: 12px;
padding-right: 12px;
margin-left: 45px;
font-size: 12px !important;
font-weight: normal !important;
display: inline-block;
background: #ececec;
color: #666;
height: 25px;
}
.chksino label::before {
content: 'Si ';
padding: 1px;
padding-left: 15px !important;
padding-right: 14px !important;
font-size: 12px !important;
font-weight: normal !important;
display: inline-block;
background: #428bca;
color: #FFF;
height: 25px;
}
.e-big-btn {
height: 50px;
width: 200px;
@@ -644,26 +681,36 @@
<ContentTemplate>
<div class="chequesie2">
<div class="row">
<label class="col-md-1">Total:</label>
<div class="col-md-3 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporteContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ReadOnly="true" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," />
<div class="col-md-4" style="display: flex; align-items: center;">
<label style="font-weight: bold; font-size: medium;">Total:</label>
<div class="input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporteContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="180px" ReadOnly="true" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," />
</div>
</div>
<label id="lblCambio" class="col-md-1">Cambio:</label>
<div class="col-md-3 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBECambio" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
<br />
</div>
<label id="lblCambio2" class="col-md-1">Sob/falt:</label>
<div class="col-md-3 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtFaltante" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
<br />
<div class="col-md-8">
<div class="row">
<div class="col-md-4" style="display: flex; align-items: center;">
<label id="lblCambio" runat="server" style="font-weight: bold; font-size: medium;">Cambio:</label>
<div class="input-icon">
<i style="margin: 0px;">$</i>
<asp:HiddenField ID="HdnSobranteFaltante" Value="0" ClientIDMode="Static" runat="server" />
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBECambio" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
</div>
</div>
<div class="col-md-8" style="display: flex; align-items: center;">
<label style="font-weight: bold; font-size: medium;">Sob/falt:</label>
&nbsp;
<asp:CheckBox ID="ChkSobFaltante" runat="server" ClientIDMode="Static" />
<div class="input-icon" style="margin-left: 20px;">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtFaltante" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
</div>
</div>
</div>
</div>
</div>
</div>
@@ -1195,8 +1242,8 @@
</div>
<br />
<div class="row">
<div class="col-md-12" style="display:flex; justify-content:end; font-size:16px; font-weight: bold;">
<span> Total: </span>
<div class="col-md-12" style="display: flex; justify-content: end; font-size: 16px; font-weight: bold;">
<span>Total: </span>
<asp:Label ID="LblTotalAnticipos" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
</div>
</div>
@@ -1519,7 +1566,7 @@
let totalTransferencia = $get("TxtImporteTransferencia") ? ToDouble($get("TxtImporteTransferencia").value) : 0;
let totalCobranza = $get("TxtCxCAplicado") ? ToDouble($get("TxtCxCAplicado").value) : 0;
let TotalOtrosContado = 0;
debugger;
let total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia;
if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) {
@@ -1532,12 +1579,26 @@
let totalVenta = $get('HdnTotal').value ? ToDouble($get('HdnTotal').value) : 0 + totalCobranza;// - ToDouble($get('HdnTotal').value);
if (total > totalVenta) {
lblCambio.innerHTML = "Cambio:";
C_lblCambio.innerHTML = "Cambio:";
HdnSobranteFaltante.value = "0";
//HdnCambioFaltante.value = "1";
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
let cambio = total - totalVenta;
if (cambio > 1) {
$get("TxtFaltante").value = "";
$get("ChkSobFaltante").checked = false;
$get("TxtCambio").value = FormatoNumero(cambio);
} else {
$get("TxtFaltante").value = FormatoNumero(cambio);
$get("ChkSobFaltante").checked = true;
$get("TxtCambio").value = FormatoNumero(cambio);
}
} else {
lblCambio.innerHTML = "Faltante:";
//HdnCambioFaltante.value = "0";
C_lblCambio.innerHTML = "Faltante:";
HdnSobranteFaltante.value = "1";
$get("TxtFaltante").value = "";
$get("ChkSobFaltante").checked = false;
$get("TxtCambio").value = FormatoNumero(total - totalVenta, 2);
}
@@ -1556,5 +1617,28 @@
$('#C_LblDiferenciaCajaBloqueo').val(FormatoNumero(total));
}
function CargaSobranteFaltante() {
$('#ChkSobFaltante').change(function () {
if (this.checked == true) {
if (ToDouble($get("TxtCambio").value) > 1) {
alert("El sobrante/faltante no debe ser mayor a 1")
} else {
$get("TxtFaltante").value = $get("TxtCambio").value;
}
}
else {
$get("TxtFaltante").value = "";
}
});
}
jQuery(document).ready(function () {
CargaSobranteFaltante();
Sys.Application.add_load(function (s, e) {
CargaSobranteFaltante();
});
});
</script>
</asp:Content>

View File

@@ -4,10 +4,7 @@ Option Strict On
Imports System.Data
Imports System.IO
Imports System.Net.Http
Imports CrystalDecisions.CrystalReports.Engine
Imports Extensiones
Imports Modelos.Factura
Partial Class Ventas_PVCobranza
Inherits ClsPaginas
@@ -579,8 +576,41 @@ Partial Class Ventas_PVCobranza
Dim VentaContado As Boolean = HdnVentaCondicionesPago.Value = "0"
If VentaContado Then
Dim Faltante As Decimal = 0
Dim Sobrante As Decimal = 0
If ChkSobFaltante.Checked Then
If Not HdnSobranteFaltante.Value.Contiene("0", "1") Then
Alert("Sobrante/Faltante no definido", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If HdnSobranteFaltante.Value = "0" Then
Sobrante = Math.Abs(TxtFaltante.Text.ToDecimal())
End If
If HdnSobranteFaltante.Value = "1" Then
Faltante = Math.Abs(TxtFaltante.Text.ToDecimal())
End If
If Faltante > 1 Then
Alert("El faltante no puede ser mayor a 1.00", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Sobrante > 1 Then
Alert("El sobrante no puede ser mayor a 1.00", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtFaltante.Text.ToDecimal() = 0 Then
Alert("No hay importe para sobrante/faltante", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'validaciones
Dim Pagado As Decimal = TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal + TxtImporteTransferencia.Text.ToDecimal + TxtNCDev.Text.ToDecimal() + TxtImporteOtrosContado.Text.ToDecimal()
Dim Pagado As Decimal = TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal + TxtImporteTransferencia.Text.ToDecimal + TxtNCDev.Text.ToDecimal() + TxtImporteOtrosContado.Text.ToDecimal() + Faltante
If Pagado = 0 Then
Alert("Favor de especificar importe", TipoMensaje.ToastAdventencia)
Exit Sub
@@ -590,7 +620,8 @@ Partial Class Ventas_PVCobranza
Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim PagadoSinEfectivo As Decimal = Pagado - TxtImporteEfectivo.Text.ToDecimal
Dim PagadoSinEfectivo As Decimal = Pagado - TxtImporteEfectivo.Text.ToDecimal - Sobrante
If PagadoSinEfectivo > (LtlSaldo.Text.ToDecimal() + TxtCxCAplicado.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
@@ -619,6 +650,16 @@ Partial Class Ventas_PVCobranza
Exit Sub
End If
End If
End If
Dim SobranteFaltante As Decimal = 0
If ChkSobFaltante.Checked Then
SobranteFaltante = TxtFaltante.Text.ToDecimal()
'SI ES FALTANTE DEBE SER SIEMPRE NEGATIVO
If HdnSobranteFaltante.Value = "1" Then
SobranteFaltante = $"-{Math.Abs(TxtFaltante.Text.ToDecimal())}".ToDecimal()
End If
End If
Dim tCveCorte As Integer = CveCorte
@@ -771,14 +812,14 @@ Partial Class Ventas_PVCobranza
If CvePrePoliza > 0 Then
If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteCredito.Text.ToDecimal > 0 Then
MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto, SobranteFaltante:=SobranteFaltante)
SaldoPendienteVenta -= TxtImporteCredito.Text.ToDecimal
SaldoPendientePagos -= TxtImporteCredito.Text.ToDecimal
PagoAplicado += TxtImporteCredito.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteDebito.Text.ToDecimal > 0 Then
MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto, SobranteFaltante:=SobranteFaltante)
SaldoPendienteVenta -= TxtImporteDebito.Text.ToDecimal
SaldoPendientePagos -= TxtImporteDebito.Text.ToDecimal
PagoAplicado += TxtImporteDebito.Text.ToDecimal
@@ -790,14 +831,14 @@ Partial Class Ventas_PVCobranza
Obs = $"{VentaActual.SerieFolio} - Autorizó: {TxtAutorizo.Text}"
End If
MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim(), CveSubProyecto:=VentaActual.CveSubProyecto)
MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim(), CveSubProyecto:=VentaActual.CveSubProyecto, SobranteFaltante:=SobranteFaltante)
SaldoPendienteVenta -= TxtImporteCheque.Text.ToDecimal
SaldoPendientePagos -= TxtImporteCheque.Text.ToDecimal
PagoAplicado += TxtImporteCheque.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteTransferencia.Text.ToDecimal > 0 Then
MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto, SobranteFaltante:=SobranteFaltante)
SaldoPendienteVenta -= TxtImporteTransferencia.Text.ToDecimal
SaldoPendientePagos -= TxtImporteTransferencia.Text.ToDecimal
PagoAplicado += TxtImporteTransferencia.Text.ToDecimal
@@ -815,7 +856,7 @@ Partial Class Ventas_PVCobranza
CveConceptroOtros = 8
End Select
MsgError = RegistraIE(CveConceptroOtros, DdlCuentaOtrosContado.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteOtrosContado.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
MsgError = RegistraIE(CveConceptroOtros, DdlCuentaOtrosContado.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteOtrosContado.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto, SobranteFaltante:=SobranteFaltante)
SaldoPendienteVenta -= TxtImporteOtrosContado.Text.ToDecimal
SaldoPendientePagos -= TxtImporteOtrosContado.Text.ToDecimal
PagoAplicado += TxtImporteOtrosContado.Text.ToDecimal
@@ -830,12 +871,12 @@ Partial Class Ventas_PVCobranza
PagoEfectivo = SaldoPendientePagos
End If
If SaldoPendienteVenta < 0 Then SaldoPendienteVenta = 0
MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, SaldoPendienteVenta, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, SaldoPendienteVenta, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto, SobranteFaltante:=SobranteFaltante)
SaldoPendienteVenta -= PagoEfectivo
SaldoPendientePagos -= PagoEfectivo
End If
If SaldoPendienteVenta > 0 Then
If SaldoPendienteVenta > 0 AndAlso Not ChkSobFaltante.Checked Then
MsgError = "Tiene saldo pendiente por aplicar"
End If
@@ -910,7 +951,7 @@ Partial Class Ventas_PVCobranza
GuardaLog(ex.ToString())
End Try
If MsgError = "" Then
If MsgError = "" AndAlso Not ChkSobFaltante.Checked Then
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
@@ -918,6 +959,16 @@ Partial Class Ventas_PVCobranza
End If
End If
If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso VentaContado Then
Dim SaldoPendiente As Decimal = 0
If ObjVentas2.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) AndAlso ObjVentas2.DtResultados.Rows.Count > 0 Then
SaldoPendiente = ObjVentas2.DtResultados.FiltroPrimeroValor("Saldo").ToDecimal()
End If
If SaldoPendiente > 0 Then
MsgError = "La factura tiene saldo pendiente por aplicar"
End If
End If
If MsgError = "" Then
ObjVentas2.Commit()
Dim msBuild As New StringBuilder()
@@ -1183,6 +1234,8 @@ Partial Class Ventas_PVCobranza
TxtAutorizo.Text = ""
TxtNCDev.Text = ""
LtlTipoAnticipo.Text = ""
TxtFaltante.Text = ""
ChkSobFaltante.Checked = False
'HdnTipoAmortizacion.Value = ""
CveCliente = -1
CveVendedor = -1
@@ -1614,7 +1667,7 @@ Partial Class Ventas_PVCobranza
Return ObjTimbrado
End Function
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImporteAbonoVenta As Decimal, ImporteBancos 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 = "", Optional CveSubProyecto As Integer = -1) As String
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImporteAbonoVenta As Decimal, ImporteBancos 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 = "", Optional CveSubProyecto As Integer = -1, Optional ByRef SobranteFaltante As Decimal = 0) As String
Dim Retorno As String = ""
If CveBancoCuenta > 0 Then
Dim CveIEPago As Integer = 0
@@ -1626,14 +1679,54 @@ Partial Class Ventas_PVCobranza
Obs = $"{Obs}. Folio: {VentaActual.SerieFolio}"
End If
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteBancos, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
Dim ImporteIE As Decimal = ImporteBancos.ToString().ToDecimal()
Dim Pago As New VentaPago
'SOBRANTE/FALTANTE
If ChkSobFaltante.Checked AndAlso SobranteFaltante <> 0 Then
'SOBRANTE
If SobranteFaltante > 0 Then
'SI ES EL SOBRANTE EN EFECTIVO SUMAR EL SOBRANTE/FALTANTE
If Metodo = 13 Then
ImporteIE += SobranteFaltante
Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal()
'LIMPIAR SOBRANTE/FALTANTE
SobranteFaltante = 0
Else
'AJUSTAR DONDE EL IMPORTE A BANCOS SEA MAYOR EN EL DE LA VENTA
If ImporteBancos.RoundSQL(2) >= ImporteAbonoVenta.RoundSQL(2) Then
Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal()
'LIMPIAR SOBRANTE/FALTANTE
SobranteFaltante = 0
End If
End If
End If
'FALTANTE
If SobranteFaltante < 0 Then
'METER LO QUE FALTA COMO GASTO
If (ImporteBancos.RoundSQL(2) + Math.Abs(SobranteFaltante)) = ImporteAbonoVenta.RoundSQL(2) Then
Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal()
'LIMPIAR SOBRANTE/FALTANTE
SobranteFaltante = 0
'SUMAR AL PAGO
If ImporteBancos < ImporteAbonoVenta Then
ImporteBancos += Math.Abs(SobranteFaltante)
End If
End If
End If
End If
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
If CveIEPago > 0 Then
Dim tImportePago As Decimal = If(ImporteBancos > ImporteAbonoVenta, ImporteAbonoVenta, ImporteBancos) 'toma el importe menor para la factura
If ImporteBancos > 0 Then
Dim Pago As New VentaPago
If ImporteIE > 0 Then
Pago.ImportePagoVenta = tImportePago
Pago.ImportePago = ImporteBancos
Pago.ImportePago = ImporteIE
Pago.CveIE = CveIEPago
Pago.CveMonedaPago = VentaActual.CveMoneda
Pago.Fecha = NowADS()

View File

@@ -317,6 +317,11 @@ Partial Class RepVentasDetalle
DdlGrupo.Items.Insert(12, New ListItem("Año/Mes Ejec.", "13"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
If UsuarioActual.Empresa.Funcionalidad(307) <> "" Then DdlGrupo.Items.Insert(10, New ListItem(UsuarioActual.Empresa.Funcionalidad(307), "23"))
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlGrupo.Items.Insert(13, New ListItem("Tipo Venta", "24"))
DdlGrupo.DataBind()
End Sub

View File

@@ -8371,6 +8371,24 @@ Partial Class Ventas
LblEnviarMail.Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim ObjClie As New ClsClientes
If ObjClie.GetClienteInformacionCompleta(CveCliente, UsuarioActual.CveEmpresa) Then
If Not CBool(ObjClie.DtResultados.FiltroPrimeroValor("InformacionCompleta")) Then
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", "Información incompleta")
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
TieneBloqueoPorCreditoVencimiento = 1
End If
End If
ObjClie.Dispose()
End If
End Sub