This commit is contained in:
2022-05-19 10:20:31 -07:00
13 changed files with 347 additions and 305 deletions

View File

@@ -3146,11 +3146,11 @@ Public Class ClsNominas
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto)
retorno = RunQuery("Ocurrió un error al obtener el PA_AGRO_Embarque_ManifiestoGet.")
retorno = RunQuery("Ocurrió un error al obtener el Embarque Manifiesto .")
Return retorno
End Function
Public Function PA_Agro_Embarque_PalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32) As Boolean
Public Function PA_Agro_Embarque_PalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32, Optional agrupado As Boolean = False) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Agro_Embarque_PalletGet", CommandType.StoredProcedure)
addParameters("@CvePallet", SqlDbType.Int, cvePallet)
@@ -3165,7 +3165,8 @@ Public Class ClsNominas
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto)
addParameters("@CveTemporada", SqlDbType.Int, cveTemporada)
retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_Embarque_PalletGet.")
addParameters("@Agrupado", SqlDbType.Bit, agrupado)
retorno = RunQuery("Ocurrió un error al obtener el Embarque Pallet .")
Return retorno
End Function
#Region "Visor sat"

View File

@@ -3825,6 +3825,49 @@ Namespace Modelos
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
OcurrioError = True
End If
' COMIENZA: GARANTIAS
Dim CveAlmacenGarantia As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={factura.CveSubProyecto}").ToEntero()
Dim DtGarantias As DataTable = Nothing
If ObjAcum.GetGarantiasDetalle(factura.CveVenta) Then
DtGarantias = ObjAcum.DtResultados.Copy()
End If
If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then
Dim TotalGarantia As Decimal = 0
Dim CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 2, 1, factura.Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, factura.CveVenta, -1, -1, Observaciones:="", Guia:="", Modulo:="Modelos/SDGA")
Dim FolioGarantia = ObjInventario.Folio
For Each RowGarantia As DataRow In DtGarantias.Rows
Dim CvePS = RowGarantia("CvePS").ToString().ToEntero()
Dim CveTamaño As Integer = RowGarantia("CveTamaño").ToString().ToEntero()
Dim CveUM As Integer = RowGarantia("CveUnidadMedida").ToString().ToEntero()
Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble()
Dim Serie As String = RowGarantia("Comprobante").ToString
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=RowGarantia("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True
Exit For
End If
TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU)
Next
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Gar", 53, 0, 0, 1, factura.Fecha, "Entrada Garantía", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaTraspaso > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, TotalGarantia, "MOVIMIENTO DE GARANTIA", 68, "MOVIMIENTO DE GARANTIA", factura.Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then
OcurrioError = True
End If
If Not OcurrioError AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, TotalGarantia, "MOVIMIENTO DE GARANTIA", 331, "MOVIMIENTO DE GARANTIA", factura.Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then
OcurrioError = True
End If
Else
OcurrioError = True
End If
End If
Else
OcurrioError = True
End If

View File

@@ -247,6 +247,7 @@ Partial Class PopUpVerFactura
Dim SCAC As String = ""
Dim CAAT As String = ""
Dim NumeroTrailer As String = ""
Dim Permiso As String = ""
Dim tablaReporte As New DataTable
@@ -282,7 +283,7 @@ Partial Class PopUpVerFactura
LineaTransportacion = row("LineaTransportacion").ToString()
SCAC = row("SCAC").ToString()
CAAT = row("CAAT").ToString()
Permiso = row("Permiso").ToString()
'If row("CveCamionRemolque1").ToString() = "1" Then
' Rem1Placa = "12-TF-5E"
' Remolque1 = "Remolque 1"
@@ -292,8 +293,8 @@ Partial Class PopUpVerFactura
'End If
If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then
NoPallets = objnom.DtResultados.Rows.Count.ToString()
If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1, True) And objnom.DtResultados.Rows.Count > 0 Then
NoPallets = objnom.DtResultados.SUM("NoPallets").ToString()
NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2")
NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0")
@@ -317,6 +318,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Camion", Camion))
params.Add(New ReportParameter("Rem1Placa", Rem1Placa))
params.Add(New ReportParameter("Remolque1", Remolque1))
params.Add(New ReportParameter("Permiso", Permiso))
params.Add(New ReportParameter("LongitudCaja", LongitudCaja))

View File

