Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -481,7 +481,7 @@ Partial Class RepCxCDetalle
|
|||||||
DdlContrato.DataBind()
|
DdlContrato.DataBind()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Function CargaDatos() As DataSet
|
Private Function CargaDatos(Optional Impresion As Boolean = True) As DataSet
|
||||||
|
|
||||||
Dim DSRespuesta As New DataSet
|
Dim DSRespuesta As New DataSet
|
||||||
|
|
||||||
@@ -515,12 +515,12 @@ Partial Class RepCxCDetalle
|
|||||||
CveContrato:=DdlContrato.SelectedValue.ToEntero, Aseguradora:=DdlAseguradora.SelectedValue.ToEntero, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then
|
CveContrato:=DdlContrato.SelectedValue.ToEntero, Aseguradora:=DdlAseguradora.SelectedValue.ToEntero, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then
|
||||||
|
|
||||||
Dim DTdatos As DataTable = ObjMovtos.DSResultados.Tables(0).Copy
|
Dim DTdatos As DataTable = ObjMovtos.DSResultados.Tables(0).Copy
|
||||||
DTGvSourcePersonalizaRangos(DTdatos)
|
DTGvSourcePersonalizaRangos(DTdatos, Impresion)
|
||||||
GvDatos.DataSource = DTdatos 'ObjMovtos.DSResultados.Tables(0)
|
GvDatos.DataSource = DTdatos 'ObjMovtos.DSResultados.Tables(0)
|
||||||
|
|
||||||
'DTaDAtos = ObjMovtos.DSResultados.Tables(0)
|
'DTaDAtos = ObjMovtos.DSResultados.Tables(0)
|
||||||
'DTaDAtos.TableName = "DTaDAtos"
|
'DTaDAtos.TableName = "DTaDAtos"
|
||||||
DSRespuesta.Tables.Add(ObjMovtos.DSResultados.Tables(0).Copy)
|
DSRespuesta.Tables.Add(DTdatos.Copy)
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
GvCartera.DataSource = ObjMovtos.DSResultados.Tables(1)
|
GvCartera.DataSource = ObjMovtos.DSResultados.Tables(1)
|
||||||
@@ -824,7 +824,7 @@ Partial Class RepCxCDetalle
|
|||||||
|
|
||||||
Dim lrds As New List(Of ReportDataSource)
|
Dim lrds As New List(Of ReportDataSource)
|
||||||
|
|
||||||
Dim DSDatos As DataSet = CargaDatos()
|
Dim DSDatos As DataSet = CargaDatos(Impresion:=True)
|
||||||
Dim dtt1 As DataTable = Nothing
|
Dim dtt1 As DataTable = Nothing
|
||||||
Dim dtt2 As DataTable = Nothing
|
Dim dtt2 As DataTable = Nothing
|
||||||
|
|
||||||
@@ -1262,7 +1262,7 @@ Partial Class RepCxCDetalle
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub DTGvSourcePersonalizaRangos(ByRef DtDatos As DataTable)
|
Private Sub DTGvSourcePersonalizaRangos(ByRef DtDatos As DataTable, Optional Impresion As Boolean = False)
|
||||||
|
|
||||||
DtDatos.Columns.Add("R1", GetType(Decimal))
|
DtDatos.Columns.Add("R1", GetType(Decimal))
|
||||||
DtDatos.Columns.Add("R2", GetType(Decimal))
|
DtDatos.Columns.Add("R2", GetType(Decimal))
|
||||||
@@ -1290,7 +1290,10 @@ Partial Class RepCxCDetalle
|
|||||||
Dim chk As CheckBox = TryCast(TPersonalizar.FindControl(ChkID), CheckBox)
|
Dim chk As CheckBox = TryCast(TPersonalizar.FindControl(ChkID), CheckBox)
|
||||||
|
|
||||||
If chk.Checked Then
|
If chk.Checked Then
|
||||||
|
Impresion = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Impresion Then
|
||||||
For Each dRowDT As DataRow In DtDatos.Rows
|
For Each dRowDT As DataRow In DtDatos.Rows
|
||||||
|
|
||||||
Dim DiasVencidos As Integer = dRowDT("DiasVencidos").ToString.ToEntero
|
Dim DiasVencidos As Integer = dRowDT("DiasVencidos").ToString.ToEntero
|
||||||
@@ -1319,9 +1322,9 @@ Partial Class RepCxCDetalle
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
NumColActual = NumColActual + 1
|
NumColActual = NumColActual + 1
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -135,7 +135,7 @@
|
|||||||
<asp:TemplateField ItemStyle-CssClass="margenbound" HeaderText="P. Promedio">
|
<asp:TemplateField ItemStyle-CssClass="margenbound" HeaderText="P. Promedio">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<%--TODO: Esto puede tronar si el valor es DBNull --%>
|
<%--TODO: Esto puede tronar si el valor es DBNull --%>
|
||||||
<%# If(Convert.ToDecimal(Eval("Cantidad")) = 0, 0.ToString("C"), (Convert.ToDecimal(Eval("SubTotal")) / Convert.ToInt32(Eval("Cantidad"))).ToString("C")) %>
|
<%# If(Convert.ToDecimal(Eval("Cantidad")) = 0, 0.ToString("C"), (Convert.ToDecimal(Eval("SubTotal")) / Convert.ToDecimal(Eval("Cantidad"))).ToString("C")) %>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|||||||
@@ -443,6 +443,8 @@
|
|||||||
<asp:BoundField HeaderText="O.C Kg" DataField="OC_Kilogramos" ItemStyle-Width="5%" Visible="false" />
|
<asp:BoundField HeaderText="O.C Kg" DataField="OC_Kilogramos" ItemStyle-Width="5%" Visible="false" />
|
||||||
<%--22--%>
|
<%--22--%>
|
||||||
<asp:BoundField HeaderText="O.C Cantidad" DataField="OC_Cantidad" ItemStyle-Width="5%" Visible="false" />
|
<asp:BoundField HeaderText="O.C Cantidad" DataField="OC_Cantidad" ItemStyle-Width="5%" Visible="false" />
|
||||||
|
<%--23--%>
|
||||||
|
<asp:BoundField HeaderText="Último Costo" DataField="UltimoCosto" ItemStyle-Width="5%" Visible="false" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
</Columns>
|
</Columns>
|
||||||
<RowStyle CssClass="Texto" />
|
<RowStyle CssClass="Texto" />
|
||||||
<HeaderStyle CssClass="Titulos" />
|
<HeaderStyle CssClass="Titulos" />
|
||||||
@@ -467,43 +469,45 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkObs" runat="server" Text="Observaciones" /></td>
|
<asp:CheckBox ID="ChkObs" runat="server" Text=" Observaciones" /></td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkSucEjec" runat="server" Text="Sucursal Ejecución" /></td>
|
<asp:CheckBox ID="ChkSucEjec" runat="server" Text=" Sucursal Ejecución" /></td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkSucCob" runat="server" Text="Sucursal Cobranza" /></td>
|
<asp:CheckBox ID="ChkSucCob" runat="server" Text=" Sucursal Cobranza" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" />
|
<asp:CheckBox ID="ChkRFC" runat="server" Text=" RFC" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkMetodoPago" runat="server" Text="Método de Pago" />
|
<asp:CheckBox ID="ChkMetodoPago" runat="server" Text=" Método de Pago" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkFormaPago" runat="server" Text="Forma de Pago" />
|
<asp:CheckBox ID="ChkFormaPago" runat="server" Text=" Forma de Pago" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkOC_noOrden" runat="server" Text="O.C." />
|
<asp:CheckBox ID="ChkOC_noOrden" runat="server" Text=" O.C." />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkOC_Kilogramos" runat="server" Text="O.C. Kilogramos" />
|
<asp:CheckBox ID="ChkOC_Kilogramos" runat="server" Text=" O.C. Kilogramos" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkOC_Cantidad" runat="server" Text="O.C. Cantidad" />
|
<asp:CheckBox ID="ChkOC_Cantidad" runat="server" Text=" O.C. Cantidad" />
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkFechaHoraEmision" runat="server" Text="Fecha Hora de Emisión" />
|
<asp:CheckBox ID="ChkFechaHoraEmision" runat="server" Text=" Fecha Hora de Emisión" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkNumTurnos" runat="server" Text="Número de turnos" Visible="false" />
|
<asp:CheckBox ID="ChkNumTurnos" runat="server" Text=" Número de turnos" Visible="false" />
|
||||||
|
</td>
|
||||||
|
<td style="text-align: left;">
|
||||||
|
<asp:CheckBox ID="ChkUltimoCosto" runat="server" Visible="true" Text=" Último Costo" /></td>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
|||||||
GvDatos.Columns(20).Visible = ChkOC_noOrden.Checked
|
GvDatos.Columns(20).Visible = ChkOC_noOrden.Checked
|
||||||
GvDatos.Columns(21).Visible = ChkOC_Kilogramos.Checked
|
GvDatos.Columns(21).Visible = ChkOC_Kilogramos.Checked
|
||||||
GvDatos.Columns(22).Visible = ChkOC_Cantidad.Checked
|
GvDatos.Columns(22).Visible = ChkOC_Cantidad.Checked
|
||||||
|
GvDatos.Columns(23).Visible = ChkUltimoCosto.Checked
|
||||||
|
|
||||||
|
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
|||||||
@@ -4330,20 +4330,20 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
Kilometraje
|
Kilometraje
|
||||||
<asp:TextBox ID="TxtKilometraje" runat="server" Width="65px" CssClass="form-control input-sm" MaxLength="6" CausesValidation="true" Text="000000"></asp:TextBox>
|
<asp:TextBox ID="TxtKilometraje" runat="server" Width="65px" CssClass="form-control input-sm" MaxLength="6" CausesValidation="true" Text="000000"></asp:TextBox>
|
||||||
<asp:RegularExpressionValidator ID="REVKilometraje" runat="server" ControlToValidate="TxtKilometraje" ValidationExpression="^\d{4,6}$" ErrorMessage="Debe tener entre 4 y 6 dígitos numéricos." Display="Dynamic" ForeColor="Red" />
|
<asp:RegularExpressionValidator ID="REVKilometraje" runat="server" ControlToValidate="TxtKilometraje" ValidationExpression="^\d{4,6}$" ErrorMessage="Debe tener entre 4 y 6 dígitos numéricos." Display="Dynamic" ForeColor="Red" />
|
||||||
<%--<ajax:MaskedEditExtender ID="MEEKilometraje" runat="server" TargetControlID="TxtKilometraje" ClearMaskOnLostFocus="false" MaskType="Number" Mask="999999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>--%>
|
<%--<ajax:MaskedEditExtender ID="MEEKilometraje" runat="server" TargetControlID="TxtKilometraje" ClearMaskOnLostFocus="false" MaskType="Number" Mask="999999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>--%>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
Próxima Rotación y Balanceo:<br />
|
Próxima Rotación y Balanceo:<br />
|
||||||
<asp:Label runat="server" ID="LblRotacion" Text=""></asp:Label>
|
<asp:Label runat="server" ID="LblRotacion" Text=""></asp:Label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
Próxima Alineación:<br />
|
Próxima Alineación:<br />
|
||||||
<asp:Label runat="server" ID="LblAlineacion" Text=""></asp:Label>
|
<asp:Label runat="server" ID="LblAlineacion" Text=""></asp:Label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr align="left" id="trCorreoNotif1" runat="server" visible="false">
|
<tr align="left" id="trCorreoNotif1" runat="server" visible="false">
|
||||||
@@ -8226,7 +8226,7 @@
|
|||||||
<label>Descripción:</label>
|
<label>Descripción:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<asp:TextBox ID="TxtMotivoCancelacion" runat="server" Height="100" Width="100%" TextMode="MultiLine" CausesValidation="true" MaxLength="500" Rows="3"></asp:TextBox>
|
<asp:TextBox ID="TxtMotivoCancelacion" runat="server" Width="100%" TextMode="MultiLine" CausesValidation="true" MaxLength="500" Rows="3"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVDescripcionCancelacion" runat="server" CssClass="help-block errorimput" Display="Dynamic" ControlToValidate="TxtMotivoCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalCancelarDocumento"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVDescripcionCancelacion" runat="server" CssClass="help-block errorimput" Display="Dynamic" ControlToValidate="TxtMotivoCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalCancelarDocumento"></asp:RequiredFieldValidator>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -8254,6 +8254,11 @@
|
|||||||
<asp:CheckBox ID="ChkDevAlm" AutoPostBack="true" runat="server" OnCheckedChanged="ChkDevAlm_CheckedChanged" /><asp:Label ID="LblDevAlm" Text="Devolución Almacen" runat="server"></asp:Label>
|
<asp:CheckBox ID="ChkDevAlm" AutoPostBack="true" runat="server" OnCheckedChanged="ChkDevAlm_CheckedChanged" /><asp:Label ID="LblDevAlm" Text="Devolución Almacen" runat="server"></asp:Label>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="DivCancelarEgs" runat="server" visible="false">
|
||||||
|
<h5>
|
||||||
|
<asp:CheckBox ID="ChkCancelarNC" runat="server" Checked="false"/><asp:Label ID="Label4" Text="Cancelar Nota de crédito" runat="server"></asp:Label>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<asp:UpdatePanel ID="UpFooterCancelarRemision" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpFooterCancelarRemision" runat="server" UpdateMode="Conditional">
|
||||||
|
|||||||
@@ -17509,14 +17509,14 @@ Partial Class Ventas
|
|||||||
ObjMovtos.Dispose()
|
ObjMovtos.Dispose()
|
||||||
|
|
||||||
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
|
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
|
||||||
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
|
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 AND Tipo <> 'RNC' {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
|
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
|
||||||
DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
|
DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
DtMovtos = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('RNC','IxC','Ant') {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")} ", "")}")
|
DtMovtos = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('IxC','Ant') {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")} ", "")}")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
GVAnticipos.DataSource = DtMovtos
|
GVAnticipos.DataSource = DtMovtos
|
||||||
@@ -17755,7 +17755,7 @@ Partial Class Ventas
|
|||||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
|
||||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
|
||||||
|
|
||||||
DtVentasNC.Rows.Add(Venta.CveVenta, Total, "")
|
DtVentasNC.Rows.Add(Venta.CveVenta, Total, LblFolioFiscal.Text.Trim())
|
||||||
|
|
||||||
ObjNC.DtVentasNC = DtVentasNC
|
ObjNC.DtVentasNC = DtVentasNC
|
||||||
|
|
||||||
@@ -17808,11 +17808,12 @@ Partial Class Ventas
|
|||||||
ObjNC.CveUsoCFDI = Venta.CveUsoCFDI
|
ObjNC.CveUsoCFDI = Venta.CveUsoCFDI
|
||||||
ObjNC.CveVendedor = CveVendedor
|
ObjNC.CveVendedor = CveVendedor
|
||||||
ObjNC.CveTipoRelacion = 7
|
ObjNC.CveTipoRelacion = 7
|
||||||
|
ObjNC.CveVentaPadre = Venta.CveVenta
|
||||||
|
|
||||||
ObjNC.PreparaTimbre()
|
ObjNC.PreparaTimbre()
|
||||||
AjustarTimbreNC(ObjNC)
|
AjustarTimbreNC(ObjNC)
|
||||||
|
|
||||||
Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
|
Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Vta/NC/GuardarVenta", MostrarURL:=True)
|
||||||
Retorno.Factura = ObjNC
|
Retorno.Factura = ObjNC
|
||||||
|
|
||||||
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
|
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
|
||||||
@@ -23254,7 +23255,7 @@ Partial Class Ventas
|
|||||||
If CveMovimientoInventario > 0 Then
|
If CveMovimientoInventario > 0 Then
|
||||||
|
|
||||||
'Agregamos los detalles
|
'Agregamos los detalles
|
||||||
For Each MovDet As DataRow In DtMovDetalle.FiltraParametros("CantidadDisponible > 0").Rows
|
For Each MovDet As DataRow In DtMovDetalle.Rows
|
||||||
|
|
||||||
Dim Cantidad As Decimal = 0
|
Dim Cantidad As Decimal = 0
|
||||||
Dim CantidadRemision As Decimal = DtRemisionesTmpDT.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString()}").ToDecimal
|
Dim CantidadRemision As Decimal = DtRemisionesTmpDT.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString()}").ToDecimal
|
||||||
@@ -27412,7 +27413,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Extra.Trim().Length > 0 Then
|
If Extra.Trim().Length > 0 Then
|
||||||
SbCondiciones.AppendFormat("<br><b>*{0}</b>", Extra)
|
SbCondiciones.AppendFormat("{0}", Extra)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
@@ -27439,6 +27440,29 @@ Partial Class Ventas
|
|||||||
Private Sub LbCancelarDocumento_Click(sender As Object, e As EventArgs) Handles LbCancelarDocumento.Click
|
Private Sub LbCancelarDocumento_Click(sender As Object, e As EventArgs) Handles LbCancelarDocumento.Click
|
||||||
Dim SaldoAlmacen As Decimal = 0
|
Dim SaldoAlmacen As Decimal = 0
|
||||||
|
|
||||||
|
If DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||||
|
Dim DtNCCancelar As DataTable = Nothing
|
||||||
|
Dim ObjVta As New ClsVentas
|
||||||
|
If ObjVta.GetVentasAntNC(CveVenta, -1) Then
|
||||||
|
DtNCCancelar = (
|
||||||
|
From row In ObjVta.DtResultados.AsEnumerable()
|
||||||
|
Where row("TipoDocto").ToString() = "Egs" AndAlso row("CveTipoRelacion").ToString() = "7"
|
||||||
|
Group row By categoria = row.Field(Of Integer)("CveVenta") Into grupo = Group
|
||||||
|
Select New With {
|
||||||
|
.CveVenta = categoria,
|
||||||
|
.Total = grupo.Sum(Function(r) r.Field(Of Decimal)("Importe"))
|
||||||
|
}
|
||||||
|
).QueryToDataTable(True)
|
||||||
|
|
||||||
|
End If
|
||||||
|
ObjVta.Dispose()
|
||||||
|
|
||||||
|
If DtNCCancelar IsNot Nothing AndAlso DtNCCancelar.FiltraParametros("Total > 0").Rows.Count > 0 Then
|
||||||
|
DivCancelarEgs.Visible = True
|
||||||
|
ChkCancelarNC.Checked = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev", "Ped") Then
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev", "Ped") Then
|
||||||
|
|
||||||
Dim PermiteCancelar As Boolean = True
|
Dim PermiteCancelar As Boolean = True
|
||||||
@@ -27947,8 +27971,81 @@ Partial Class Ventas
|
|||||||
CveEstatusFacturaAsignado = 4
|
CveEstatusFacturaAsignado = 4
|
||||||
End If
|
End If
|
||||||
|
|
||||||
resp = ObjFacturaCancelacion.CancelarFactura(If(ChkDevAlm.Checked, 1, 0), ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, ForzarDevolucion:=GenerarDevolucionAnticipada, CancelacionPagos:=CancelacionPagos, ValidarSAT:=ValidarSAT, CveEstatusFacturaAsignado:=CveEstatusFacturaAsignado)
|
|
||||||
|
Dim SbNC As New StringBuilder
|
||||||
|
Dim ErrorCancelacionNC As Boolean = False
|
||||||
|
Dim SbNCError As New StringBuilder
|
||||||
|
|
||||||
|
If ObjFacturaCancelacion.TipoDocto = "Ing" AndAlso ChkCancelarNC.Checked Then
|
||||||
|
|
||||||
|
'NO CANCELAR EL PAGO EN LA CANCELACION DE LA FACTURA, SI NO DESDE LA CANCELACION DESDE LA NC
|
||||||
|
CancelacionPagos = OpcionesCancelacionPagos.SinPagos
|
||||||
|
|
||||||
|
Dim DtNCCancelar As DataTable = Nothing
|
||||||
|
Dim ObjVta As New ClsVentas
|
||||||
|
If ObjVta.GetVentasAntNC(CveVenta, -1) Then
|
||||||
|
DtNCCancelar = (
|
||||||
|
From row In ObjVta.DtResultados.AsEnumerable()
|
||||||
|
Where row("TipoDocto").ToString() = "Egs" AndAlso row("CveTipoRelacion").ToString() = "7"
|
||||||
|
Group row By categoria = row.Field(Of Integer)("CveVenta") Into grupo = Group
|
||||||
|
Select New With {
|
||||||
|
.CveVenta = categoria,
|
||||||
|
.Total = grupo.Sum(Function(r) r.Field(Of Decimal)("Importe"))
|
||||||
|
}
|
||||||
|
).QueryToDataTable(True)
|
||||||
|
|
||||||
|
End If
|
||||||
|
ObjVta.Dispose()
|
||||||
|
|
||||||
|
If DtNCCancelar IsNot Nothing Then
|
||||||
|
|
||||||
|
For Each RowVta As DataRow In DtNCCancelar.FiltraParametros("Total > 0").Rows
|
||||||
|
Dim ObjNCCancelacion As New Modelos.Factura(UsuarioActual, RowVta("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=False)
|
||||||
|
ObjNCCancelacion.CveDevolucion = ObjFacturaCancelacion.CveVenta
|
||||||
|
|
||||||
|
If ObjNCCancelacion IsNot Nothing Then
|
||||||
|
Dim respNC = ObjNCCancelacion.CancelarFactura(RealizarDevolucionAlmacen:=0, ValidarSAT:=ValidarSAT)
|
||||||
|
If respNC IsNot Nothing Then
|
||||||
|
If respNC.HuboError Then
|
||||||
|
SbNCError.Append(respNC.Mensaje)
|
||||||
|
ErrorCancelacionNC = True
|
||||||
|
Exit For
|
||||||
|
Else
|
||||||
|
SbNC.AppendFormat(" - <b>{0}</b>", ObjNCCancelacion.SerieFolio)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If Not ErrorCancelacionNC Then
|
||||||
|
Using ObjV As New ClsVentas
|
||||||
|
If ObjV.GetVenta(ObjFacturaCancelacion.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim DbRowVenta As DataRow = ObjV.DtResultados.FiltroPrimero("")
|
||||||
|
If DbRowVenta IsNot Nothing Then
|
||||||
|
ObjFacturaCancelacion.Pagado = DbRowVenta("Pagado").ToString().ToDecimal()
|
||||||
|
ObjFacturaCancelacion.Saldo = DbRowVenta("Saldo").ToString().ToDecimal()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorCancelacionNC Then
|
||||||
|
resp = ObjFacturaCancelacion.CancelarFactura(If(ChkDevAlm.Checked, 1, 0), ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion, ForzarDevolucion:=GenerarDevolucionAnticipada, CancelacionPagos:=CancelacionPagos, ValidarSAT:=ValidarSAT, CveEstatusFacturaAsignado:=CveEstatusFacturaAsignado)
|
||||||
|
Else
|
||||||
|
resp = New Modelos.Factura.MCancelacionVentaMensaje()
|
||||||
|
resp.HuboError = True
|
||||||
|
resp.Mensaje = "No se pudo cancelar la factura"
|
||||||
|
End If
|
||||||
|
|
||||||
strMensaje.Append(resp.Mensaje)
|
strMensaje.Append(resp.Mensaje)
|
||||||
|
|
||||||
|
If ChkCancelarNC.Checked Then
|
||||||
|
strMensaje.AppendFormat("<br/>{0}", If(ErrorCancelacionNC, $"Ocurrió un error al cancelar las NC relacionadas. <br/> {SbNCError.ToString()}", $"Se cancelaron las siguientes notas de crédito. <br/> {SbNC.ToString()}"))
|
||||||
|
End If
|
||||||
|
|
||||||
Dim DtBonificaciones As DataTable = Nothing
|
Dim DtBonificaciones As DataTable = Nothing
|
||||||
|
|
||||||
'SI ES RNC DE CARGO DEBE CANCELAR LAS BON
|
'SI ES RNC DE CARGO DEBE CANCELAR LAS BON
|
||||||
|
|||||||
Reference in New Issue
Block a user