Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -27,7 +27,6 @@ Public Class CFDITimbreRetenciones
|
||||
Public ReadOnly Property TotalImpuestosGravado As Decimal
|
||||
Get
|
||||
Return (From c In RetencionesImpuestos
|
||||
Where c.ImpuestoRetencion = "001"
|
||||
Select c.MontoRetencion).Sum
|
||||
End Get
|
||||
End Property
|
||||
@@ -35,7 +34,6 @@ Public Class CFDITimbreRetenciones
|
||||
Public ReadOnly Property TotalImpuestosRetenidos As Decimal
|
||||
Get
|
||||
Return (From c In RetencionesImpuestos
|
||||
Where c.ImpuestoRetencion = "001"
|
||||
Select c.MontoRetencion).Sum
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -759,9 +759,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
|
||||
Dim EsDistribuidor As Integer = IfNull(context.Request("esdistribuidor"), "-1").ToString.ToEntero
|
||||
|
||||
Dim cveclienteclasificacion = IfNull(context.Request("cveclienteclasificacion"), "-1").ToString.ToEntero
|
||||
|
||||
Dim usuario As Usuario = UsuarioActual(context)
|
||||
Dim CveEmpresa As Integer
|
||||
If IsNothing(usuario) Then
|
||||
@@ -799,7 +797,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Else
|
||||
context.Response.Write("[]")
|
||||
End If
|
||||
DtRetorno.Dispose()
|
||||
If DtRetorno IsNot Nothing Then DtRetorno.Dispose()
|
||||
DtRetorno = Nothing
|
||||
|
||||
Return retorno
|
||||
|
||||
Binary file not shown.
@@ -6271,21 +6271,15 @@ Partial Class Compras_Compras
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Dim Funcionalidad As Integer = 0
|
||||
If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then
|
||||
Funcionalidad = 307
|
||||
ConceptoContable = 15
|
||||
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 2 Then
|
||||
Funcionalidad = 309
|
||||
ConceptoContable = 183
|
||||
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then
|
||||
Funcionalidad = 311
|
||||
ConceptoContable = 185
|
||||
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then
|
||||
Funcionalidad = 313
|
||||
ConceptoContable = 248
|
||||
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
|
||||
Funcionalidad = 578
|
||||
ConceptoContable = 285
|
||||
ElseIf DdlRetIVAConcepto.SelectedValue.ToEntero = 6 Then
|
||||
ConceptoContable = 333
|
||||
@@ -6302,15 +6296,11 @@ Partial Class Compras_Compras
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim funcionalidad As Integer = 0
|
||||
If DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then
|
||||
funcionalidad = 315
|
||||
ConceptoContable = 16
|
||||
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then
|
||||
funcionalidad = 317
|
||||
ConceptoContable = 243
|
||||
ElseIf DdlRetISRConcepto.SelectedValue.ToEntero = 3 Then
|
||||
funcionalidad = 348
|
||||
ConceptoContable = 327
|
||||
End If
|
||||
importeMovimiento = CompraActual.RetISR
|
||||
@@ -6320,33 +6310,33 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
Case 64 'Ganancia
|
||||
'Case 64 'Ganancia
|
||||
|
||||
'CveSubProyectoInsertar = CveSubProyecto
|
||||
If CveSubProyectoInsertar <= 0 Then
|
||||
ErrorPrepoliza = True
|
||||
Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
' 'CveSubProyectoInsertar = CveSubProyecto
|
||||
' If CveSubProyectoInsertar <= 0 Then
|
||||
' ErrorPrepoliza = True
|
||||
' Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
|
||||
' End If
|
||||
|
||||
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
' If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
|
||||
If TipoCambioCompra > TCPago Then
|
||||
ConceptoContable = 64
|
||||
TipoMovimiento = True
|
||||
Else
|
||||
ConceptoContable = 65
|
||||
TipoMovimiento = False
|
||||
End If
|
||||
If TCPago <> TipoCambioCompra Then
|
||||
importeMovimiento = Math.Abs(TCPago - TipoCambioCompra) * importePagoProv
|
||||
importeMovimiento -= Math.Abs(TCPago - TipoCambioCompra) * importeIVAAcreditable
|
||||
importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetIVAAcreditable
|
||||
importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetISRAcreditable
|
||||
importeMN = importeMovimiento
|
||||
End If
|
||||
Else
|
||||
importeMovimiento = 0
|
||||
End If
|
||||
' If TipoCambioCompra > TCPago Then
|
||||
' ConceptoContable = 64
|
||||
' TipoMovimiento = True
|
||||
' Else
|
||||
' ConceptoContable = 65
|
||||
' TipoMovimiento = False
|
||||
' End If
|
||||
' If TCPago <> TipoCambioCompra Then
|
||||
' importeMovimiento = Math.Abs(TCPago - TipoCambioCompra) * importePagoProv
|
||||
' importeMovimiento -= Math.Abs(TCPago - TipoCambioCompra) * importeIVAAcreditable
|
||||
' importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetIVAAcreditable
|
||||
' importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetISRAcreditable
|
||||
' importeMN = importeMovimiento
|
||||
' End If
|
||||
' Else
|
||||
' importeMovimiento = 0
|
||||
' End If
|
||||
|
||||
Case 6 'Compra
|
||||
|
||||
@@ -6570,8 +6560,14 @@ Partial Class Compras_Compras
|
||||
Dim tCveColectiva As Integer = ObjOC.DtResultados.FiltroPrimeroValor("CveColectiva").ToEntero
|
||||
CveMovimientoAlmacen = ObjOC.DtResultados.FiltroPrimeroValor("CveMovimientoAlmacen").ToEntero
|
||||
Dim TCAjuste As Decimal = ObjOC.DtResultados.FiltroPrimeroValor("TipoCambioAjuste").ToDecimal
|
||||
'RMF. falta verificar el costo indirecto de la OC
|
||||
If DdlMoneda.SelectedValue.ToEntero <> 1 Then
|
||||
'RMF. si la Factura es USD, y la OC, en pesos, el registro debe de ser el concepto de la moneda de la oc
|
||||
If Importe176 > 0 AndAlso DdlMoneda.SelectedValue <> "1" Then
|
||||
'Importe176 = (Importe176 * TxtTipoCambioOC.Text.ToDecimal).RoundSQL
|
||||
'ImporteMN176 = Importe176
|
||||
TCO = TxtTC.Text.ToDecimal
|
||||
End If
|
||||
|
||||
If Importe228 > 0 Then
|
||||
TCO = TxtTC.Text.ToDecimal
|
||||
ImporteCI176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteCI228").ToDecimal
|
||||
'CostoIndirectoAcum176 += ImporteCI176
|
||||
@@ -7027,22 +7023,13 @@ Partial Class Compras_Compras
|
||||
|
||||
importeMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
|
||||
OtrosGastosIngresos = rw.FCTextBox("TxtOtrosGastosIngresos").Text.ToDecimal
|
||||
|
||||
importeMN = (importeMovimiento * tipoCambioActual * Multiplicador).RoundSQL
|
||||
|
||||
Dim OtrosGastosIngresosMN As Decimal = (OtrosGastosIngresos * tipoCambioActual * Multiplicador).RoundSQL
|
||||
Dim importeMNOtrosIngEgs As Decimal = ((importeMovimiento + OtrosGastosIngresos) * tipoCambioActual * Multiplicador).RoundSQL
|
||||
|
||||
Dim tCveProveedor As Integer = rw.DataKey("CveProveedor").ToEntero
|
||||
If OtrosGastosIngresos = 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, importeMN, CveConceptoContableDeudor, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=tCveProveedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True : Exit For
|
||||
End If
|
||||
Else
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(TipoMovimiento, False, True), (importeMovimiento + OtrosGastosIngresos), importeMNOtrosIngEgs, CveConceptoContableDeudor, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=tCveProveedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, (importeMovimiento + OtrosGastosIngresos)), Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True : Exit For
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (importeMovimiento + OtrosGastosIngresos), importeMNOtrosIngEgs, CveConceptoContableDeudor, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=tCveProveedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, (importeMovimiento + OtrosGastosIngresos)), Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True : Exit For
|
||||
End If
|
||||
|
||||
Dim Pago As New CompraPago With {
|
||||
@@ -7393,8 +7380,8 @@ Partial Class Compras_Compras
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
'EMPIEZA REFACTURACION
|
||||
@@ -19531,6 +19518,11 @@ Partial Class Compras_Compras
|
||||
|
||||
Private Function AjustarPrePolizaVinculacionOC(ByRef OC As ClsOC, ByRef OCBitacora As ClsOIEventos, ByRef ObjInventarios As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Boolean
|
||||
|
||||
'' si está activado el Tipo de cambio de las OC, no debe de ajustarse, ya que hay una operación de cálculo
|
||||
If DivTipoCambioOC.Visible Then
|
||||
Return True
|
||||
End If
|
||||
|
||||
'VARIABLES
|
||||
Dim CveProveedorSucursal As Integer = -1
|
||||
Dim CveProveedorContacto As Integer = -1
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
<td width="300px" align="left">Concepto</td>
|
||||
<td width="100px" align="center">Referencia</td>
|
||||
<td width="100px" align="center">Referencia Movto</td>
|
||||
<td width="100px" align="center">SubProyecto <asp:Label ID="LblSubProyecto" runat="server"></asp:Label> </td>
|
||||
<td width="100px" align="center"><asp:Label ID="LblSubProyecto" runat="server"></asp:Label> </td>
|
||||
<td width="100px" align="center">Cargos</td>
|
||||
<td width="100px" align="center">Abonos</td>
|
||||
<td width="100px" align="center">Saldo</td>
|
||||
|
||||
@@ -1027,7 +1027,7 @@
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaComplemento" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="XML" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="PDF" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="PDF" ItemStyle-HorizontalAlign="Center" Visible="false" />
|
||||
<asp:BoundField HeaderText="Estatus" Visible="false" DataField="StrEstatus" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
|
||||
|
||||
<asp:TemplateField HeaderText="Cancelar" Visible="false" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
|
||||
|
||||
@@ -308,6 +308,9 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
BtnDescontabilizar.Visible = False
|
||||
LnkFolioManual.Visible = True
|
||||
End If
|
||||
If Request("Contabiliza") IsNot Nothing Then
|
||||
Contabilizar()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -359,6 +362,8 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
GvMov.Columns(5).Visible = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -2145,13 +2150,12 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
dtt = ObjBancos.DtResultados
|
||||
If dtt.Rows.Count > 0 Then
|
||||
UpComplementoPagos.Visible = True
|
||||
'GvComplementoPagos.Columns(7).Visible = True
|
||||
' si tiene el permiso para eliminar IE o editar IE
|
||||
If UsuarioActual.TienePermisoProceso(85) OrElse UsuarioActual.TienePermisoProceso(99) Then GvComplementoPagos.Columns(6).Visible = True
|
||||
Else
|
||||
DVGenerarComplementoModal.Visible = True
|
||||
End If
|
||||
GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "SerieFolioPago", "FechaComplemento", "Importe", "CveIE"})
|
||||
GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "SerieFolioPago", "FechaComplemento", "Importe", "CveIE", "RFCReceptor", "CvePAC"})
|
||||
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
@@ -2236,7 +2240,7 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
Str.AppendFormat("Folio: <b>{0}</b> ", Banco.ComplementoSerieFolio)
|
||||
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">XML <i class=""fa fa-file""></i></i></a> ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
|
||||
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">PDF <i class=""fa fa-ad-pdf""></i></i></i></a> ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
|
||||
MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
|
||||
'MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
|
||||
End If
|
||||
Else
|
||||
Banco.RollBack()
|
||||
@@ -2252,7 +2256,8 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
|
||||
'If e.Row.DataKey("Tipo") = "Ing" Then
|
||||
e.Row.Cells(3).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-file-code-o""></i></a>", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
|
||||
e.Row.Cells(4).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-ad-pdf""></i></a>", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
|
||||
'e.Row.Cells(4).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-ad-pdf""></i></a>", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
|
||||
|
||||
|
||||
'End If
|
||||
End If
|
||||
|
||||
@@ -8,8 +8,6 @@ Imports Extensiones
|
||||
|
||||
Partial Class RepCuadreContaAdmonDetalle
|
||||
Inherits ClsPaginas
|
||||
Private Shared missing As Object = System.Reflection.Missing.Value
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
@@ -126,7 +124,7 @@ Partial Class RepCuadreContaAdmonDetalle
|
||||
End If
|
||||
|
||||
If e.Row.DataKey("CvePrePoliza").ToEntero > 0 Then
|
||||
Dim LigaPrePoliza As String = $"/Contabilidad/RegPrepolizaS.aspx?CvePrePoliza={e.Row.DataKey("CvePrePoliza")}&Tipo=1"
|
||||
Dim LigaPrePoliza As String = $"/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("CvePrePoliza")}&Tipo=1"
|
||||
e.Row.FCLiteral("LtlCargoAdmon").Text = "<a Target=_blank href=""" & LigaPrePoliza & """> " & e.Row.FCLiteral("LtlCargoAdmon").Text & " </a>"
|
||||
e.Row.FCLiteral("LtlAbonoAdmon").Text = "<a Target=_blank href=""" & LigaPrePoliza & """> " & e.Row.FCLiteral("LtlAbonoAdmon").Text & " </a>"
|
||||
End If
|
||||
|
||||
@@ -334,6 +334,8 @@ Partial Class Contratos_ModificarPresupuesto
|
||||
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
|
||||
Dim CveClasificacion As Integer = DdlModalClasificacion.SelectedValue.ToEntero
|
||||
|
||||
Dim dt As DataTable = GlobalDTTiposGastos(UsuarioActual.CveEmpresa, 1)
|
||||
|
||||
If CveClasificacion > 0 Then
|
||||
|
||||
Dim ObjCont As New ClsContratos
|
||||
|
||||
@@ -288,6 +288,16 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Tipo Gasto" DataField="TipoGasto" />
|
||||
<asp:TemplateField HeaderText="Amp/Reduc" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="125px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblAmpReduc" CssClass="LabelGVTotal" runat="server" Text='<%# Eval("AmpReduc", "{0:###,###,###.00}") %>' ></asp:Label>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<b>Total:</b>
|
||||
<asp:Label ID="LblAmpReducFoot" CssClass="LabelGVTotal" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<FooterStyle CssClass="Totales" />
|
||||
</asp:GridView>
|
||||
|
||||
@@ -126,7 +126,10 @@ Partial Class Contratos_Presupuestos
|
||||
End If
|
||||
If e.Row.RowType = DataControlRowType.Footer Then
|
||||
Dim Importe As Decimal = DtClasificaciones.SUM("Importe", "CveAgrupador IS NOT NULL")
|
||||
Dim AmpReduc As Decimal = DtClasificaciones.SUM("AmpReduc", "CveAgrupador IS NOT NULL")
|
||||
|
||||
e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe)
|
||||
e.Row.FCLabel("LblAmpReducFoot").Text = String.Format("{0:C}", AmpReduc)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -74,11 +74,19 @@ Partial Class Contratos_RepPresupuestos
|
||||
|
||||
Private Sub CargaSubProyecto()
|
||||
DdlSubProyecto.Items.Clear()
|
||||
If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
|
||||
If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110) Then
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1)
|
||||
Else
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, -1, DdlProyecto.SelectedValue.ToEntero, -1)
|
||||
End If
|
||||
|
||||
'DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
|
||||
End If
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyecto.DataBind()
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
ddd
|
||||
<asp:GridView ID="GvLista" runat="server" DataKeyNames="CveTimbre">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="SerieFolio" HeaderText="TipoImpuesto" />
|
||||
<asp:BoundField DataField="Fecha" HeaderText="BaseRetencion" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<div id="DModalRetencion" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
@@ -131,27 +139,40 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvD" runat="server" DataKeyNames="TipoImpuesto,ClaveTipoImpuesto,BaseRetencion,ClaveTipoPago,TipoPago,ImpuestoRetenido"></asp:GridView>
|
||||
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" DataKeyNames="TipoImpuesto,ClaveTipoImpuesto,BaseRetencion,ClaveTipoPagoRetencion,TipoPagoRetencion,MontoRetencion">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="TipoImpuesto" HeaderText="TipoImpuesto" />
|
||||
<asp:BoundField DataField="BaseRetencion" HeaderText="BaseRetencion" />
|
||||
<asp:BoundField DataField="TipoPagoRetencion" HeaderText="TipoPagoRetencion" />
|
||||
<asp:BoundField DataField="MontoRetencion" HeaderText="MontoRetencion" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtTotal1.ClientID.ToString()%>">Base Impuesto:</label>
|
||||
<asp:TextBox ID="TxtTotal1" runat="server" Width="100px"></asp:TextBox>
|
||||
<label for="<%= TxtTotal1.ClientID.ToString()%>">Total monto operaciones:</label>
|
||||
<asp:TextBox ID="TxtTotal1" runat="server" Width="80px" Text="0.00"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtTotal2.ClientID.ToString()%>">Base Impuesto:</label>
|
||||
<asp:TextBox ID="TxtTotal2" runat="server" Width="100px"></asp:TextBox>
|
||||
<label for="<%= TxtTotalGravado.ClientID.ToString()%>">Total Gravado:</label>
|
||||
<asp:TextBox ID="TxtTotalGravado" runat="server" Width="80px" Text="0.00"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtTotal3.ClientID.ToString()%>">Base Impuesto:</label>
|
||||
<asp:TextBox ID="TxtTotal3" runat="server" Width="100px"></asp:TextBox>
|
||||
<label for="<%= TxtTotalExento.ClientID.ToString()%>">Total Exento:</label>
|
||||
<asp:TextBox ID="TxtTotalExento" runat="server" Width="80px" Text="0.00"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtTotalRetenciones.ClientID.ToString()%>">Total Retenciones:</label>
|
||||
<asp:TextBox ID="TxtTotalRetenciones" runat="server" Width="80px" Text="0.00"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,10 +42,23 @@ Partial Class General_TimbraRetencion
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
EnviarNotificacionWhatsApp("6621430964", "Hola")
|
||||
DdlClientes.setEsWebService(True)
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGral As New ClsGenerales
|
||||
|
||||
If ObjGral.GetGralTimbre(-1, "Ret", Now.AddMonths(-1), Now, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
Dim dt As DataTable = ObjGral.DtResultados
|
||||
GvLista.DataSource = dt
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
GvLista.DataBind()
|
||||
End Sub
|
||||
|
||||
#Region "Timbra"
|
||||
Private Function TimbraRetencion(cfditimbre As CFDITimbreRetenciones, UsuarioActual As Usuario) As String
|
||||
Dim sw As New Diagnostics.Stopwatch
|
||||
@@ -234,7 +247,8 @@ Partial Class General_TimbraRetencion
|
||||
Dim NombreArchivoXML As String = ""
|
||||
Dim objGrales As New ClsGenerales
|
||||
objGrales.IniciaTransacSQL()
|
||||
Dim tCveTimbre As Integer = objGrales.AddGralTimbre("Ret", 12679, cfditimbre.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim tCveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||
Dim tCveTimbre As Integer = objGrales.AddGralTimbre("Ret", tCveSubProyecto, cfditimbre.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
NombreArchivoXML = $"{objGrales.SerieInsertada}-{objGrales.FolioInsertado}.xml"
|
||||
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
|
||||
|
||||
@@ -283,6 +297,19 @@ Partial Class General_TimbraRetencion
|
||||
|
||||
|
||||
Protected Sub BtnEmitirRetencion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim dr As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
Dim ReceptorRFC As String = ""
|
||||
Dim ReceptorCP As String = ""
|
||||
Dim ReceptorNombre As String = ""
|
||||
If dr IsNot Nothing Then
|
||||
ReceptorRFC = dr("RFC").ToString
|
||||
ReceptorCP = dr("CP").ToString
|
||||
ReceptorNombre = dr("Nombre").ToString
|
||||
Else
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim cfditimbre As New CFDITimbreRetenciones
|
||||
cfditimbre.Fecha = Now
|
||||
cfditimbre.Retencion.ClaveRetencion = DdlClaveRetencion.SelectedValue
|
||||
@@ -290,21 +317,23 @@ Partial Class General_TimbraRetencion
|
||||
cfditimbre.Retencion.PeriodoMesFin = DdlPeriodoFin.SelectedValue
|
||||
cfditimbre.Retencion.PeriodoEjercicio = DdlEjercicio.SelectedValue.ToEntero
|
||||
cfditimbre.Retencion.LugarExpedicion = UsuarioActual.Empresa.CP
|
||||
cfditimbre.Receptor.RFCR = "AEMV690902NM5"
|
||||
cfditimbre.Receptor.RFCR = ReceptorRFC '"AEMV690902NM5"
|
||||
cfditimbre.Receptor.NacionalidadR = "Nacional"
|
||||
cfditimbre.Receptor.DomicilioFiscalR = "11950"
|
||||
cfditimbre.Receptor.NombreDenominacionR = "VERONICA MICHELLE ARMENTA MASON"
|
||||
cfditimbre.Receptor.DomicilioFiscalR = ReceptorCP '"11950"
|
||||
cfditimbre.Receptor.NombreDenominacionR = ReceptorNombre '"VERONICA MICHELLE ARMENTA MASON"
|
||||
cfditimbre.CFDIRelacionados.TipoRelacion = "01"
|
||||
cfditimbre.CFDIRelacionados.UUID.Add("671fdb07-406a-42a6-9a89-40219f663ea1")
|
||||
cfditimbre.ISRCorrespondiente = 705
|
||||
cfditimbre.RetencionesImpuestos.Add(New CFDIImpuestosRetenidos With {.MontoRetencion = 705, .BaseRetencion = 0, .ImpuestoRetencion = "01", .TipoPagoRetencion = "04"})
|
||||
|
||||
'cfditimbre.RetencionesImpuestos.Add(New CFDIImpuestosRetenidos With {.MontoRetencion = 705, .BaseRetencion = 0, .ImpuestoRetencion = "01", .TipoPagoRetencion = "04"})
|
||||
|
||||
For Each gvr As GridViewRow In GvD.Rows
|
||||
Dim ret As New CFDIImpuestosRetenidos With {.BaseRetencion = gvr.DataKey("BaseRetencion").ToDecimal,
|
||||
.ImpuestoRetencion = gvr.DataKey("ImpuestoRetencion")}
|
||||
.MontoRetencion = gvr.DataKey("MontoRetencion").ToDecimal,
|
||||
.ImpuestoRetencion = gvr.DataKey("ClaveTipoImpuesto"),
|
||||
.TipoPagoRetencion = gvr.DataKey("ClaveTipoPagoRetencion")}
|
||||
cfditimbre.RetencionesImpuestos.Add(ret)
|
||||
Next
|
||||
|
||||
cfditimbre.ISRCorrespondiente = cfditimbre.TotalImpuestosRetenidos
|
||||
|
||||
TimbraRetencion(cfditimbre, UsuarioActual)
|
||||
|
||||
@@ -320,21 +349,21 @@ Partial Class General_TimbraRetencion
|
||||
DtDetalle.Columns.Add("TipoImpuesto", GetType(String))
|
||||
DtDetalle.Columns.Add("ClaveTipoImpuesto", GetType(String))
|
||||
DtDetalle.Columns.Add("BaseRetencion", GetType(Decimal))
|
||||
DtDetalle.Columns.Add("ClaveTipoPago", GetType(String))
|
||||
DtDetalle.Columns.Add("TipoPago", GetType(String))
|
||||
DtDetalle.Columns.Add("ImpuestoRetenido", GetType(Decimal))
|
||||
DtDetalle.Columns.Add("ClaveTipoPagoRetencion", GetType(String))
|
||||
DtDetalle.Columns.Add("TipoPagoRetencion", GetType(String))
|
||||
DtDetalle.Columns.Add("MontoRetencion", GetType(Decimal))
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim dr As DataRow = DtDetalle.NewRow
|
||||
dr("TipoImpuesto") = DdlTipoImpuesto.Text
|
||||
dr("TipoImpuesto") = DdlTipoImpuesto.SelectedItem.Text
|
||||
dr("ClaveTipoImpuesto") = DdlTipoImpuesto.SelectedValue
|
||||
dr("BaseRetencion") = TxtBase.Text.ToDecimal
|
||||
dr("ClaveTipoPago") = DdlTipoPagoRet.SelectedValue
|
||||
dr("TipoPago") = DdlTipoPagoRet.Text
|
||||
dr("ImpuestoRetenido") = TxtImpuestoRetenido.Text.ToDecimal
|
||||
dr("ClaveTipoPagoRetencion") = DdlTipoPagoRet.SelectedValue
|
||||
dr("TipoPagoRetencion") = DdlTipoPagoRet.SelectedItem.Text
|
||||
dr("MontoRetencion") = TxtImpuestoRetenido.Text.ToDecimal
|
||||
|
||||
DtDetalle.Rows.Add(dr)
|
||||
|
||||
|
||||
@@ -303,20 +303,31 @@
|
||||
<asp:UpdatePanel ID="UpIndicadores" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div id="DivIndicadores" visible="false" class="row" runat="server">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-md-3">
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">Existencia</h4>
|
||||
<div class="widget-thumb-wrap">
|
||||
<i class="widget-thumb-icon bg-yellow fa fa-cubes"></i>
|
||||
<div class="widget-thumb-body">
|
||||
<span class="widget-thumb-body-stat">
|
||||
<asp:Literal ID="LtIndicador_Existencia" Text="" runat="server" />
|
||||
</span>
|
||||
<div class="row">
|
||||
<div class="col-md-6" id="divTotalExistencia" runat="server">
|
||||
<span class="widget-thumb-body-stat">
|
||||
<span class="widget-thumb-subtitle"> </span>
|
||||
<asp:Literal ID="LtIndicador_Existencia" Text="" runat="server" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-6" id="DivIndicadorOC" runat="server" visible="false" >
|
||||
<span class="widget-thumb-subtitle">OC</span>
|
||||
<span class="widget-thumb-body-stat">
|
||||
<asp:LinkButton ID="LnkIndicador_OC" Text="" OnClick="LnkIndicador_OC_Click" runat="server" CssClass="Texto" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-md-3">
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">Valor</h4>
|
||||
<div class="widget-thumb-wrap">
|
||||
@@ -340,7 +351,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-md-3">
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">Costo Promedio</h4>
|
||||
<div class="widget-thumb-wrap">
|
||||
@@ -364,7 +375,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-md-3">
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">Ultimo Costo</h4>
|
||||
<div class="widget-thumb-wrap">
|
||||
@@ -387,20 +398,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-3 col-xs-6" id="DivIndicadorOC" visible="false" runat="server">
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">OC</h4>
|
||||
<div class="widget-thumb-wrap">
|
||||
<i class="widget-thumb-icon bg-yellow fa fa-cubes"></i>
|
||||
<div class="widget-thumb-body">
|
||||
<span class="widget-thumb-body-stat">
|
||||
<asp:LinkButton ID="LnkIndicador_OC" Text="" OnClick="LnkIndicador_OC_Click" runat="server" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -530,18 +528,18 @@
|
||||
<div id="ModalOC" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalOC" UpdateMode="Conditional" RenderMode="Inline" style="width: 50%">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content" style="width:500px;">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal3" Text="OC Pendientes X Recibir" runat="server"> </asp:Literal></h4>
|
||||
<asp:Literal ID="Literal3" Text="OC Pendientes por Recibir" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="width: 100%">
|
||||
<div class="row" >
|
||||
<asp:GridView ID="GvOC" Width="100%" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="False" AllowPaging="False"
|
||||
ShowFooter="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover ScrollAD" GridLines="None"
|
||||
ShowFooter="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" GridLines="None"
|
||||
DataKeyNames="CveOrdenCompra,CveOrdenCompraDetalle,Fecha,Folio,CantidadPendienteVincular">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Folio" DataField="Folio" />
|
||||
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOrdenCompra" DataTextField="SerieFolio" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" />
|
||||
<asp:BoundField HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" DataField="Fecha" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="CantidadPendienteVincular" DataFormatString="{0:#,###}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField HeaderText="Cancelar" ItemStyle-HorizontalAlign="Center" >
|
||||
|
||||
@@ -3051,6 +3051,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(tCvePrePoliza, False, ImporteIngresoAdicional, ImporteIngresoAdicional, 68, tReferencia, tConcepto, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimientoVirtual) Then
|
||||
ErrorMovInv = True
|
||||
ObjConta.ValidacionesPrePoliza(tCvePrePoliza, UsuarioActual) ' contabilizar
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
|
||||
@@ -353,7 +353,7 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
|
||||
If TieneError = False Then
|
||||
ObjInventarios.Commit()
|
||||
Alert($"El Traspaso se guardó correctamente con el folio #: <b>{Folio}</b>.", TipoMensaje.MsgInformacion)
|
||||
Alert($"La Solicitud de Traspaso se guardó correctamente en el folio #: <b>{Folio}</b>.", TipoMensaje.MsgInformacion)
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DVModalSolicitudAdd"))
|
||||
CargaDatos()
|
||||
Else
|
||||
|
||||
@@ -3281,7 +3281,7 @@ Partial Class OS_OrdenesServicios
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim Serie As String = "" 'GvRow.DataKey("Serie")
|
||||
Dim Serie As String = drr("Serie").ToString
|
||||
Dim Lote As String = drr("Lote").ToString
|
||||
Dim FechaCaducidad As DateTime = drr("FechaCaducidad").ToString.ToDate
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||
@@ -3541,6 +3541,7 @@ Partial Class OS_OrdenesServicios
|
||||
TmpDTMat.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("Cantidad", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDTMat.Columns.Add("Serie", GetType(String))
|
||||
TmpDTMat.Columns.Add("Lote", GetType(String))
|
||||
TmpDTMat.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
TmpDTMat.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
@@ -3560,6 +3561,7 @@ Partial Class OS_OrdenesServicios
|
||||
drp("CvePS") = CvePS
|
||||
drp("Cantidad") = CantidadRegistro
|
||||
drp("PU") = PU
|
||||
drp("Serie") = GvRow.DataKey("Serie")
|
||||
drp("Lote") = GvRow.DataKey("Lote")
|
||||
drp("FechaCaducidad") = GvRow.DataKey("FechaCaducidad").ToDate
|
||||
TmpDTMat.Rows.Add(drp)
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
<label class="col-md-4">Servicio</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" MaxLength="70" Width="100%"
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" MaxLength="250" Width="100%"
|
||||
TextMode="MultiLine"
|
||||
Rows="3"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion"
|
||||
|
||||
@@ -277,9 +277,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSubProyectoModal"></asp:Label>
|
||||
@@ -385,50 +383,52 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Cantidad de pasajeros</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Cantidad de pasajeros</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" CssClass="form-control" CausesValidation="True"
|
||||
Width="100%"
|
||||
type="number" MaxLength="2" AutoPostBack="True" OnTextChanged="OnChangePasajeros"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCantidadPasajeros" runat="server" ControlToValidate="TxtCantidadPasajeros"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad de pasajeros''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECantidadPasajeros" runat="server" HighlightCssClass="VCOCantidadPasajeros"
|
||||
TargetControlID="RFVCantidadPasajeros" Width="100%">
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-users"></i>
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" CssClass="form-control" CausesValidation="True"
|
||||
Width="100%"
|
||||
type="number" MaxLength="2" AutoPostBack="True" OnTextChanged="OnChangePasajeros"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCantidadPasajeros" runat="server" ControlToValidate="TxtCantidadPasajeros"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad de pasajeros''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECantidadPasajeros" runat="server" HighlightCssClass="VCOCantidadPasajeros"
|
||||
TargetControlID="RFVCantidadPasajeros" Width="100%">
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-users"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-4">Tipo Unidad</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
<div class="row">
|
||||
<label class="col-md-4">Tipo Unidad</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
|
||||
<asp:DropDownList ID="DdlTipoAF" AppendDataBoundItems="true" DataTextField="TipoActivoFijo"
|
||||
DataValueField="CveTipoActivoFijo" Class="table-group-action-input form-control input-inline select2me"
|
||||
Width="100%" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoAF" runat="server" ControlToValidate="DdlTipoAF" InitialValue="-1"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Unidad''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoAF" runat="server" HighlightCssClass="vco"
|
||||
TargetControlID="RFVTipoAF" Width="400px">
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-bus"></i>
|
||||
<asp:DropDownList ID="DdlTipoAF" AppendDataBoundItems="true" DataTextField="TipoActivoFijo"
|
||||
DataValueField="CveTipoActivoFijo" Class="table-group-action-input form-control input-inline select2me"
|
||||
Width="100%" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoAF" runat="server" ControlToValidate="DdlTipoAF" InitialValue="-1"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Unidad''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoAF" runat="server" HighlightCssClass="vco"
|
||||
TargetControlID="RFVTipoAF" Width="400px">
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-bus"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Importe</label>
|
||||
<div class="col-md-8">
|
||||
|
||||
@@ -116,38 +116,94 @@
|
||||
|
||||
<ajax:TabPanel ID="TabPedidos" runat="server" HeaderText="Pedidos">
|
||||
<ContentTemplate>
|
||||
<div style="min-height: 250px; overflow-x: scroll">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" DataKeyNames="CveCliente,CveVendedor,CveSubProyecto,CvePS,CveUnidadMedida,Cantidad,PU,CveVentaDetalle,GastosEnvio" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:TemplateField >
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblCliente" runat="server" Text='<%#Eval("NombreComercial") %>'></asp:Label><br />
|
||||
<asp:Label ID="LblDir" Font-Italic="true" runat="server" Text='<%#Eval("DireccionEnvio") %>'></asp:Label>
|
||||
|
||||
<div style="min-height: 250px; overflow-x: scroll">
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn"
|
||||
DataKeyNames="CveCliente,CveVendedor,CveSubProyecto,CvePS,CveUnidadMedida,Cantidad,PU,CveVentaDetalle,GastosEnvio,CveVenta,SerieFolio,CodigoPS,CantidadOrg,CvePSOrg,CodigoPSOrg" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblCliente" runat="server" Text='<%#Eval("NombreComercial") %>'></asp:Label><br />
|
||||
<asp:Label ID="LblDir" Font-Italic="true" runat="server" Text='<%#Eval("DireccionEnvio") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="SerieFolio" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblSerieFolio" runat="server" Text='<%#Eval("SerieFolio") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblFecha" runat="server" Text='<%# Eval("Fecha", "{0:dd/MM/yyyy}") %>' ></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" MaxLength="12" style="text-align:right" Text='<%# Eval("Cantidad", "{0:0.######}") %>' Width="45px" Height="24px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtCantidad" FilterType="Custom" ValidChars="1234567890." />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.####}") %>' ></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="SerieFolio" DataField="SerieFolio" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" />
|
||||
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="2.5%">
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Producto">
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList runat="server" ID="DdlPS" DataTextField="CodigoPS" CssClass="form-control select2me" Width="100%" DataValueField="CvePS" ></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblProducto" runat="server" Text='<%#Eval("CodigoPS") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblVendedor" runat="server" Text='<%#Eval("Vendedor") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Editar">
|
||||
<EditItemTemplate >
|
||||
<div style="width: 85px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GprGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Checkbox runat="server" ID="chk" ></asp:Checkbox>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align:center;">
|
||||
<asp:Button ID="BtnEntregar" runat="server" Text="Entregado" class="btn btn-primary" OnClick="BtnEntregar_Click" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="2.5%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chk"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:Button ID="BtnEntregar" runat="server" Text="Entregado" class="btn btn-primary" OnClick="BtnEntregar_Click" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel ID="TabEntregas" runat="server" HeaderText="Entregas">
|
||||
<ContentTemplate>
|
||||
@@ -175,5 +231,16 @@
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
function seleccionVenta(chkId, cveVenta) {
|
||||
// Obtener el estado actual del checkbox que fue clicado
|
||||
var isChecked = $('#' + chkId).prop('checked');
|
||||
|
||||
// Seleccionar o deseleccionar todos los checkboxes que tienen la clase 'cveVenta'
|
||||
$('.' + cveVenta).each(function () {
|
||||
$(this).prop('checked', isChecked);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -1,16 +1,49 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Activities.Expressions
|
||||
Imports System.Data
|
||||
Imports DocumentFormat.OpenXml.Office.CustomUI
|
||||
Imports Extensiones
|
||||
Partial Class Ventas_RepPedidosSTF
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property DTProductosEdicion As DataTable
|
||||
Get
|
||||
If ViewState("DTProductosEdicion") Is Nothing Then
|
||||
ViewState("DTProductosEdicion") = New DataTable
|
||||
End If
|
||||
Return DirectCast(ViewState("DTProductosEdicion"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTProductosEdicion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DatosGV As DataTable
|
||||
Get
|
||||
If ViewState("DatosGV") Is Nothing Then
|
||||
ViewState("DatosGV") = New DataTable
|
||||
End If
|
||||
Return DirectCast(ViewState("DatosGV"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DatosGV") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
If Not IsPostBack Then
|
||||
|
||||
CargaCombos()
|
||||
CargaProductosEdicion()
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
@@ -34,6 +67,8 @@ Partial Class Ventas_RepPedidosSTF
|
||||
|
||||
Protected Sub CargaDatos()
|
||||
|
||||
DatosGV = New DataTable
|
||||
|
||||
Dim Opcion As Integer = 1
|
||||
Dim FechaInicio As Date = MinFecha
|
||||
Dim FechaFin As Date = MaxFecha
|
||||
@@ -43,15 +78,26 @@ Partial Class Ventas_RepPedidosSTF
|
||||
FechaInicio = txtFechaI.Text.ToDate
|
||||
FechaFin = txtFechaF.Text.ToDate
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin) Then
|
||||
GvE.DataSource = ObjVentas.DtResultados
|
||||
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvE.DataBind()
|
||||
Else
|
||||
FechaInicio = txtFechaI.Text.ToDate
|
||||
FechaFin = txtFechaF.Text.ToDate
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DatosGV = ObjVentas.DtResultados
|
||||
|
||||
DatosGV.Columns.Add("CantidadOrg", GetType(Decimal))
|
||||
DatosGV.Columns.Add("CvePSOrg", GetType(Integer))
|
||||
DatosGV.Columns.Add("CodigoPSOrg", GetType(String))
|
||||
|
||||
GvDatos.DataSource = DatosGV
|
||||
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
@@ -59,19 +105,119 @@ Partial Class Ventas_RepPedidosSTF
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub CargaProductosEdicion()
|
||||
|
||||
DTProductosEdicion = New DataTable
|
||||
Dim ObjVentas As ClsVentas = New ClsVentas()
|
||||
If ObjVentas.GetPSSubProyectosVendedores(UsuarioActual.CveEmpresa) Then
|
||||
DTProductosEdicion = ObjVentas.DtResultados.FiltraParametros($" CveVendedor = {UsuarioActual.CveVendedor}")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then e.Row.FCCheckBox("Chk").Visible = False
|
||||
If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then
|
||||
e.Row.FCCheckBox("Chk").InputAttributes.Add("onclick", $"seleccionVenta('{e.Row.FCCheckBox("Chk").ClientID}','{e.Row.DataKey("CveVenta")}')")
|
||||
e.Row.FCLinkButton("imgE").Visible = False
|
||||
Else
|
||||
e.Row.FCCheckBox("Chk").InputAttributes.Add("class", e.Row.DataKey("CveVenta"))
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("TipoRenglon") = "1" Then e.Row.CssClass = "SubTotales"
|
||||
|
||||
End If
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then
|
||||
Else
|
||||
|
||||
e.Row.FCDropDownList("DdlPS").DataSource = DTProductosEdicion
|
||||
e.Row.FCDropDownList("DdlPS").DataBind()
|
||||
e.Row.FCDropDownList("DdlPS").SelectedValueExist(e.Row.DBCampo("CvePS"))
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvDatos_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
CargaGvDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
|
||||
CargaGvDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
|
||||
Dim Cantidad As Decimal = GvDatos.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
Dim CvePSNuevo As Integer = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlPS").SelectedValue.ToEntero
|
||||
Dim PSNuevo As String = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlPS").SelectedItem.Text
|
||||
Dim PU As Decimal = DTProductosEdicion.FiltroPrimeroValor("Precio", $"CvePS = {CvePSNuevo}").ToDecimal
|
||||
|
||||
If Not CvePSNuevo > 0 Then
|
||||
Alert("Producto no encontrado.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not Cantidad > 0 Then
|
||||
Alert("Debe especificar la cantidad.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not PU > 0 Then
|
||||
Alert("El precio del producto no puede ser 0.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim CvPSOrg As Integer = DatosGV.Rows(GvDatos.EditIndex)("CvePSOrg").ToString.ToEntero
|
||||
Dim CantidadOrg As Decimal = DatosGV.Rows(GvDatos.EditIndex)("CantidadOrg").ToString.ToDecimal
|
||||
|
||||
If Not (CvPSOrg > 0 Or CantidadOrg > 0) Then
|
||||
DatosGV.Rows(GvDatos.EditIndex)("CantidadOrg") = GvDatos.Rows(GvDatos.EditIndex).DataKey("Cantidad")
|
||||
DatosGV.Rows(GvDatos.EditIndex)("CvePSOrg") = GvDatos.Rows(GvDatos.EditIndex).DataKey("CvePS")
|
||||
DatosGV.Rows(GvDatos.EditIndex)("CodigoPSOrg") = GvDatos.Rows(GvDatos.EditIndex).DataKey("CodigoPS")
|
||||
End If
|
||||
|
||||
DatosGV.Rows(GvDatos.EditIndex)("Cantidad") = Cantidad
|
||||
DatosGV.Rows(GvDatos.EditIndex)("CvePS") = CvePSNuevo
|
||||
DatosGV.Rows(GvDatos.EditIndex)("CodigoPS") = PSNuevo
|
||||
DatosGV.Rows(GvDatos.EditIndex)("PU") = PU
|
||||
|
||||
DatosGV.AcceptChanges()
|
||||
|
||||
GvDatos.EditIndex = -1
|
||||
|
||||
GvDatos.DataSource = DatosGV
|
||||
GvDatos.DataBind()
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGvDatos()
|
||||
GvDatos.DataSource = DatosGV
|
||||
GvDatos.DataBind()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnEntregar_Click(sender As Object, e As EventArgs)
|
||||
'validar que están seleccionados
|
||||
Dim TmpDTRemis As New DataTable
|
||||
@@ -84,9 +230,16 @@ Partial Class Ventas_RepPedidosSTF
|
||||
TmpDTRemis.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDTRemis.Columns.Add("CveVendedor", GetType(Decimal))
|
||||
TmpDTRemis.Columns.Add("GastosEnvio", GetType(Decimal))
|
||||
TmpDTRemis.Columns.Add("Observacion", GetType(String))
|
||||
|
||||
TmpDTRemis.Columns.Add("CantidadOrg", GetType(Decimal))
|
||||
TmpDTRemis.Columns.Add("CvePSOrg", GetType(Integer))
|
||||
TmpDTRemis.Columns.Add("CodigoPSOrg", GetType(String))
|
||||
'agruparo por cliente
|
||||
|
||||
For Each gvr As GridViewRow In GvDatos.Rows
|
||||
If gvr.FCCheckBox("chk").Checked Then
|
||||
|
||||
If gvr.DataKey("CveVendedor").ToEntero > 0 AndAlso gvr.DataKey("CvePS").ToEntero > 0 AndAlso gvr.FCCheckBox("chk").Checked Then
|
||||
Dim drp As DataRow = TmpDTRemis.NewRow
|
||||
drp("CvePS") = gvr.DataKey("CvePS").ToEntero
|
||||
drp("Cantidad") = gvr.DataKey("Cantidad").ToDecimal
|
||||
@@ -97,10 +250,18 @@ Partial Class Ventas_RepPedidosSTF
|
||||
drp("CveVendedor") = gvr.DataKey("CveVendedor").ToEntero
|
||||
drp("CveVentaDetalle") = gvr.DataKey("CveVentaDetalle").ToEntero
|
||||
drp("GastosEnvio") = gvr.DataKey("GastosEnvio").ToDecimal
|
||||
drp("Observacion") = gvr.DataKey("SerieFolio")
|
||||
|
||||
drp("CantidadOrg") = gvr.DataKey("CantidadOrg").ToDecimal
|
||||
drp("CvePSOrg") = gvr.DataKey("CvePSOrg").ToEntero
|
||||
drp("CodigoPSOrg") = gvr.DataKey("CodigoPSOrg")
|
||||
|
||||
TmpDTRemis.Rows.Add(drp)
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
|
||||
If TmpDTRemis IsNot Nothing AndAlso TmpDTRemis.Rows.Count = 0 Then
|
||||
Alert("No se ha seleccionado ninguna partida, favor de seleccionar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -118,7 +279,19 @@ Partial Class Ventas_RepPedidosSTF
|
||||
For Each dr As DataRow In TmpDTRemis.FiltraParametros($"CveCliente ={drt("CveCliente")} AND CveVendedor = {drt("CveVendedor")} AND CveSubProyecto = {drt("CveSubProyecto")}").Rows
|
||||
|
||||
If ObjFactura IsNot Nothing Then
|
||||
If Not ObjFactura.AgregarPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDecimal, dr("PU").ToString.ToDecimal, 0, "", CveSubProyecto:=dr("CveSubProyecto").ToString.ToEntero, CveVentaDetallePadre:=dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
|
||||
Dim Obs As String = dr("Observacion").ToString
|
||||
|
||||
If (dr("CantidadOrg").ToString.ToEntero > 0) AndAlso (dr("Cantidad").ToString.ToDecimal <> dr("CantidadOrg").ToString.ToDecimal) Then
|
||||
Obs = $"{Obs}, Cantidad Original: {dr("CantidadOrg").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
End If
|
||||
|
||||
|
||||
If (dr("CvePSOrg").ToString.ToEntero > 0) AndAlso (dr("CvePS").ToString.ToEntero <> dr("CvePSOrg").ToString.ToEntero) Then
|
||||
Obs = $"{Obs}, Producto Original: {dr("CodigoPSOrg").ToString}"
|
||||
End If
|
||||
|
||||
If Not ObjFactura.AgregarPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDecimal, dr("PU").ToString.ToDecimal, 0, Obs, CveSubProyecto:=dr("CveSubProyecto").ToString.ToEntero, CveVentaDetallePadre:=dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
Exit For
|
||||
@@ -131,8 +304,15 @@ Partial Class Ventas_RepPedidosSTF
|
||||
Next
|
||||
|
||||
If drt("GastosEnvio").ToString.ToDecimal > 0 Then
|
||||
Dim tCvePSEnvio As Integer = usuarioactual.empresa.Funcionalidad(160).toentero
|
||||
If Not ObjFactura.AgregarPS(tCvePSEnvio, 1, drt("GastosEnvio").ToString.ToDecimal, 0, "", CveSubProyecto:=drt("CveSubProyecto").ToString.ToEntero) Then
|
||||
Dim tCvePSEnvio As Integer = UsuarioActual.Empresa.Funcionalidad(160).ToEntero
|
||||
|
||||
Dim Obs As String = drt("Observacion").ToString
|
||||
|
||||
If (drt("CantidadOrg").ToString.ToEntero > 0 Or drt("CvePSOrg").ToString.ToEntero > 0) AndAlso (drt("CvePS").ToString.ToEntero <> drt("CvePSOrg").ToString.ToEntero Or drt("Cantidad").ToString.ToDecimal <> drt("CantidadOrg").ToString.ToDecimal) Then
|
||||
Obs = $"{Obs} - Cantidad Original: {drt("CantidadOrg").ToString.ToDecimal.ToString("###,###,###.00")}, Producto Original: {drt("CodigoPSOrg").ToString}"
|
||||
End If
|
||||
|
||||
If Not ObjFactura.AgregarPS(tCvePSEnvio, 1, drt("GastosEnvio").ToString.ToDecimal, 0, Obs, CveSubProyecto:=drt("CveSubProyecto").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user