@@ -123,6 +123,9 @@ Partial Class Compras_RepProductosServiciosDetalle
txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text)
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
If CveCultivo.ToEntero() > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then
txtFechaI.Text = "01/01/1900"
End If
If Fecha <> "-1" Then
txtFechaI.Text = Fecha
txtFechaF.Text = Fecha

View File

@@ -1429,7 +1429,7 @@
</Line>
</ReportItems>
<KeepTogether>true</KeepTogether>
<Top>21.48868cm</Top>
<Top>20.79018cm</Top>
<Left>0.0208cm</Left>
<Height>2.10099cm</Height>
<Width>20.06179cm</Width>
@@ -2750,7 +2750,7 @@
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DsOC</DataSetName>
<Top>4.77915cm</Top>
<Top>4.08065cm</Top>
<Left>0.11516cm</Left>
<Height>2.29418cm</Height>
<Width>19.97108cm</Width>
@@ -3175,7 +3175,7 @@
</Textbox>
</ReportItems>
<KeepTogether>true</KeepTogether>
<Top>14.08621cm</Top>
<Top>13.38771cm</Top>
<Left>0.04257cm</Left>
<Height>3.74574cm</Height>
<Width>20.109cm</Width>
@@ -4241,7 +4241,7 @@
</Tablix>
</ReportItems>
<KeepTogether>true</KeepTogether>
<Top>7.24707cm</Top>
<Top>6.54857cm</Top>
<Left>0.11516cm</Left>
<Height>6.80033cm</Height>
<Width>20.03641cm</Width>
@@ -4288,7 +4288,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Top>20.29602cm</Top>
<Top>19.59752cm</Top>
<Left>0.07003cm</Left>
<Height>1.01627cm</Height>
<Width>5.45089cm</Width>
@@ -4749,7 +4749,7 @@
</Tablix>
</ReportItems>
<KeepTogether>true</KeepTogether>
<Top>17.84606cm</Top>
<Top>17.14756cm</Top>
<Left>0.00547cm</Left>
<Height>2.25247cm</Height>
<Width>20.1554cm</Width>
@@ -4763,273 +4763,6 @@
</Border>
</Style>
</Rectangle>
<Textbox Name="Textbox19">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Nombre</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.14544in</Top>
<Left>0.07305cm</Left>
<Height>0.22222in</Height>
<Width>0.81128in</Width>
<ZIndex>16</ZIndex>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<BackgroundColor>#c4d79b</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox20">
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!ClienteNombre.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.14544in</Top>
<Left>0.84004in</Left>
<Height>0.22222in</Height>
<Width>4.80807in</Width>
<ZIndex>17</ZIndex>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox22">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Dirección</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.36766in</Top>
<Left>0.02757in</Left>
<Height>0.2309in</Height>
<Width>0.80675in</Width>
<ZIndex>18</ZIndex>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<BackgroundColor>#c4d79b</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox29">
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!ClienteDireccion.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.36766in</Top>
<Left>0.84004in</Left>
<Height>0.2309in</Height>
<Width>7.0427in</Width>
<ZIndex>19</ZIndex>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox30">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Ciudad</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.59856in</Top>
<Left>0.02876in</Left>
<Height>0.23558in</Height>
<Width>0.81128in</Width>
<ZIndex>20</ZIndex>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Color>#c4d79b</Color>
<Width>1.25pt</Width>
</BottomBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<BackgroundColor>#c4d79b</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox31">
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!ClienteLugar.Value</Value>
<Style>
<FontSize>6pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontSize>6pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.59856in</Top>
<Left>0.84004in</Left>
<Height>0.23611in</Height>
<Width>4.79418in</Width>
<ZIndex>21</ZIndex>
<Style>
<Border>
<Color>#c4d79b</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox32">
<KeepTogether>true</KeepTogether>
<Paragraphs>
@@ -5059,11 +4792,11 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.62495in</Top>
<Left>5.61883in</Left>
<Height>0.2092in</Height>
<Width>2.26391in</Width>
<ZIndex>22</ZIndex>
<Top>1.37495in</Top>
<Left>5.662in</Left>
<Height>0.23161in</Height>
<Width>2.24597in</Width>
<ZIndex>16</ZIndex>
<Style>
<Border>
<Color>#c4d79b</Color>
@@ -5085,7 +4818,7 @@
</Style>
</Textbox>
</ReportItems>
<Height>23.58967cm</Height>
<Height>22.89117cm</Height>
<Style />
</Body>
<Width>20.16633cm</Width>

View File

