Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3921,7 +3921,7 @@ Public Class ClsGenerales
|
||||
|
||||
Public Function UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, CveEmpresa As Integer,
|
||||
Optional FechaLlegada As DateTime = MinFecha, Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1, Optional Distancia As Integer = -1,
|
||||
Optional CveConfigAutoTransporte As Integer = -1) As Boolean
|
||||
Optional CveConfigAutoTransporte As Integer = -1, Optional FolioReferencia As String = "-1", Optional Referencia As String = "-1", Optional CveSubProyecto As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_EntregaAlmacenRutaUpdate")
|
||||
|
||||
@@ -3941,6 +3941,9 @@ Public Class ClsGenerales
|
||||
.Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2
|
||||
.Add("@Distancia", SqlDbType.Int).Value = Distancia
|
||||
.Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte
|
||||
.Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
|
||||
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -10374,6 +10374,7 @@ Namespace Modelos
|
||||
Public Property CveCliente As Integer
|
||||
Public Property Nombre As String
|
||||
Public Property NombreComercial As String
|
||||
Public Property RegimenSociedad As String
|
||||
Public Property Codigo As String
|
||||
Public Property Direccion As String
|
||||
Public Property NoExt As String
|
||||
|
||||
@@ -1865,6 +1865,11 @@ Partial Class PopUpVerFactura
|
||||
Dim SelloCFDi As String = ""
|
||||
Dim SelloSAT As String = ""
|
||||
Dim TipoDocto As String = ""
|
||||
Dim PermisoSCTR1 As String = ""
|
||||
Dim PermisoSCTR2 As String = ""
|
||||
Dim ConfATR1 As String = ""
|
||||
Dim ConfATR2 As String = ""
|
||||
|
||||
|
||||
Dim ObjInv As New ClsGenerales
|
||||
|
||||
@@ -1875,6 +1880,14 @@ Partial Class PopUpVerFactura
|
||||
SerieFolio = Dr("SerieFolio").ToString
|
||||
Telefono = Dr("FiguraTelefono").ToString
|
||||
TipoDocto = Dr("TipoDocto").ToString
|
||||
|
||||
If UsuarioActual.CveEmpresa = 13 Then
|
||||
PermisoSCTR1 = Dr("PermisoSCTR1").ToString
|
||||
PermisoSCTR2 = Dr("PermisoSCTR2").ToString
|
||||
ConfATR1 = Dr("ConfATR1").ToString
|
||||
ConfATR2 = Dr("ConfATR2").ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -2244,9 +2257,18 @@ Partial Class PopUpVerFactura
|
||||
|
||||
params.Add(New ReportParameter("RemolquePlaca1", RemolquePlaca1))
|
||||
params.Add(New ReportParameter("RemolqueSubtimo1", RemolqueSubtimo1))
|
||||
|
||||
params.Add(New ReportParameter("RemolquePlaca2", RemolquePlaca2))
|
||||
params.Add(New ReportParameter("RemolqueSubtimo2", RemolqueSubtimo2))
|
||||
|
||||
If UsuarioActual.CveEmpresa = 13 Then
|
||||
params.Add(New ReportParameter("PermisoSCTRemolque1", PermisoSCTR1))
|
||||
params.Add(New ReportParameter("PermisoSCTRemolque2", PermisoSCTR2))
|
||||
params.Add(New ReportParameter("ConfATR1", ConfATR1))
|
||||
params.Add(New ReportParameter("ConfATR2", ConfATR2))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' [@CertificadoContribuyente]
|
||||
'[@CadenaOriginal]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -452,7 +452,7 @@
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<Format>#,0</Format>
|
||||
<Format>#,0.00</Format>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
@@ -1744,9 +1744,51 @@
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Permiso SCT:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!PermisoSCTRemolque1.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Config. Vehicular:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!ConfATR1.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox38</rd:DefaultName>
|
||||
<Top>4.01548cm</Top>
|
||||
<Top>3.95198cm</Top>
|
||||
<Left>0.06623cm</Left>
|
||||
<Height>0.35631cm</Height>
|
||||
<Width>9.62118cm</Width>
|
||||
@@ -1809,9 +1851,51 @@
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Permiso SCT:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!PermisoSCTRemolque2.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Config. Vehicular:</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value>=Parameters!ConfATR2.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox38</rd:DefaultName>
|
||||
<Top>4.01548cm</Top>
|
||||
<Top>3.95198cm</Top>
|
||||
<Left>9.72269cm</Left>
|
||||
<Height>0.35631cm</Height>
|
||||
<Width>10.7292cm</Width>
|
||||
@@ -4002,7 +4086,7 @@
|
||||
<PrintOnLastPage>true</PrintOnLastPage>
|
||||
<ReportItems>
|
||||
<Line Name="Line1">
|
||||
<Top>0.03522cm</Top>
|
||||
<Top>0.03521cm</Top>
|
||||
<Left>0.06623cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>20.38566cm</Width>
|
||||
@@ -4032,7 +4116,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox13</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>0.71425cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>1.55632cm</Width>
|
||||
@@ -4066,7 +4150,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>2.27057cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>4.96223cm</Width>
|
||||
@@ -4101,7 +4185,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox13</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>7.33864cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>2.84562cm</Width>
|
||||
@@ -4136,7 +4220,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.14105cm</Top>
|
||||
<Top>0.14104cm</Top>
|
||||
<Left>10.18425cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>4.68641cm</Width>
|
||||
@@ -4170,7 +4254,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.14458cm</Top>
|
||||
<Top>0.14457cm</Top>
|
||||
<Left>14.99343cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>4.04906cm</Width>
|
||||
@@ -4202,7 +4286,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox14</rd:DefaultName>
|
||||
<Top>0.68813cm</Top>
|
||||
<Top>0.68812cm</Top>
|
||||
<Left>0.71425cm</Left>
|
||||
<Height>0.54708cm</Height>
|
||||
<Width>6.21751cm</Width>
|
||||
@@ -4685,6 +4769,30 @@
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="PermisoSCTRemolque1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="PermisoSCTRemolque2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="ConfATR1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="ConfATR2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
</ReportParameters>
|
||||
<Language>es-MX</Language>
|
||||
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
|
||||
|
||||
@@ -662,14 +662,14 @@
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="SATClaveProdServ">
|
||||
<Textbox Name="Codigo1">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Fields!SATClaveProdServ.Value</Value>
|
||||
<Value>=Fields!Codigo.Value</Value>
|
||||
<Style>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
@@ -680,7 +680,7 @@
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>SATClaveProdServ</rd:DefaultName>
|
||||
<rd:DefaultName>Codigo1</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Color>LightGrey</Color>
|
||||
@@ -736,14 +736,14 @@
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Codigo">
|
||||
<Textbox Name="SATClaveProdServ">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Fields!Codigo.Value</Value>
|
||||
<Value>=Fields!SATClaveProdServ.Value</Value>
|
||||
<Style>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
@@ -754,7 +754,7 @@
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Codigo</rd:DefaultName>
|
||||
<rd:DefaultName>SATClaveProdServ</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Color>LightGrey</Color>
|
||||
@@ -3269,6 +3269,18 @@
|
||||
<Parameter Name="NumTotalMercancias">
|
||||
<Value>=Parameters!SRP_NumTotalMercancias.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="PermisoSCTRemolque1">
|
||||
<Value>=Parameters!SRP_PermisoSCTRemolque1.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="PermisoSCTRemolque2">
|
||||
<Value>=Parameters!SRP_PermisoSCTRemolque2.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="ConfATR1">
|
||||
<Value>=Parameters!SRP_ConfATR1.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="ConfATR2">
|
||||
<Value>=Parameters!SRP_ConfATR2.Value</Value>
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
<Top>0.06863cm</Top>
|
||||
<Height>1.11461cm</Height>
|
||||
@@ -4662,6 +4674,30 @@
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_PermisoSCTRemolque1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_PermisoSCTRemolque2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_ConfATR1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_ConfATR2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
</ReportParameters>
|
||||
<EmbeddedImages>
|
||||
<EmbeddedImage Name="Logo">
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
|
||||
|
||||
<asp:GridView ID="gvR" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvR_RowDataBound"
|
||||
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyecto,Estatus,CveTimbre"
|
||||
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyecto,Estatus,CveTimbre,CveCliente,FolioReferencia,Referencia"
|
||||
EmptyDataText="No se encontraron registros"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
|
||||
@@ -738,12 +738,14 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
|
||||
int CveDireccionOrigen = GvRow.DataKey("CveDireccionOrigen").ToEntero();
|
||||
int CveClienteEnvio = -1;
|
||||
string NombreCliente = "";
|
||||
ClsClientes ObjClientes = new ClsClientes();
|
||||
DataTable DtTempDirecciones = new DataTable();
|
||||
|
||||
if (ObjClientes.DireccionEnvioGet(CveDireccionOrigen, -1, -1))
|
||||
{
|
||||
CveClienteEnvio = ObjClientes.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero();
|
||||
CveClienteEnvio = ObjClientes.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero();
|
||||
NombreCliente = ObjClientes.DtResultados.FiltroPrimeroValor("NombreCliente");
|
||||
|
||||
if (ObjClientes.DireccionEnvioGet(-1, CveClienteEnvio, -1))
|
||||
{
|
||||
@@ -756,8 +758,12 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
DdlmodalRecoleccionDireccion.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||
DdlmodalRecoleccionDireccion.SelectedValueExist(CveDireccionOrigen);
|
||||
|
||||
//DdlModalRecoleccionCliente.SelectedValueExist(CveClienteEnvio);
|
||||
DdlModalRecoleccionCliente.SelectedValue = CveClienteEnvio.ToString();
|
||||
DdlModalRecoleccionCliente.SelectedText = NombreCliente;
|
||||
|
||||
DdlSubProyectoRecoleccion.SelectedValueExist(GvRow.DataKey("CveSubProyecto"));
|
||||
TxtFolioReferencia.Text = GvRow.DataKey("FolioReferencia");
|
||||
TxtReferencia.Text = GvRow.DataKey("Referencia");
|
||||
|
||||
CargaDatosRecoleccionDetallePS();
|
||||
|
||||
@@ -778,7 +784,14 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
DdlModalRecoleccionUnidad.Items.Clear();
|
||||
DdlModalRecoleccionUnidad.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||
DdlProducto2.txtValue.Value = "";
|
||||
DdlProducto2.txtText.Value = "";
|
||||
DdlProducto2.txtText.Value = "";
|
||||
|
||||
DdlSubProyectoRecoleccion.SelectedValueExist("-1");
|
||||
DdlModalRecoleccionCliente.SelectedValue = "-1";
|
||||
DdlModalRecoleccionCliente.SelectedText = "Seleccione";
|
||||
|
||||
TxtFolioReferencia.Text = "";
|
||||
TxtReferencia.Text = "";
|
||||
|
||||
DTRecoleccion.Rows.Clear();
|
||||
GvModalPSRecoleccion.DataSource = DTRecoleccion;
|
||||
@@ -843,7 +856,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcesoOK = ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen, DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa);
|
||||
ProcesoOK = ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen, DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, DdlChoferRec.SelectedValue.ToEntero(), DdlUnidadRec.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa,FolioReferencia:TxtFolioReferencia.Text,Referencia: TxtReferencia.Text,CveSubProyecto: DdlSubProyectoRecoleccion.SelectedValue.ToEntero());
|
||||
}
|
||||
|
||||
if (ProcesoOK)
|
||||
|
||||
@@ -4461,7 +4461,7 @@ Partial Class PV
|
||||
If CvePS.Contiene(402917, 402918) Then
|
||||
PUPromocion = 40D
|
||||
End If
|
||||
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
||||
PUModificado = Math.Round(PUPromocion / (1 + PorcentajeIVA), 6)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -478,17 +478,23 @@ Partial Class Ventas_RepVentas
|
||||
If Anio > 0 AndAlso Mes > 0 Then
|
||||
Dim lastDayOfMonth = DateTime.DaysInMonth(Anio, Mes)
|
||||
|
||||
Dim Dia As Integer = FechaFRef.Day
|
||||
Dim DiaFinal As Integer = FechaFRef.Day
|
||||
|
||||
If e.Row.DBCampo("Mes").ToEntero() <> FechaFRef.Month Then
|
||||
Dia = lastDayOfMonth
|
||||
If Mes <> FechaFRef.Month Then
|
||||
DiaFinal = lastDayOfMonth
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Mes").ToEntero() <> FechaIRef.Month Then
|
||||
'VERIFICAR LA FECHA DE INICIO DEL MES DE CONSULTA
|
||||
If Mes <> FechaIRef.Month Then
|
||||
FechaInicial = New DateTime(Anio, Mes, 1).ToString("dd/MM/yyyy")
|
||||
Else
|
||||
'SI ES EL MISMO MES DE FECHA DE INICIO TOMAR LA FECHA DE INICIO COMO REFERENCIA
|
||||
If Mes = FechaIRef.Month AndAlso Anio = FechaIRef.Year Then
|
||||
FechaInicial = FechaIRef.ToString("dd/MM/yyyy")
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim FechaFinalRef = New DateTime(Anio, Mes, Dia)
|
||||
Dim FechaFinalRef = New DateTime(Anio, Mes, DiaFinal)
|
||||
|
||||
'ASIGNAR LA FECHA FINAL DEL GRUPO, SI ES MENOR A LA FECHA DEL FILTRO
|
||||
If FechaF <> "-1" Then
|
||||
|
||||
@@ -2695,9 +2695,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'PERMISO PARA CANCELAR PEDIDO
|
||||
If GvInv.Rows.Count = 0 Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped") And Not CveEstatus = 14 Then
|
||||
@@ -3276,70 +3273,69 @@ Partial Class Ventas
|
||||
HlFacturasRelaciondas.Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
|
||||
If Not CveVenta > 0 Then
|
||||
'LbDescargarExcel.Visible = True
|
||||
HlAgregarExcel.Visible = True
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
' IPP 15 Julio 2017 - ERA FALSE
|
||||
ImgAntiPend.Visible = False
|
||||
UpPS.Update()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
|
||||
TxtFolio.Enabled = False
|
||||
TxtFecha.Enabled = False
|
||||
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
|
||||
If Not CveVenta > 0 Then
|
||||
'LbDescargarExcel.Visible = True
|
||||
HlAgregarExcel.Visible = True
|
||||
End If
|
||||
ImgFecha.Visible = False
|
||||
End If
|
||||
|
||||
'condición temporal por implementación JAM. usuario FernandaRomo
|
||||
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
' IPP 15 Julio 2017 - ERA FALSE
|
||||
ImgAntiPend.Visible = False
|
||||
UpPS.Update()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
|
||||
TxtFolio.Enabled = False
|
||||
TxtFecha.Enabled = False
|
||||
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
End If
|
||||
ImgFecha.Visible = False
|
||||
End If
|
||||
|
||||
'condición temporal por implementación JAM. usuario FernandaRomo
|
||||
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
|
||||
TxtFecha.Enabled = True
|
||||
ImgFecha.Visible = True
|
||||
End If
|
||||
TxtFecha.Enabled = True
|
||||
ImgFecha.Visible = True
|
||||
|
||||
BloqueaCondiconesPago()
|
||||
|
||||
BloqueaClasificaciones()
|
||||
|
||||
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
BtnModalAddPS.Enabled = False
|
||||
End If
|
||||
|
||||
MostrarOpcionesPaqueteria()
|
||||
|
||||
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
||||
|
||||
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
|
||||
' BtnEmitirImprimir.Visible = True
|
||||
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
|
||||
'End If
|
||||
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
trRotacion.Visible = True
|
||||
trRotacionlbl.Visible = True
|
||||
trAlineacion.Visible = True
|
||||
trAlineacionlbl.Visible = True
|
||||
|
||||
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
|
||||
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
|
||||
UPObservaciones.Update()
|
||||
End If
|
||||
|
||||
End If
|
||||
TxtFecha.Enabled = True
|
||||
|
||||
BloqueaCondiconesPago()
|
||||
|
||||
BloqueaClasificaciones()
|
||||
|
||||
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
BtnModalAddPS.Enabled = False
|
||||
End If
|
||||
MostrarOpcionesPaqueteria()
|
||||
|
||||
|
||||
|
||||
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
||||
|
||||
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
|
||||
' BtnEmitirImprimir.Visible = True
|
||||
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
|
||||
'End If
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
trRotacion.Visible = True
|
||||
trRotacionlbl.Visible = True
|
||||
trAlineacion.Visible = True
|
||||
trAlineacionlbl.Visible = True
|
||||
|
||||
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
|
||||
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
||||
|
||||
UPObservaciones.Update()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BloqueaClasificaciones()
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
@@ -5239,8 +5235,11 @@ Partial Class Ventas
|
||||
TxtFech3.ReadOnly = True : ImgFech3.Enabled = False
|
||||
ChkConvertirDoctoPesos.Enabled = False
|
||||
ChkConvertirDolares.Enabled = False
|
||||
TxtTipoCambio.Enabled = False
|
||||
TxtTipoCambioDlls.Enabled = False
|
||||
|
||||
TxtTipoCambio.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
TxtTipoCambioDlls.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
TxtTipoCambio.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
TxtTipoCambioDlls.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
|
||||
|
||||
'Condiciones de Pago
|
||||
RBLPago.Enabled = False
|
||||
@@ -8376,6 +8375,37 @@ Partial Class Ventas
|
||||
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DdlChofer.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DdlUnidadCamion.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtDistancia.Text.Trim) Then
|
||||
Alert("La carta porte no tiene la distancia definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFechaEntregaCP.Text.Trim) Then
|
||||
Alert("La carta porte no tiene la F.Salida definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFechaLlegadaCP.Text.Trim) Then
|
||||
Alert("La carta porte no tiene la F.Llegada definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If DtMercancias Is Nothing OrElse DtMercancias.Rows.Count = 0 Then
|
||||
Alert("La carta porte no tiene mercancía definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DvConfiguracionVeiculo.Visible Then
|
||||
If DdlConfigAuto.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("La carta porte no tiene la configuración definida.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
|
||||
@@ -9327,46 +9357,58 @@ Partial Class Ventas
|
||||
idCuentaContabilizacion = 10
|
||||
End If
|
||||
|
||||
If AutoConta Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
Try
|
||||
If AutoConta Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
Else
|
||||
Alert("Ocurrió un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
End If
|
||||
Else
|
||||
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al contabilizar la factura", ex)
|
||||
End Try
|
||||
|
||||
Else
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
End If
|
||||
End If
|
||||
|
||||
'RMF, cuando es pedido, se manda autorización.
|
||||
If ObjFactura.TipoDocto.Contiene("PA") Then
|
||||
Try
|
||||
'RMF, cuando es pedido, se manda autorización.
|
||||
If ObjFactura.TipoDocto.Contiene("PA") Then
|
||||
|
||||
Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
||||
Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
|
||||
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
||||
Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
||||
Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
||||
ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
GVAnticipos.DataBind()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al mandar las notificaciones de autorización", ex)
|
||||
End Try
|
||||
|
||||
Try
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
|
||||
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
||||
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el embarque", ex)
|
||||
End Try
|
||||
|
||||
Try
|
||||
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
|
||||
@@ -9374,7 +9416,7 @@ Partial Class Ventas
|
||||
Directory.CreateDirectory(DirectoriArchivoXML)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
OnError("Ocurrió un error al generar el directorio de xml", ex)
|
||||
End Try
|
||||
|
||||
|
||||
@@ -9412,31 +9454,35 @@ Partial Class Ventas
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
|
||||
If AplicaFEMSA Then
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
End If
|
||||
|
||||
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
|
||||
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
||||
If Not RespCartaPorte.TieneError Then
|
||||
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
||||
Else
|
||||
DebeTimbrar = False
|
||||
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
If DebeTimbrar Then
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
End If
|
||||
Try
|
||||
If AplicaFEMSA Then
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
End If
|
||||
|
||||
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
|
||||
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
||||
If Not RespCartaPorte.TieneError Then
|
||||
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
||||
Else
|
||||
DebeTimbrar = False
|
||||
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
If DebeTimbrar Then
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el timbrado", ex)
|
||||
End Try
|
||||
|
||||
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
|
||||
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
|
||||
ObjTimbrado = Nothing
|
||||
|
||||
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
||||
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas IsNot Nothing AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
||||
Try
|
||||
For Each NCGenerada In ListaNotasCreditoGeneradas
|
||||
If NCGenerada.Timbre IsNot Nothing Then
|
||||
@@ -9467,45 +9513,55 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'CANCELAR FACTURA ANTERIOR
|
||||
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
||||
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
|
||||
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
||||
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
||||
Try
|
||||
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
||||
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
|
||||
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
||||
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cancelar la factura anterior.", ex)
|
||||
End Try
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'VERIFICAR 100% AVANCE A IMPORTE Y CANTIDAD
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
||||
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
Try
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
||||
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjContr.DtResultados.Rows.Count > 0 Then
|
||||
If ObjContr.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
|
||||
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
||||
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
||||
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
||||
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
||||
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
||||
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
||||
|
||||
If PorcentajeAvance >= 100 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
||||
If PorcentajeAvance >= 100 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
||||
End If
|
||||
Else
|
||||
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
||||
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
||||
|
||||
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
||||
|
||||
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
||||
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
||||
|
||||
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
||||
|
||||
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al notificar el avance.", ex)
|
||||
End Try
|
||||
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
@@ -9521,7 +9577,8 @@ Partial Class Ventas
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
||||
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
@@ -9538,7 +9595,7 @@ Partial Class Ventas
|
||||
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
@@ -9566,7 +9623,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'AUTO DESCARGAR PDF
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 1) Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(72) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
|
||||
End If
|
||||
@@ -9670,11 +9727,16 @@ Partial Class Ventas
|
||||
|
||||
MensajeAlert.Clear()
|
||||
|
||||
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
||||
RBLPago.SelectedValue = "1"
|
||||
LimpiaEscondeContado()
|
||||
BtnEmitirImprimir.Visible = False
|
||||
ObjFactura = Nothing
|
||||
Try
|
||||
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
||||
RBLPago.SelectedValue = "1"
|
||||
LimpiaEscondeContado()
|
||||
BtnEmitirImprimir.Visible = False
|
||||
ObjFactura = Nothing
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al limpiar los datos", ex)
|
||||
End Try
|
||||
|
||||
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
@@ -11572,7 +11634,7 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||
Else
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.NombreComercial
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad
|
||||
End If
|
||||
Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP
|
||||
End If
|
||||
@@ -15011,19 +15073,14 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "¡ P D F R E P O R T V I E W E R !"
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, CveVenta As Integer, UsuarioActual As Usuario, strURLHOST As String)
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String)
|
||||
'GUARDA PDF
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
Dim Factura As Modelos.Factura
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
Dim ObjetoPDF As Byte() = DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||
|
||||
If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then
|
||||
PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0"))
|
||||
End If
|
||||
DescargarFactura(Factura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el PDF", ex)
|
||||
End Try
|
||||
@@ -15031,7 +15088,6 @@ Partial Class Ventas
|
||||
Dim ErrorCorreo As Boolean = False
|
||||
|
||||
If EnviaCorreo Then
|
||||
Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
If Factura IsNot Nothing Then
|
||||
'MANDA CORREO
|
||||
If EnviaCorreo Then
|
||||
@@ -16376,7 +16432,8 @@ Partial Class Ventas
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
||||
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
@@ -18103,7 +18160,7 @@ Partial Class Ventas
|
||||
If CvePS.Contiene(402917, 402918) Then
|
||||
PUPromocion = 40D
|
||||
End If
|
||||
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
||||
PUModificado = Math.Round(PUPromocion / (1 + PorcentajeIVA), 6)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -21681,6 +21738,15 @@ Partial Class Ventas
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
||||
TrConversionTipoCambio.Visible = True
|
||||
End Select
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
TxtTipoCambio.Enabled = True
|
||||
TxtTipoCambioDlls.Enabled = True
|
||||
TxtTipoCambio.ReadOnly = False
|
||||
TxtTipoCambioDlls.ReadOnly = False
|
||||
End If
|
||||
|
||||
|
||||
UpPS.Update()
|
||||
|
||||
If CveCliente > 0 Then
|
||||
@@ -25445,37 +25511,42 @@ Partial Class Ventas
|
||||
'1 = TODO FINO
|
||||
'2 = ERROR
|
||||
'3 = SIN CELULAR - PROBLEMA CON EL CELULAR
|
||||
|
||||
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
If Mensaje = "" Then Return 0
|
||||
|
||||
Dim Celular As String = ""
|
||||
|
||||
Try
|
||||
Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Catch ex As Exception
|
||||
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
If Mensaje = "" Then Return 0
|
||||
|
||||
Dim Celular As String = ""
|
||||
|
||||
Try
|
||||
Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
If Celular.Length <> 10 Then Return 3
|
||||
|
||||
'ARMA MENSAJE
|
||||
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
||||
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
||||
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
||||
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
||||
If Mensaje = "" Then Return 2
|
||||
|
||||
Dim ObjMensaje As New ClsTecnoMovil
|
||||
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
||||
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
||||
End If
|
||||
Return 1
|
||||
Else
|
||||
Return 2
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el SMS", ex)
|
||||
Return 0
|
||||
End Try
|
||||
|
||||
If Celular.Length <> 10 Then Return 3
|
||||
|
||||
'ARMA MENSAJE
|
||||
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
||||
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
||||
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
||||
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
||||
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
||||
If Mensaje = "" Then Return 2
|
||||
|
||||
Dim ObjMensaje As New ClsTecnoMovil
|
||||
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
||||
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
||||
End If
|
||||
Return 1
|
||||
Else
|
||||
Return 2
|
||||
End If
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
@@ -31305,6 +31376,8 @@ Partial Class Ventas
|
||||
' BtnCrearApartirDe.Visible = False
|
||||
'End If
|
||||
|
||||
Dim FolioOriginal As String = TxtFolio.Text
|
||||
|
||||
HdnCveVenta.Value = ""
|
||||
|
||||
BtnCrearApartirDe.Visible = False '[IPP-2Novimebre2018] REEMPLAZA LO COMENTADO ARRIBA
|
||||
@@ -31504,6 +31577,30 @@ Partial Class Ventas
|
||||
HabilitarControlesCartaPorte(True)
|
||||
End If
|
||||
|
||||
If DivAdjuntar.Visible Then
|
||||
Dim FolioNuevo As String = TxtFolio.Text
|
||||
If FolioNuevo <> FolioOriginal Then
|
||||
If Adjunto <> "" Then
|
||||
Adjunto = ""
|
||||
BtnArchivoAdjunto.Text = ""
|
||||
BtnArchivoAdjunto.Visible = False
|
||||
BtnEliminarAdjunto.Visible = False
|
||||
BtnAdjuntar.Visible = True
|
||||
|
||||
tdAdjuntar.Style.Item("display") = "block"
|
||||
tdAdjunto.Style.Item("display") = "none"
|
||||
Else
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
Else
|
||||
DivAdjuntar.Visible = False
|
||||
End If
|
||||
UpAdjuntar.Update()
|
||||
Else
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
UpnTools.Update()
|
||||
UpCliente.Update()
|
||||
UpParametros.Update()
|
||||
|
||||
Reference in New Issue
Block a user