-
This commit is contained in:
198
Ventas/CatCobranzaEstatus.aspx
Normal file
198
Ventas/CatCobranzaEstatus.aspx
Normal file
@@ -0,0 +1,198 @@
|
||||
<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCobranzaEstatus.aspx.vb" Inherits="Vta_CatCobranzaEstatus" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo Cobranza Estatus
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UPAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarEstatus" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Estado de Cobranza" Text="<i class='fa fa-plus'></i> Agregar Estatus"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarEstatusTurno" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Estado de Cobranza" Text="<i class='fa fa-plus'></i> Agregar Turno"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<ajax:TabContainer runat="server" ActiveTabIndex="0" Width="100%" CssClass="tabBodyOverride">
|
||||
<ajax:TabPanel runat="server" ID="TabCatalogo" HeaderText="Estatus">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCobranzaEstatus,CobranzaEstatus,Estatus,FechaIng" EmptyDataText="No se encontraron estatus de cobranza" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CobranzaEstatus" HeaderText="Estatus cobranza" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" 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" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabPanel1" HeaderText="Estatus Turno">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDatosTurno" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosTurno" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCobranzaEstatusTurno,CobranzaEstatusTurno,Estatus,FechaIng" EmptyDataText="No se encontraron estatus de cobranza" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CobranzaEstatusTurno" HeaderText="Estatus cobranza turno" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgETurno" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="EditTurno_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgDTurno" runat="server" 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" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
|
||||
<div id="divAddEstatusCobranza" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddEstatus" class="modal-content" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Estados de Cobranza</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatusCobranza" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusCobranza" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEstatusCobranza" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtEstatusCobranza.ClientID.ToString()%>">Estatus de Cobranza:</label>
|
||||
</div>
|
||||
<br />
|
||||
<div id="CheckActiveSection" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Estado:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnAgregarEstatusCobranza" runat="server" class="btn btn-success" Text="Agregar" />
|
||||
<%--<asp:LinkButton ID="BtnAgregarEstatusOS" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>--%>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divAddEstatusCobranzaTurno" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddEstatusTurno" class="modal-content" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabelTurno">Estados de turno de cobranza</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatusCobranzaTurno" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusCobranzaTurno" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEstatusCobranzaTurno" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtEstatusCobranzaTurno.ClientID.ToString()%>">Estatus de Cobranza:</label>
|
||||
</div>
|
||||
<br/>
|
||||
<div id="Div1" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatusTurno">Estado:</label>
|
||||
<asp:CheckBox ID="ChkEstatusTurno" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
|
||||
<i></i>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterTurno" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnAgregarEstatusCobranzaTurno" runat="server" class="btn btn-success" Text="Agregar" />
|
||||
<%--<asp:LinkButton ID="BtnAgregarEstatusOS" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>--%>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#divAddImpuestoLocal').modal();
|
||||
}
|
||||
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#C_GvDatos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#C_GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
|
||||
function SetObjects(Clasificacion) {
|
||||
debugger;
|
||||
document.getElementById(TxtEstatusOS).value = Clasificacion;
|
||||
}
|
||||
|
||||
function SetValue(Hidden, Value) {
|
||||
document.getElementById(Hidden).value = Value;
|
||||
}
|
||||
|
||||
function LimpiaModal() {
|
||||
<%--$('#<%= TxtEstatusOS.ClientID %>').val('');
|
||||
$('#<%= ChkEstatus.ClientID %>').prop("checked", false);--%>
|
||||
|
||||
var $example = $(".js-Impuesto-programmatic").select2();
|
||||
$example.val('1').trigger("change");
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
162
Ventas/CatCobranzaEstatus.aspx.vb
Normal file
162
Ventas/CatCobranzaEstatus.aspx.vb
Normal file
@@ -0,0 +1,162 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Vta_CatCobranzaEstatus
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCobranzaEstatus As Integer
|
||||
Get
|
||||
Return ViewState("CveCobranzaEstatus").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCobranzaEstatus") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveCobranzaEstatusTurno As Integer
|
||||
Get
|
||||
Return ViewState("CveCobranzaEstatusTurno").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCobranzaEstatusTurno") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub page_load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
CargaDatosTurno()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetCobranzaEstatus(UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatus_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatus.Click
|
||||
TxtEstatusCobranza.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
BtnAgregarEstatusCobranza.Text = "Agregar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranza"))
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveCobranzaEstatus = GvRow.DataKey("CveCobranzaEstatus").ToEntero
|
||||
TxtEstatusCobranza.Text = GvRow.DataKey("CobranzaEstatus").ToString
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus")
|
||||
BtnAgregarEstatusCobranza.Text = "Actualizar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranza"))
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusCobranza_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusCobranza.Click
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If BtnAgregarEstatusCobranza.Text = "Agregar" Then
|
||||
If ObjVentas.AddCobranzaEstatus(TxtEstatusCobranza.Text, UsuarioActual.CveEmpresa, ChkEstatus.Checked, UsuarioActual.CveUsuario) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranza"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Else
|
||||
Alert("Error al agregar")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateCobranzaEstatus(CveCobranzaEstatus, TxtEstatusCobranza.Text, ChkEstatus.Checked) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranza"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Else
|
||||
Alert("Error al actualizar")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveCobranzaEstatus").ToEntero
|
||||
|
||||
If ObjVentas.RemoveCobranzaEstatus(CveEstatusOrdenServicio) Then
|
||||
GvDatos.EditIndex = -1
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Alert("Estatus de cobranza eliminado")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosTurno()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetCobranzaTurnoEstatus(-1, UsuarioActual.CveEmpresa) Then
|
||||
GvDatosTurno.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatosTurno.DataBind()
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusTurno_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusTurno.Click
|
||||
TxtEstatusCobranzaTurno.Text = ""
|
||||
ChkEstatusTurno.Checked = True
|
||||
BtnAgregarEstatusCobranzaTurno.Text = "Agregar"
|
||||
UpAddEstatusTurno.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranzaTurno"))
|
||||
End Sub
|
||||
|
||||
Public Sub EditTurno_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveCobranzaEstatusTurno = GvRow.DataKey("CveCobranzaEstatusTurno").ToEntero
|
||||
TxtEstatusCobranzaTurno.Text = GvRow.DataKey("CobranzaEstatusTurno").ToString
|
||||
ChkEstatusTurno.Checked = GvRow.DataKey("Estatus")
|
||||
BtnAgregarEstatusCobranzaTurno.Text = "Actualizar"
|
||||
UpAddEstatusTurno.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranzaTurno"))
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusCobranzaTurno_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusCobranzaTurno.Click
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If BtnAgregarEstatusCobranzaTurno.Text = "Agregar" Then
|
||||
If ObjVentas.AddCobranzaEstatusTurno(TxtEstatusCobranzaTurno.Text, UsuarioActual.CveEmpresa, ChkEstatusTurno.Checked, UsuarioActual.CveUsuario) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranzaTurno"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatosTurno()
|
||||
UpDatosTurno.Update()
|
||||
Else
|
||||
Alert("Error al agregar")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateCobranzaEstatusTurno(CveCobranzaEstatusTurno, TxtEstatusCobranzaTurno.Text, ChkEstatusTurno.Checked) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranzaTurno"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatosTurno()
|
||||
UpDatosTurno.Update()
|
||||
Else
|
||||
Alert("Error al actualizar")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosTurno_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosTurno.RowDeleting
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatosTurno.Rows(e.RowIndex).DataKey("CveCobranzaEstatusTurno").ToEntero
|
||||
|
||||
If ObjVentas.RemoveCobranzaEstatusTurno(CveEstatusOrdenServicio) Then
|
||||
GvDatosTurno.EditIndex = -1
|
||||
CargaDatosTurno()
|
||||
UpDatosTurno.Update()
|
||||
Alert("Turno de estatus de cobranza eliminado")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -3902,7 +3902,7 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente se correo se anexa su estado actual de cartera en {1}.<br />
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente del correo se anexa su estado actual de cartera en {1}.<br />
|
||||
<br />
|
||||
Quedamos a sus ordenes para cualquier duda o aclaración con su agente de Ventas.<br />
|
||||
<br />
|
||||
@@ -3910,7 +3910,7 @@ Partial Class Clientes
|
||||
Gracias por la atención brindada al presente.<br /> Reciba un cordial saludo.<br />
|
||||
<br />
|
||||
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo2(File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True))
|
||||
Hilo.Start()
|
||||
Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion)
|
||||
Catch ex As Exception
|
||||
@@ -3977,7 +3977,7 @@ Partial Class Clientes
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub MandaCorreo2(File As Byte(), Para As String, Asunto As String, Body As String)
|
||||
Private Sub MandaCorreoEstadoCuenta(File As Byte(), Para As String, Asunto As String, Body As String, Optional GuardarBitacora As Boolean = False)
|
||||
|
||||
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
|
||||
'a.GuardaLog()
|
||||
@@ -3986,11 +3986,17 @@ Partial Class Clientes
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
|
||||
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
|
||||
If Envio AndAlso GuardarBitacora Then
|
||||
Using ObjBitacora As New ClsOIEventos
|
||||
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Me.CveCliente)
|
||||
End Using
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "E N V I O C O R R E O"
|
||||
Private Sub EnviaCorreo(Liga As String, LigaActivar As String)
|
||||
|
||||
@@ -5731,7 +5737,8 @@ Partial Class Clientes
|
||||
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
|
||||
a.GuardaLog()
|
||||
Dim Mail As New ClsSisMail()
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
|
||||
Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnCobranzaSMS_Click(sender As Object, e As EventArgs)
|
||||
Dim Telefono = CobranzaTelefono
|
||||
|
||||
@@ -2840,7 +2840,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%">
|
||||
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVFolioGarantia" runat="server" ControlToValidate="DdlFolioGarantia" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFolioGarantia" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolioGarantia"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
@@ -5427,6 +5427,16 @@ Partial Class PV
|
||||
RegistraScript("Recalcula();", "Recalcula")
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFolioGarantia.SelectedIndexChanged
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
|
||||
Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo")
|
||||
TxtConsecutivoAjuste.Text = resultado
|
||||
UpAjuste.Update()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "U S A D O S"
|
||||
|
||||
@@ -9,6 +9,7 @@ Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Security.Cryptography.X509Certificates
|
||||
Imports System.Globalization
|
||||
Imports System.Net.Http
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class Ventas
|
||||
Inherits ClsPaginas
|
||||
@@ -5330,6 +5331,11 @@ Partial Class Ventas
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString)
|
||||
End If
|
||||
|
||||
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
|
||||
If CveVenta <= 0 Then
|
||||
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
|
||||
End If
|
||||
|
||||
UPPVentas.Update()
|
||||
UpEstatus.Update()
|
||||
UPCondicionesPago.Update()
|
||||
@@ -5733,7 +5739,6 @@ Partial Class Ventas
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(169) Then ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
|
||||
Dim CvePS As Integer = DatarowPS("CvePS").ToString.ToEntero
|
||||
Dim CveTipoPS As Integer = DatarowPS("CveTipoPS").ToString.ToEntero
|
||||
|
||||
CantidadInventario = GvPS.Rows(e.RowIndex).DataKey("CantidadInventario").ToString.ToDecimal
|
||||
|
||||
@@ -5743,7 +5748,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia As Decimal
|
||||
If ValidaExistencia Then
|
||||
@@ -10646,7 +10651,7 @@ Partial Class Ventas
|
||||
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
|
||||
|
||||
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E8")
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
|
||||
|
||||
If CveMovimientoInventario <= 0 Then
|
||||
OcurrioError = True
|
||||
@@ -12655,8 +12660,8 @@ Partial Class Ventas
|
||||
Dim Fecha As Date = Now
|
||||
|
||||
'Creamos el movimiento de entrada y el movimiento de salida
|
||||
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E1")
|
||||
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E2")
|
||||
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
|
||||
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
|
||||
|
||||
If CveMovimientoInventarioEntrada > 0 AndAlso CveMovimientoInventarioSalida > 0 Then
|
||||
|
||||
@@ -15308,7 +15313,6 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then
|
||||
'Le damos salida normal
|
||||
If ConSalida Then
|
||||
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
@@ -15318,14 +15322,9 @@ Partial Class Ventas
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, ObjFactura) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
'Le damos salida de apartado por traspaso
|
||||
@@ -15350,12 +15349,7 @@ Partial Class Ventas
|
||||
If ConSalida AndAlso Not OcurrioError Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, ObjFactura) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
@@ -15487,7 +15481,7 @@ Partial Class Ventas
|
||||
|
||||
'Creamos el movimiento
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
|
||||
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E3")
|
||||
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E")
|
||||
|
||||
If CveMovimientoInventario > 0 Then
|
||||
|
||||
@@ -15611,119 +15605,61 @@ Partial Class Ventas
|
||||
'Return Not OcurrioError
|
||||
|
||||
End Function
|
||||
Private Function GenerarMovimientoAlmacenVirtual(ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Integer
|
||||
Private Function GenerarMovimientoAlmacenVirtual(CveRemision As Integer, ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Boolean
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim CveMovimientoVirtual As Integer = -1
|
||||
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
||||
Try
|
||||
Dim CveMovimientoVirtual As Integer = -1
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
Dim CveConceptoMovimientoVirtual As Integer = 3
|
||||
Dim DtPSVirtual As DataTable = Nothing
|
||||
Dim DtTamanios As DataTable = Nothing
|
||||
Dim CveMovimientoEntradaDev As Integer = -1
|
||||
|
||||
Dim DtTamanios As DataTable = Nothing
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
||||
DtTamanios = ObjAcumuladores.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 2 AND CveVenta > 0")
|
||||
|
||||
Dim CveConceptoMovimientoVirtual As Integer = 3
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
|
||||
For Each GvRow As DataRow In ObjFactura.DtDetalle.Rows
|
||||
For Each Tam As DataRow In DtTamanios.Rows
|
||||
If Tam("CveTamaño").ToString() = GvRow("CveTamaño").ToString() Then
|
||||
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
|
||||
Dim Row As DataRow = DtPSVirtual.NewRow()
|
||||
|
||||
Row("CvePS") = CvePSCargo
|
||||
Row("Cantidad") = GvRow("Cantidad").ToString().ToDecimal()
|
||||
Row("PU") = 0
|
||||
Row("CveUM") = GvRow("CveUM").ToString().ToEntero()
|
||||
|
||||
DtPSVirtual.Rows.Add(Row)
|
||||
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={ObjFactura.CveSubProyecto}").ToEntero()
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 Then
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/E4")
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
|
||||
CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados.Copy()
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V")
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el almacen virtual.", ex)
|
||||
OcurrioError = True
|
||||
End If
|
||||
End Try
|
||||
|
||||
If DtPSVirtual.Rows.Count = 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
'Dim ContadorMovtosDetalles = 0
|
||||
|
||||
'Dim DtMovDetalle As DataTable = Nothing
|
||||
'If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
' DtMovDetalle = ObjInventario.DtResultados.Copy()
|
||||
'End If
|
||||
|
||||
''Creamos el movimiento
|
||||
'Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 2, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
'If CveMovimientoInventario > 0 Then
|
||||
|
||||
' 'Agregamos los detalles
|
||||
' For Each MovDet As DataRow In DtMovDetalle.Rows
|
||||
' Dim Cantidad = MovDet("Cantidad").ToString.ToDecimal
|
||||
' Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero
|
||||
' Dim PU As Decimal = MovDet("PU").ToString.ToDecimal
|
||||
' Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero
|
||||
' Dim SerieLote As String = MovDet("SerieLote").ToString
|
||||
|
||||
' If Cantidad < 0 Then
|
||||
' Alert("Ocurrió un Error al generar los movimientos de almacén. Por favor comuniquese con atención SIG.", TipoMensaje.MsgError)
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote) Then
|
||||
' ContadorMovtosDetalles += 1
|
||||
' Else
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'VALIDA QUE SE HALLAN AGREGADO DETALLES AL MOVIMIENTO
|
||||
' If ContadorMovtosDetalles = 0 Then
|
||||
' OcurrioError = True
|
||||
' End If
|
||||
|
||||
'Else
|
||||
' OcurrioError = True
|
||||
'End If
|
||||
|
||||
If OcurrioError Then
|
||||
Return -1
|
||||
Else
|
||||
Return CveMovimientoVirtual
|
||||
End If
|
||||
Return Not OcurrioError
|
||||
|
||||
End Function
|
||||
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
|
||||
@@ -19470,7 +19406,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'MOVIMIENTO DE SALIDA POR TRASPASO DEL ALMACEN DE CONSIGNACION
|
||||
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E5")
|
||||
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
|
||||
If CveMovimientoSalidaConsignacion > 0 Then
|
||||
Dim CveProducto As Integer
|
||||
Dim CveUnidad As Integer
|
||||
@@ -19513,7 +19449,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'ENTRADA POR TRASPASO A GENERAL
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E6")
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E")
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
@@ -19527,7 +19463,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SALIDA GENERAL
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
@@ -23809,49 +23745,65 @@ Partial Class Ventas
|
||||
CargaRNC()
|
||||
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
|
||||
End Sub
|
||||
Protected Function GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) As Boolean
|
||||
Dim obj As New Modelos.MPolizaVentaWS
|
||||
'DATOS DEL CLIENTE
|
||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||
obj.customer_last_name1 = ""
|
||||
obj.customer_last_name2 = ""
|
||||
obj.customer_birthday = Nothing
|
||||
obj.customer_phone = ObjFactura.Cliente.Telefono
|
||||
obj.customer_email = ObjFactura.Cliente.Mail
|
||||
obj.customer_gender = "03" 'OTRO GENERO
|
||||
obj.customer_advertising = False
|
||||
obj.customer_car_brand = "00"
|
||||
obj.customer_car_model = "00"
|
||||
obj.customer_car_year = ObjFactura.Fecha.Year
|
||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetGarantiasDetalle(ObjFactura.CveVenta) Then
|
||||
DtUsados = ObjAcum.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
Try
|
||||
For Each Row As DataRow In DtUsados.Rows
|
||||
Dim obj As New Modelos.MPolizaVentaWS
|
||||
'DATOS DEL CLIENTE
|
||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||
obj.customer_last_name1 = ""
|
||||
obj.customer_last_name2 = ""
|
||||
obj.customer_birthday = Nothing
|
||||
obj.customer_phone = ObjFactura.Cliente.Telefono
|
||||
obj.customer_email = ObjFactura.Cliente.Mail
|
||||
obj.customer_gender = "03" 'OTRO GENERO
|
||||
obj.customer_advertising = False
|
||||
obj.customer_car_brand = "00"
|
||||
obj.customer_car_model = "00"
|
||||
obj.customer_car_year = ObjFactura.Fecha.Year
|
||||
|
||||
'DATOS DE VENTA
|
||||
obj.sale_date = Now
|
||||
obj.sale_paidby = "01"
|
||||
obj.sale_type = "01" 'PISO
|
||||
obj.sale_type_service = "01" 'PARTICULAR
|
||||
obj.sale_total = ObjFactura.Total
|
||||
obj.sale_discount = ObjFactura.SubTotal
|
||||
obj.sale_id = ObjFactura.CveVenta.ToString()
|
||||
'DATOS DE VENTA
|
||||
obj.sale_date = ObjFactura.Fecha
|
||||
obj.sale_paidby = "01"
|
||||
obj.sale_type = "01" 'PISO
|
||||
obj.sale_type_service = "02" 'COMERCIAL
|
||||
obj.sale_total = ObjFactura.Total
|
||||
obj.sale_discount = ObjFactura.Descuento
|
||||
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
||||
|
||||
'DATOS DEL PRODUCTO
|
||||
obj.product_code = "174925"
|
||||
obj.product_unique_code = "65047187"
|
||||
obj.product_sale_type = "02" 'AJUSTE
|
||||
'DATOS DEL PRODUCTO
|
||||
obj.product_code = Row("Code17").ToString()
|
||||
obj.product_unique_code = "" 'se indique el código único de la batería.
|
||||
obj.product_sale_type = "01 " 'VENTA
|
||||
|
||||
'DATOS DE USADO
|
||||
obj.used_product = True
|
||||
obj.used_brand = "01"
|
||||
obj.used_bci = "25"
|
||||
obj.used_month = 1
|
||||
obj.used_year = 2015
|
||||
obj.used_sale_date = ObjFactura.Fecha
|
||||
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
|
||||
|
||||
Return False
|
||||
'EnviarPolizaVentaWS(obj)
|
||||
End Function
|
||||
'DATOS DE USADO
|
||||
obj.used_product = True
|
||||
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
|
||||
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
|
||||
obj.used_month = FechaUsado.Month
|
||||
obj.used_year = FechaUsado.Year
|
||||
obj.used_sale_date = FechaUsado
|
||||
|
||||
Protected Sub EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS)
|
||||
Dim Retorno As String = "[]"
|
||||
EnviarPolizaVentaWS(obj)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Function EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Respuesta As String = "[]"
|
||||
|
||||
Dim User As String = "cslth.2809@jcilink.com"
|
||||
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
|
||||
@@ -23895,14 +23847,30 @@ Partial Class Ventas
|
||||
Dim content As New FormUrlEncodedContent(Parametros)
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
|
||||
Retorno = response.Content.ReadAsStringAsync().Result
|
||||
Respuesta = response.Content.ReadAsStringAsync().Result
|
||||
|
||||
Dim resp = JArray.Parse(Respuesta)
|
||||
|
||||
If resp.Count > 0 Then
|
||||
Dim Msg = resp(0)("Descripcion").ToString()
|
||||
|
||||
If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508") Then
|
||||
Alert(Msg, TipoMensaje.MsgInformacion)
|
||||
Retorno = True
|
||||
Else
|
||||
Alert(Msg, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
Alert("No se envió la poliza virtual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.Message)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user