CRM Correcciones Ventas
This commit is contained in:
@@ -398,9 +398,7 @@
|
|||||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|
||||||
<div style="display: table; width: 100%">
|
<div style="display: table; width: 100%">
|
||||||
|
<asp:UpdatePanel ID="UpCliente" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;">
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpCliente" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;">
|
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
@@ -564,7 +562,30 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
<%-- <asp:UpdatePanel ID="UpEmpresaCRM" runat="server" Visible="false" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption font-green" >
|
||||||
|
<i class="icon-pin font-green"></i>
|
||||||
|
<span class="caption-subject bold uppercase">EMPRESA CRM </span>
|
||||||
|
</div>
|
||||||
|
<div class="tools">
|
||||||
|
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
|
||||||
|
<div class="form-body">
|
||||||
|
|
||||||
|
<table border="0" width="463px">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>--%>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;">
|
<asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -2415,7 +2436,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -2460,10 +2481,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<%-- <label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
|
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
|
||||||
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
||||||
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
|
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
|
||||||
</div>--%>
|
</div>
|
||||||
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
|
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
|
||||||
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
||||||
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
|
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
|
||||||
@@ -2558,12 +2579,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -7774,7 +7795,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<%-- <a href="javascript:;" class="collapse"></a>--%>
|
<%-- <a href="javascript:;" class="collapse"></a>--%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Imports System.IO
|
|||||||
Imports System.Net.Http
|
Imports System.Net.Http
|
||||||
Imports System.Security.Cryptography.X509Certificates
|
Imports System.Security.Cryptography.X509Certificates
|
||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
|
Imports ADSTimbrado
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
@@ -2511,7 +2512,13 @@ Partial Class Ventas
|
|||||||
TrObsAlmacen.Visible = False
|
TrObsAlmacen.Visible = False
|
||||||
TrTxtObsAlmacen.Visible = False
|
TrTxtObsAlmacen.Visible = False
|
||||||
TrPedido.Visible = False
|
TrPedido.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TrOC.Visible = False
|
TrOC.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DdlTipoComprobante.SelectedValue = "Op"
|
DdlTipoComprobante.SelectedValue = "Op"
|
||||||
Else
|
Else
|
||||||
Opcion = "Ing"
|
Opcion = "Ing"
|
||||||
@@ -6148,6 +6155,8 @@ Partial Class Ventas
|
|||||||
If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub CargaEmpresaCRM(CveEmpresaCRM As Integer)
|
Private Sub CargaEmpresaCRM(CveEmpresaCRM As Integer)
|
||||||
Dim ObjCRM As New ClsCRM
|
Dim ObjCRM As New ClsCRM
|
||||||
If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) Then
|
If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) Then
|
||||||
@@ -6212,13 +6221,14 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
ThTiempoEntrega.Visible = True
|
ThTiempoEntrega.Visible = True
|
||||||
ThTiempoEntrega2.Visible = True
|
ThTiempoEntrega2.Visible = True
|
||||||
GvPS.Columns(5).Visible = True
|
GvPS.Columns(5).Visible = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
ObjCRM.Dispose()
|
ObjCRM.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = -1)
|
Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = -1)
|
||||||
|
|
||||||
If CveCliente <= 0 Then Exit Sub
|
If CveCliente <= 0 Then Exit Sub
|
||||||
@@ -6448,9 +6458,9 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjCliente.AplicaComercioExterior Then
|
If ObjCliente.AplicaComercioExterior Then
|
||||||
'DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado
|
DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado
|
||||||
'DdlSATMotivoTraslado.DataBind()
|
DdlSATMotivoTraslado.DataBind()
|
||||||
'DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado)
|
DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado)
|
||||||
DdlIncoterm.Items.Clear()
|
DdlIncoterm.Items.Clear()
|
||||||
DdlIncoterm.DataSource = GlobalDTIncoterm()
|
DdlIncoterm.DataSource = GlobalDTIncoterm()
|
||||||
DdlIncoterm.DataBind()
|
DdlIncoterm.DataBind()
|
||||||
@@ -7323,9 +7333,7 @@ Partial Class Ventas
|
|||||||
LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString()
|
LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString()
|
||||||
'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString()
|
'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString()
|
||||||
LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString()
|
LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString()
|
||||||
If Not UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString()
|
||||||
LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString()
|
|
||||||
End If
|
|
||||||
ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString()
|
ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString()
|
||||||
ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString()
|
ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString()
|
||||||
ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString()
|
ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString()
|
||||||
@@ -8584,6 +8592,7 @@ Partial Class Ventas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " EMITIR IMPRIMIR - GUARDAR "
|
#Region " EMITIR IMPRIMIR - GUARDAR "
|
||||||
|
|
||||||
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
||||||
Try
|
Try
|
||||||
EmitirImprimir()
|
EmitirImprimir()
|
||||||
@@ -9067,15 +9076,15 @@ Partial Class Ventas
|
|||||||
EsValido = True
|
EsValido = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
'If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||||
CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
|
' CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
|
||||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
' 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||||
If PU <= CostoMayor Then
|
' If PU <= CostoMayor Then
|
||||||
EsValidoMayor = True
|
' EsValidoMayor = True
|
||||||
End If
|
' End If
|
||||||
Else
|
'Else
|
||||||
EsValidoMayor = True
|
' EsValidoMayor = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR
|
'VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR
|
||||||
If Not EsValido Or PU = 0 Then
|
If Not EsValido Or PU = 0 Then
|
||||||
@@ -9091,24 +9100,24 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION
|
'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION
|
||||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||||
If Not EsValido Then
|
'If Not EsValido Then
|
||||||
|
|
||||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
' MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||||
If TienePermisoImportes Then
|
' If TienePermisoImportes Then
|
||||||
MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
' MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
' MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
||||||
MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
' MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If Not EsValidoMayor Then
|
'If Not EsValidoMayor Then
|
||||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
' MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||||
If TienePermisoImportes Then
|
' If TienePermisoImportes Then
|
||||||
MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
' MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||||
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
' MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
||||||
MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
' MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
' SOLO SI TIENE LA FUNCIONALIDAD DE RESTRICCION VALIDA EL IMPORTE CERO
|
' SOLO SI TIENE LA FUNCIONALIDAD DE RESTRICCION VALIDA EL IMPORTE CERO
|
||||||
If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 Then
|
If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 Then
|
||||||
@@ -9792,7 +9801,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||||
|
|
||||||
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -9804,12 +9813,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If Request("CveOrdenProduccion") IsNot Nothing AndAlso IsNumeric(Request("CveOrdenProduccion")) AndAlso Request("CveOrdenProduccion").ToEntero() > 0 Then
|
If Request("CveOrdenProduccion") IsNot Nothing AndAlso IsNumeric(Request("CveOrdenProduccion")) AndAlso Request("CveOrdenProduccion").ToEntero() > 0 Then
|
||||||
|
|
||||||
If ObjVentas.AgroOrdenProduccionUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa, Request("CveOrdenProduccion").ToEntero()) Then
|
If ObjVentas.AgroOrdenProduccionUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveOrdenProduccion").ToEntero()) Then
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al actualizar el embarque", ex)
|
OnError("Ocurrió un error al actualizar la orden de producción", ex)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -12223,116 +12232,115 @@ Partial Class Ventas
|
|||||||
i += 1
|
i += 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Dim AplicaComercioExteriorSubProyecto As Boolean = True
|
Dim AplicaComercioExteriorSubProyecto As Boolean
|
||||||
|
|
||||||
If ChkEmitirComercioExterior.Checked Then
|
If ChkEmitirComercioExterior.Checked Then
|
||||||
'AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
|
AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
|
||||||
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
|
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
|
||||||
|
|
||||||
'DATOS GENERALES
|
If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
|
||||||
|
'DATOS GENERALES
|
||||||
|
|
||||||
Timbre.Comprobante.Exportacion = "02"
|
Timbre.Comprobante.Exportacion = "02"
|
||||||
Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
|
Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
|
||||||
Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
|
Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
|
||||||
Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0"
|
Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0"
|
||||||
Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
|
Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
|
||||||
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
|
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
|
||||||
|
|
||||||
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
|
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
|
||||||
|
If Timbre.Comprobante.TipoComprobante = "T" Then
|
||||||
Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
|
Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
|
||||||
|
|
||||||
'If Timbre.Comprobante.TipoComprobante = "T" Then
|
|
||||||
' Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
|
|
||||||
'Else
|
|
||||||
' Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
|
|
||||||
'End If
|
|
||||||
|
|
||||||
'EMISOR
|
|
||||||
Dim Dr As DataRow
|
|
||||||
Dr = Nothing
|
|
||||||
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
|
|
||||||
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
|
|
||||||
End If
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
|
|
||||||
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
|
|
||||||
|
|
||||||
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String
|
|
||||||
ComExtColonia = "" : ComExtMunicipio = ""
|
|
||||||
ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}")
|
|
||||||
ComExtCalle = TxtComExtCalle.Text.Trim
|
|
||||||
ComExtNumero = TxtComExtNumero.Text.Trim
|
|
||||||
ComExtCP = TxtComExtCP.Text.Trim
|
|
||||||
|
|
||||||
If ComExtPais = "MEX" Then
|
|
||||||
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
|
|
||||||
ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}")
|
|
||||||
ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "")
|
|
||||||
Else
|
|
||||||
If ComExtPais.Contiene("USA", "CAN") Then
|
|
||||||
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
|
|
||||||
Else
|
Else
|
||||||
ComExtEstado = TxtComExtEstado.Text.Trim
|
Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
|
||||||
End If
|
End If
|
||||||
ComExtMunicipio = TxtComExtMunicipio.Text.Trim
|
|
||||||
ComExtColonia = TxtComExtColonia.Text.Trim
|
|
||||||
End If
|
|
||||||
|
|
||||||
'RECEPTOR
|
'EMISOR
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
|
Dim Dr As DataRow
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle
|
Dr = Nothing
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero
|
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = ""
|
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia
|
End If
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Localidad = ""
|
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
|
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio
|
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP
|
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado
|
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
|
||||||
Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais
|
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
|
||||||
Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
|
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
|
||||||
Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
|
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
|
||||||
|
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
|
||||||
|
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
|
||||||
|
|
||||||
|
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String
|
||||||
|
ComExtColonia = "" : ComExtMunicipio = ""
|
||||||
|
ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}")
|
||||||
|
ComExtCalle = TxtComExtCalle.Text.Trim
|
||||||
|
ComExtNumero = TxtComExtNumero.Text.Trim
|
||||||
|
ComExtCP = TxtComExtCP.Text.Trim
|
||||||
|
|
||||||
|
If ComExtPais = "MEX" Then
|
||||||
|
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
|
||||||
|
ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}")
|
||||||
|
ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "")
|
||||||
|
Else
|
||||||
|
If ComExtPais.Contiene("USA", "CAN") Then
|
||||||
|
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
|
||||||
|
Else
|
||||||
|
ComExtEstado = TxtComExtEstado.Text.Trim
|
||||||
|
End If
|
||||||
|
ComExtMunicipio = TxtComExtMunicipio.Text.Trim
|
||||||
|
ComExtColonia = TxtComExtColonia.Text.Trim
|
||||||
|
End If
|
||||||
|
|
||||||
|
'RECEPTOR
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = ""
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Localidad = ""
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado
|
||||||
|
Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais
|
||||||
|
Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
|
||||||
|
Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
|
||||||
|
|
||||||
|
|
||||||
'DESTINATARIO
|
'DESTINATARIO
|
||||||
Timbre.Complementos.ComercioExterior11.Destinatario = Nothing
|
Timbre.Complementos.ComercioExterior11.Destinatario = Nothing
|
||||||
|
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero
|
'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = ""
|
'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = ""
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = ""
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = ""
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP
|
'Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais
|
'Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais
|
||||||
'Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim
|
'Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim
|
||||||
|
|
||||||
'MERCANCIAS
|
'MERCANCIAS
|
||||||
For Each Gvr As GridViewRow In GvComercioExterior.Rows
|
For Each Gvr As GridViewRow In GvComercioExterior.Rows
|
||||||
Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal,
|
Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal,
|
||||||
.FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(),
|
.FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(),
|
||||||
.UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(),
|
.UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(),
|
||||||
.ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2),
|
.ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2),
|
||||||
.ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal,
|
.ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal,
|
||||||
.NoIdentificacion = Gvr.DataKey("Codigo")}
|
.NoIdentificacion = Gvr.DataKey("Codigo")}
|
||||||
If Gvr.FCTextBox("TxtMarca").Text <> "" Then
|
If Gvr.FCTextBox("TxtMarca").Text <> "" Then
|
||||||
mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text
|
mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
|
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
|
||||||
i += 1
|
i += 1
|
||||||
Next
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -15091,7 +15099,7 @@ Partial Class Ventas
|
|||||||
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
||||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim IdCtaContable As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim TotalCostoAcumulado As Decimal = 0
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
Dim cont As Integer = 1
|
Dim cont As Integer = 1
|
||||||
@@ -15104,23 +15112,19 @@ Partial Class Ventas
|
|||||||
If cont = tmpCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
|
If cont = tmpCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
|
||||||
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
|
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
|
|
||||||
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
|
||||||
'If ValorInventario <> 0 Then
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
'End If
|
|
||||||
cont += 1
|
cont += 1
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
||||||
|
|
||||||
'If TotalCosto <> 0 Then
|
'If TotalCosto <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveSubProyecto:=factura.CveSubProyecto) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
ErrorList.Add("Ocurrió un error al guardar movimiento de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
ErrorList.Add("Ocurrió un error al guardar movimiento de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||||
End If
|
End If
|
||||||
@@ -15982,47 +15986,8 @@ Partial Class Ventas
|
|||||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
||||||
|
|
||||||
|
|
||||||
Dim FechaUltimaFluctuacion As Date = MinFecha
|
|
||||||
Dim TipoCambioFluctuacion As Decimal = 1
|
|
||||||
Dim tFecha As Date = Now
|
|
||||||
|
|
||||||
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
|
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
|
|
||||||
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
|
|
||||||
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
|
|
||||||
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
|
|
||||||
tipoCambioPago = 1
|
|
||||||
tipoCambioVenta = 1
|
|
||||||
tipoCambioVentaValuacion = 1
|
|
||||||
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
|
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN PESOS
|
|
||||||
tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
|
||||||
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
|
|
||||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
|
||||||
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
|
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN DOLARES
|
|
||||||
tipoCambioPago = gvr.DataKey("TipoCambio").ToString().ToDecimal
|
|
||||||
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
|
|
||||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
|
||||||
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
|
|
||||||
ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES
|
|
||||||
tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
|
||||||
tipoCambioVenta = 1
|
|
||||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
|
||||||
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim importeMovimiento As Decimal = 0
|
Dim importeMovimiento As Decimal = 0
|
||||||
Dim importeMN As Decimal = 0
|
Dim importeMN As Decimal = 0
|
||||||
Dim TC As Decimal
|
|
||||||
Dim IdCtaContable As Integer
|
Dim IdCtaContable As Integer
|
||||||
Dim TipoMovimiento As Boolean = True
|
Dim TipoMovimiento As Boolean = True
|
||||||
Dim Concepto As String = VentaActual.SerieFolio
|
Dim Concepto As String = VentaActual.SerieFolio
|
||||||
@@ -16053,23 +16018,14 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||||
importeMN = importeMovimiento
|
|
||||||
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
|
|
||||||
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||||
importeMN = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
|
|
||||||
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
|
|
||||||
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
||||||
importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
|
||||||
TC = TipoCambioFluctuacion
|
|
||||||
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
||||||
importeMN = importeMovimiento
|
|
||||||
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
|
|
||||||
End If
|
End If
|
||||||
importeMovimiento = importeMovimiento.RoundSQL
|
importeMovimiento = importeMovimiento.RoundSQL
|
||||||
importeMN = importeMN.RoundSQL
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(12, CveCliente) Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(12, CveCliente) Then
|
||||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
@@ -16101,81 +16057,22 @@ Partial Class Ventas
|
|||||||
If gvr.DataKey("CveIE").ToEntero() > 0 Then
|
If gvr.DataKey("CveIE").ToEntero() > 0 Then
|
||||||
|
|
||||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||||
IdCtaContable = IdCtaContClientes
|
|
||||||
|
|
||||||
If importeMovimiento <> 0 Then
|
If importeMovimiento <> 0 Then
|
||||||
|
|
||||||
Dim Pago As New VentaPago
|
Dim Pago As New VentaPago
|
||||||
|
Pago.ImportePagoVenta = importeMovimiento
|
||||||
Pago.ImportePago = importeMovimiento
|
Pago.ImportePago = importeMovimiento
|
||||||
Pago.CveIE = CveIEAnticipo
|
Pago.CveIE = CveIEAnticipo
|
||||||
Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
|
Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
|
||||||
Pago.TipoPago = "A"
|
Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
|
||||||
|
Pago.TipoPago = "I"
|
||||||
|
Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
|
||||||
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
|
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
|
||||||
Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
|
|
||||||
Pago.Referencia = gvr.DataKey("Folio")
|
Pago.Referencia = gvr.DataKey("Folio")
|
||||||
|
|
||||||
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
|
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
|
||||||
|
|
||||||
' Agregamos el 2
|
|
||||||
If tipoCambioPago = 1 Then
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then
|
|
||||||
ErrorConta = True
|
|
||||||
End If
|
|
||||||
Else 'Cuando son dolares
|
|
||||||
If importeMovimiento <> 0 Then
|
|
||||||
If IdCtaContComplementaria > 0 Or 0 > 0 Then
|
|
||||||
'Agregamos la Complementaria
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
|
|
||||||
ErrorConta = True
|
|
||||||
End If
|
|
||||||
'Agregamos la Extranjera
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
|
|
||||||
ErrorConta = True
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
'Agregamos la Extranjera
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
|
|
||||||
ErrorConta = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal)
|
|
||||||
importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
|
|
||||||
|
|
||||||
|
|
||||||
'Agregamos el 92
|
|
||||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
|
|
||||||
importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
|
|
||||||
IdCtaContable = IdCtaContAnticipos
|
|
||||||
|
|
||||||
If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
|
||||||
If Not tipoCambioPago = 1 Then
|
|
||||||
IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
|
|
||||||
Else
|
|
||||||
IdCtaContable = ObjCliente.IdCtaContAnticipos
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(119) Then
|
|
||||||
If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then
|
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
|
||||||
If Not tipoCambioPago = 1 Then
|
|
||||||
IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera
|
|
||||||
Else
|
|
||||||
IdCtaContable = ObjCliente.IdCtaContClientes
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then
|
|
||||||
ErrorConta = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Select
|
End Select
|
||||||
@@ -17888,7 +17785,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
|
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
|
||||||
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
If Not UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
||||||
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
|
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
|
||||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
||||||
If DrPS IsNot Nothing Then
|
If DrPS IsNot Nothing Then
|
||||||
@@ -20141,6 +20038,7 @@ Partial Class Ventas
|
|||||||
If Not OcurrioError AndAlso RemisionesLista.Count > 0 AndAlso DtRemConceptosSurtidos IsNot Nothing Then
|
If Not OcurrioError AndAlso RemisionesLista.Count > 0 AndAlso DtRemConceptosSurtidos IsNot Nothing Then
|
||||||
If DtRemConceptosSurtidos.SUMD("Surtido") <> DtRemConceptosSurtidos.SUMD("Cantidad") Then
|
If DtRemConceptosSurtidos.SUMD("Surtido") <> DtRemConceptosSurtidos.SUMD("Cantidad") Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
|
Alert("Lo facturado no coincide con lo surtido en inventario", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -20443,7 +20341,6 @@ Partial Class Ventas
|
|||||||
Dim DtCostos As DataTable = Nothing
|
Dim DtCostos As DataTable = Nothing
|
||||||
Dim DtCostosDistinct As DataTable = Nothing
|
Dim DtCostosDistinct As DataTable = Nothing
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim IdCtaContable As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
|
||||||
Dim ValorInventario As Decimal = 0D
|
Dim ValorInventario As Decimal = 0D
|
||||||
Dim TotalCostoAcumulado As Decimal = 0D
|
Dim TotalCostoAcumulado As Decimal = 0D
|
||||||
Dim Cont As Integer = 1
|
Dim Cont As Integer = 1
|
||||||
@@ -20475,7 +20372,6 @@ Partial Class Ventas
|
|||||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||||
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
|
||||||
TotalCostoAcumulado += ValorInventario
|
TotalCostoAcumulado += ValorInventario
|
||||||
|
|
||||||
'cuando es el último movimiento y hay diferencias en los importes
|
'cuando es el último movimiento y hay diferencias en los importes
|
||||||
@@ -20485,7 +20381,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Try
|
Try
|
||||||
'If ValorInventario <> 0 Then
|
'If ValorInventario <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -20499,7 +20395,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -20705,7 +20601,6 @@ Partial Class Ventas
|
|||||||
Dim DtCostos = ObjInventario.DtResultados.Copy
|
Dim DtCostos = ObjInventario.DtResultados.Copy
|
||||||
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
|
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim IdCtaContable As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
|
||||||
Dim ValorInventario As Decimal
|
Dim ValorInventario As Decimal
|
||||||
Dim TotalCostoAcumulado As Decimal = 0D
|
Dim TotalCostoAcumulado As Decimal = 0D
|
||||||
Dim Cont As Integer = 1
|
Dim Cont As Integer = 1
|
||||||
@@ -20714,7 +20609,6 @@ Partial Class Ventas
|
|||||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||||
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
|
||||||
TotalCostoAcumulado += ValorInventario
|
TotalCostoAcumulado += ValorInventario
|
||||||
|
|
||||||
'cuando es el último movimiento y hay diferencias en los importes
|
'cuando es el último movimiento y hay diferencias en los importes
|
||||||
@@ -20724,7 +20618,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Try
|
Try
|
||||||
'If ValorInventario <> 0 Then
|
'If ValorInventario <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoVirtual, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoVirtual, ImporteMX:=ValorInventario, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -20738,7 +20632,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacenVirtual)).ToEntero()
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacenVirtual)).ToEntero()
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoVirtual, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoVirtual, ImporteMX:=TotalCosto, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -25271,11 +25165,13 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
DdlMarca.Items.Clear()
|
DdlMarca.Items.Clear()
|
||||||
DdlMarcaPSDes.Items.Clear()
|
DdlMarcaPSDes.Items.Clear()
|
||||||
Dim ObjMarcas As New ClsProductosServicios
|
'Dim ObjMarcas As New ClsProductosServicios
|
||||||
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
'ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
||||||
DdlMarca.DataSource = ObjMarcas.DtResultados
|
'DdlMarca.DataSource = ObjMarcas.DtResultados
|
||||||
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
'DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
||||||
ObjMarcas.Dispose()
|
'ObjMarcas.Dispose()
|
||||||
|
DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||||
|
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||||
DdlMarca.DataBind()
|
DdlMarca.DataBind()
|
||||||
DdlMarcaPSDes.DataBind()
|
DdlMarcaPSDes.DataBind()
|
||||||
End If
|
End If
|
||||||
@@ -29620,8 +29516,7 @@ Partial Class Ventas
|
|||||||
Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal)
|
Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal)
|
||||||
Dim Total As Decimal = (Cantidad * PU)
|
Dim Total As Decimal = (Cantidad * PU)
|
||||||
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
|
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
|
||||||
Dim TotalCalculableImpuestosIVA = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal)
|
Dim ImporteIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
|
||||||
Dim ImporteIVA As Decimal = TotalCalculableImpuestosIVA * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
|
|
||||||
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
|
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
|
||||||
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
|
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
|
||||||
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal
|
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal
|
||||||
@@ -33456,7 +33351,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ObjFactura.SetSubProyecto()
|
ObjFactura.SetSubProyecto()
|
||||||
EnviarPolizaVentaWS(obj, CvePolizaVirtual, ObjFactura.SubProyecto.Acum_PortalUsuario, ObjFactura.SubProyecto.Acum_PortalContrasena)
|
'EnviarPolizaVentaWS(obj, CvePolizaVirtual, ObjFactura.SubProyecto.Acum_PortalUsuario, ObjFactura.SubProyecto.Acum_PortalContrasena)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -35675,9 +35570,6 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
||||||
|
|
||||||
ViewState("AplicaComercioExterior") = ChkEmitirComercioExterior.Checked
|
|
||||||
|
|
||||||
If ChkEmitirComercioExterior.Checked Then
|
If ChkEmitirComercioExterior.Checked Then
|
||||||
DdlMoneda.SelectedValueExist("2")
|
DdlMoneda.SelectedValueExist("2")
|
||||||
CambiaMoneda()
|
CambiaMoneda()
|
||||||
|
|||||||
Reference in New Issue
Block a user