@@ -4561,13 +4561,15 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Value>GGN:</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox209</rd:DefaultName>
@@ -4602,7 +4604,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Value>=Parameters!Permiso.Value</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
@@ -7146,7 +7148,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7179,7 +7180,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7212,7 +7212,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7245,7 +7244,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7278,7 +7276,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
</TablixCells>
@@ -7334,6 +7331,12 @@
</ReportSection>
</ReportSections>
<ReportParameters>
<ReportParameter Name="Permiso">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="NoEmbarque">
<DataType>String</DataType>
<Nullable>true</Nullable>

View File

@@ -451,9 +451,16 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-2" style="padding-top: 14px; padding-left: 0px;">
<div class="input-group input-sm input-small date date-picker " style="padding-left: 0px;" data-date-format="dd/mm/yyyy">
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaFAdd" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
</div>
</div>
<div class="text-right">
<asp:LinkButton ID="LnkSolicitarSat" OnClick="LnkSolicitarSat_Click" runat="server">Solicitar</asp:LinkButton>
<asp:LinkButton ID="LnkSolicitarSat" CssClass="btn btn-primary" OnClick="LnkSolicitarSat_Click" runat="server">Solicitar</asp:LinkButton>
</div>
</div>
</div>

View File

@@ -2,6 +2,11 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -44,9 +49,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
{
if (!IsPostBack)
{
TxtRpdFechaInicio.Text = string.Format("01/01/{0}", DateTime.Now.Year - 1);
TxtRpdFechaFin.Text = string.Format("31/12/{0}", DateTime.Now.Year - 1);
LnkConsultar_Click(null, null);
TxtRpdFechaInicio.Text = string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1));
TxtRpdFechaFin.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth());
//LnkConsultar_Click(null, null);
}
}
@@ -174,6 +179,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
}
UPModalViewSolicitudes.Update();
var api = new GeneralesAPI();
api.GeneraSolicitud();
api.VerificaSolicitudesNominas();
}
protected void LnkShowSolicitudes_Click(object sender, EventArgs e)
{
@@ -196,6 +204,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
using (ClsNominas nom = new ClsNominas())
{
Continuar = nom.SolicitudesNominasAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa);
var api = new GeneralesAPI();
api.GeneraSolicitud();
api.VerificaSolicitudesNominas();
}
if (Continuar)
{
@@ -207,4 +218,198 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
}
}
}
public class GeneralesAPI : ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI
{
public GeneralesAPI(string domainApi = "http://localhost:4001/", string token = "") : base(domainApi, token) { }
public object GeneraSolicitud()
{
return getData<object>("GeneraSolicitud", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET,false);
}
public object VerificaSolicitudesNominas()
{
return getData<object>("VerificaSolicitudesNominas", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
}
}
//using ADSNetLibrary. SIGAPI;
//using ADSNetLibrary. SIGAPI.Models;
//using ADSNetLibrary. SIGAPI.Models.Request;
//using ADSNetLibrary.SIGAPI.Models.Sistema;
//using System;
//using System.Collections.Generic;
////using System.IdentityModel.Tokens.Jwt;
//using System.Linq;
//using System.Net.Http;
//using System.Net.Http.Headers;
//using System.Text;
//using System.Threading;
//using System.Threading.Tasks;
namespace ADSNetLibraryzd.Helpers.Conexiones.SIGAPI
{
public enum requestMethod
{
POST = 1,
GET = 2
}
public class BaseSIGAPI
{
private const string tituloLog = "ADSNetLibrary.Helpers.Conexiones.SIGAPI";
public string domainApi;
public string authorization;
protected string RouteController = "";
protected string FullRoute = "";
public string GetRoutbyclass() { string classname = this.GetType().Name; return classname.Substring(0, classname.Length - 3); }
public string GetRoute(string path)
{
if (string.IsNullOrEmpty(FullRoute))
{
return string.Format("api/{0}/{1}", (string.IsNullOrEmpty(RouteController) ? GetRoutbyclass() : RouteController), path);
}
else
{
return string.Format("{0}{1}", FullRoute, path);
}
}
/// <summary>
/// nueva instancia de conexion para una api
/// </summary>
/// <param name="domainApi"> url de la api</param>
/// <param name="authorization"> llenar si se tiene si se desea obtner usuar campos usuario y pasword</param>
public BaseSIGAPI(string domainApi, string authorization = null, string fullRoute = null)
{
if (string.IsNullOrEmpty(domainApi))
{
domainApi = "http://localhost:4001/";//"http://jam.adssistemas.mx:4001/";//Helpers.ModVars.UrlApi;
}
this.authorization = authorization;
this.domainApi = domainApi;
this.FullRoute = fullRoute;
}
//public string GetSIGToken(string userName, string password, int cveEmpresa)
//{
// var objauth = new RequestLogin() { UserName = userName, Password = password, CveEmpresa = cveEmpresa };
// var retorno = getData<ResponseModel<ResponseLogin>>("api/Usuario/Login", objauth, requestMethod.POST, false, true);
// if (retorno != null && retorno.IsSuccess)
// {
// return retorno.Result.AccessToken;
// }
// else
// {
// return null;
// }
//}
/// <summary>
/// Obtiene datos de la api asincrono.
/// </summary>
/// <typeparam name="T">Clase genérica en donde se obtiene la información del SqlDataReader.</typeparam>
/// <param name="path">ruta sin domino ejemplo "/api/usuarios/login".</param>
/// <param name="requestobject">request object.</param>
/// <returns>Lista de objetos.</returns>
public async Task<T> getDataAsync<T>(string path, object requestobject, requestMethod reqmet = requestMethod.POST, bool needauthorization = true, bool isfullpath = false) where T : class, new()
{
T objreturn = null;
using (
HttpClient client = new HttpClient())
{
// Setting Base address.
client.BaseAddress = new Uri(domainApi);
// Setting content type.
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Setting Authorization.
if (needauthorization) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", authorization); }
client.Timeout = TimeSpan.FromMinutes(15);
HttpResponseMessage response = new HttpResponseMessage();
var strjsonreq = Newtonsoft.Json.JsonConvert.SerializeObject(requestobject);
StringContent content = new StringContent(strjsonreq, Encoding.UTF8, "application/json");
string route = isfullpath ? path : GetRoute(path);
try
{
switch (reqmet)
{
case requestMethod.POST:
response = await client.PostAsync(route, content);
break;
case requestMethod.GET:
response = await client.GetAsync(route);
break;
}
if (response.IsSuccessStatusCode)
{
string jsondata = await response.Content.ReadAsStringAsync();
Newtonsoft.Json.JsonSerializerSettings settings = new Newtonsoft.Json.JsonSerializerSettings
{
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore
};
objreturn = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(jsondata, settings);
}
else {
//ModExtensiones.GuardaLog(string.Format("{0}{1}{2}{1}StatusCode:{3}{1}{4}{1}{5}{1}", tituloLog, ModVars.NewLine, route, response.StatusCode, response.RequestMessage, strjsonreq), ModVars.ADSNetLibraryLog);
}
}
catch (Exception e) {
//ModExtensiones.GuardaLog(string.Format("{0}{1}{2}{1}{3}{1}{4}{1}", tituloLog, ModVars.NewLine, route, e, strjsonreq), ModVars.ADSNetLibraryLog);
}
}
return objreturn;
}
/// <summary>
/// Obtiene datos de la api.
/// </summary>
/// <typeparam name="T">Clase genérica en donde se obtiene la información del SqlDataReader.</typeparam>
/// <param name="path">ruta sin domino ejemplo "/api/usuarios/login".</param>
/// <param name="requestobject">request object.</param>
/// <returns>Lista de objetos.</returns>
public T getData<T>(string path, object requestobject, requestMethod reqmet = requestMethod.POST, bool needauthorization = true, bool isfullpath = false) where T : class, new()
{
return AsyncHelper.RunSync<T>(() => getDataAsync<T>(path, requestobject, reqmet, needauthorization, isfullpath));
}
}
internal static class AsyncHelper
{
private static readonly TaskFactory _myTaskFactory = new
TaskFactory(CancellationToken.None,
TaskCreationOptions.None,
TaskContinuationOptions.None,
TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
return AsyncHelper._myTaskFactory
.StartNew<Task<TResult>>(func)
.Unwrap<TResult>()
.GetAwaiter()
.GetResult();
}
public static void RunSync(Func<Task> func)
{
AsyncHelper._myTaskFactory
.StartNew<Task>(func)
.Unwrap()
.GetAwaiter()
.GetResult();
}
}
}

View File

@@ -375,24 +375,46 @@
<asp:GridView ID="GvDatos" runat="server" Width="99%" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" DataKeyNames="TipoDocumento,SerieFolio">
<Columns>
<%--0--%>
<asp:HyperLinkField HeaderText="Serie Folio" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<%--1--%>
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
<%--2--%>
<asp:BoundField HeaderText="Suc. Ejec." DataField="SubProyectoEjecucion" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" Visible="false" />
<%--3--%>
<asp:BoundField HeaderText="Suc. Cob." DataField="SubProyectoCobranza" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" Visible="false" />
<%--4--%>
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<%--5--%>
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<%--6--%>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<%--7--%>
<asp:BoundField HeaderText="Código" DataField="CodigoProducto" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<%--8--%>
<asp:BoundField HeaderText="Producto/Servicio" DataField="PS" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />
<%--9--%>
<asp:BoundField HeaderText="Observación" DataField="Observaciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" Visible="false" />
<%--10--%>
<asp:BoundField HeaderText="PU" DataField="PU" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<%--11--%>
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />
<%--12--%>
<asp:BoundField HeaderText="Desc" DataField="Descuento" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<%--13--%>
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<%--14--%>
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />
<%--15--%>
<asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-Width="5%" Visible="false" />
<%--16--%>
<asp:BoundField HeaderText="Método de Pago" DataField="MetodoPago" ItemStyle-Width="5%" Visible="false" />
<%--17--%>
<asp:BoundField HeaderText="Forma de Pago" DataField="FormaPago" ItemStyle-Width="5%" Visible="false" />
<%--18--%>
<asp:BoundField HeaderText="F. Emisión" DataField="FechaIng" DataFormatString="{0:d}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" Visible="false" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
@@ -434,6 +456,17 @@
<asp:CheckBox ID="ChkFormaPago" runat="server" Text="Forma de Pago" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFechaHoraEmision" runat="server" Text="Fecha Hora de Emisión" />
</td>
<td style="text-align: left;">
</td>
<td style="text-align: left;">
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -626,6 +626,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
GvDatos.Columns(15).Visible = ChkRFC.Checked
GvDatos.Columns(16).Visible = ChkMetodoPago.Checked
GvDatos.Columns(17).Visible = ChkFormaPago.Checked
GvDatos.Columns(18).Visible = ChkFechaHoraEmision.Checked
CargaDatos()
UPDatos.Update()

View File

@@ -1080,7 +1080,7 @@
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad") %>' Visible="false"></asp:Literal>
<asp:Literal ID="LtlTipoDescuento" runat="server" Text='<%# Eval("TipoDescuento") %>' Visible="false"></asp:Literal>
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento") %>' Visible="false"></asp:Literal>
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("Cantidad", "{0:####.######}") %>' ValidationGroup="GprGV" Width="45px" Height="24px"></asp:TextBox>
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("Cantidad", "{0:0.######}") %>' ValidationGroup="GprGV" Width="45px" Height="24px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:CustomValidator ID="CVCantidadEdit" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GprGV"></asp:CustomValidator>

View File

@@ -14193,6 +14193,7 @@ Partial Class Ventas
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9, TmpDTDetalle) Then
OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
ModExtensiones.GuardaLog("Ocurrió un error al verificar inventario de remisiones.Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
End If
Next
@@ -34251,11 +34252,11 @@ Partial Class Ventas
Dim CveDireccionDestino As Integer = -1
If SucursalOrigenCP IsNot Nothing Then
CveDireccionOrigen = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If SucursalDestinoCP IsNot Nothing Then
CveDireccionDestino = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
@@ -34370,9 +34371,9 @@ Partial Class Ventas
SucursalOrigenCP.Colonia = Row("Colonia").ToString()
SucursalOrigenCP.CP = Row("CP").ToString()
SucursalOrigenCP.Municipio = Row("Municipio").ToString()
'SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalOrigenCP.Estado = Row("Estado").ToString()
'SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalOrigenCP.Pais = Row("Pais").ToString()
SBDomicilioSucursal.AppendFormat("{0}", Row("Calle").ToString())
@@ -34434,9 +34435,9 @@ Partial Class Ventas
SucursalDestinoCP.Direccion = Row("EnvioDireccion").ToString()
SucursalDestinoCP.Colonia = Row("EnvioColonia").ToString()
SucursalDestinoCP.Municipio = Row("EnvioCiudad").ToString()
'SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalDestinoCP.Estado = Row("EnvioEstado").ToString()
'SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalDestinoCP.Pais = Row("Pais").ToString()
SucursalDestinoCP.CP = Row("EnvioCP").ToString()

View File

@@ -474,6 +474,16 @@