E13. Cambios en generacion de carta porte

This commit is contained in:
2022-06-09 19:11:57 -07:00
parent 0d8410fde2
commit a9cdc64af1
4 changed files with 773 additions and 666 deletions

View File

@@ -231,7 +231,7 @@
<br />
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivPSAdicionalVigencia" visible="false">
<ADS:Dropdownlost runat="server" ID="DdlPSAdicionalVigencia" CssStyle="width: 46%;" CssClass="form-control input-sm select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<label for="<%= DdlPSAdicionalVigencia.ClientID.ToString()%>">Producto de vigencia:</label>
<label for="<%= DdlPSAdicionalVigencia.ClientID.ToString()%>"><asp:Literal runat="server" Text="Producto de vigencia:" ID="LtlPSAdicionalVigencia"></asp:Literal> </label>
<i></i>
</div>
<br />

View File

@@ -330,6 +330,12 @@ Partial Class ProductosyServicios
CargaPSAdicionalesVigencias()
End If
If UsuarioActual.CveEmpresa = 13 Then
DivPSAdicionalVigencia.Visible = True
LtlPSAdicionalVigencia.Text = "Producto Relacionado:"
CargaPSAdicionalesVigencias()
End If
'Nuevo R: 26/09/2017
CargaProveedores()

File diff suppressed because it is too large Load Diff

View File

@@ -2351,7 +2351,7 @@ Partial Class Ventas
UpFacturar.Update()
'CargaTiposDocumentos()
TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 13 Then
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83) Then
DivCartaPorte.Visible = True
End If
ViewState("EstablecioFolio") = False
@@ -5818,10 +5818,11 @@ Partial Class Ventas
End Sub
Private Sub CargaFormaPago(CveMetodoPago As Integer)
'FACTURACION 3.3
'permiso para desbloquear la relación entre Método de pago y forma de pago
If UsuarioActual.TienePermisoProceso(282) Then CveMetodoPago = -1
'EN LA VERSION 4.0 NO PERMITE DESBLOEQUEAR RELACION METODO Y FOMA DE PAGO
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
'permiso para desbloquear la relación entre Método de pago y forma de pago
If UsuarioActual.TienePermisoProceso(282) Then CveMetodoPago = -1
End If
Dim dtt As DataTable = Nothing
If CveMetodoPago > 0 Then
@@ -7290,7 +7291,7 @@ Partial Class Ventas
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
Objeto.ddl.Items.Clear()
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=1)
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=If(AplicaParaVenta, 1, -1))
Objeto.ddl.DataBind()
Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
@@ -7307,9 +7308,9 @@ Partial Class Ventas
Objeto.Attributes.Add("data-cvesubproyecto", cvesubproyecto)
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
If AplicaParaVenta Then
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
End If
End If
@@ -14855,47 +14856,54 @@ Partial Class Ventas
End If
Select Case ConversionRemision
Case "*"
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Next
Case "*"
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
Next
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TipoCambioRemision, NumeroDecimales)).FormatoNumero
End If
Next
Case "/"
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Next
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TipoCambioRemision, NumeroDecimales)).FormatoNumero
End If
Next
Case "/"
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("Total") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDouble * Row("PU").ToString().ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / TipoCambioRemision, NumeroDecimales)
Next
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TipoCambioRemision, NumeroDecimales)).FormatoNumero
End If
Next
Case Else
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TipoCambioRemision, NumeroDecimales)).FormatoNumero
End If
Next
Case Else
End Select
End Select
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False), "Factura", "PDF")
Dim CartaPorte As Modelos.MSubReportData = Nothing
Select Case ConversionRemision
If UsuarioActual.CveEmpresa = 13 Then
CartaPorte = New Modelos.MSubReportData()
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
End If
ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False, SubReportData:=CartaPorte), "Factura", "PDF")
Select Case ConversionRemision
Case "*"
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString().ToDouble * TipoCambioRemision, NumeroDecimales)
@@ -34203,8 +34211,8 @@ Partial Class Ventas
Public Sub CargarCamiones()
TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")
TxtFechaLlegadaCP.Text = Now.ToString("dd/MM/yyyy")
TxtFechaEntregaCP.Text = Now.Date.ToString("dd/MM/yyyy HH:mm")
TxtFechaLlegadaCP.Text = Now.Date.ToString("dd/MM/yyyy HH:mm") 'Now.Date.AddDays(1).AddMinutes(-1).ToString("dd/MM/yyyy HH:mm")
DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear()
@@ -34273,6 +34281,10 @@ Partial Class Ventas
TxtFechaEntregaCP.Enabled = False
TxtFechaLlegadaCP.Enabled = False
Dim CveEntregaAlmacen As Integer = -1
Dim CveDireccionOrigen As Integer = -1
Dim CveDireccionDestino As Integer = -1
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
@@ -34281,19 +34293,58 @@ Partial Class Ventas
If CveTimbreCartaPorteVenta > 0 Then
ChkEmitirCartaPorte.Checked = True
ChkEmitirCartaPorte.Enabled = False
CveEntregaAlmacen = RowCP("CveEntregaAlmacen").ToString().ToEntero()
CveDireccionOrigen = RowCP("CveDireccionOrigen").ToString().ToEntero()
CveDireccionDestino = RowCP("CveDireccionDestino").ToString().ToEntero()
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
TxtDistancia.Text = RowCP("Distancia").ToString()
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
End If
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
TxtDistancia.Text = RowCP("Distancia").ToString()
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
End If
If ChkEmitirCartaPorte.Checked AndAlso CveEntregaAlmacen > 0 AndAlso ObjGral.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then
DtMercancias = ObjGral.DtResultados
End If
End Using
If ChkEmitirCartaPorte.Checked AndAlso CveCliente > 0 Then
Dim ObjClientes As New ClsClientes
If ObjClientes.DireccionEnvioGet(-1, CveCliente, -1) Then
TmpDTDireccionCP = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
End If
ObjClientes.Dispose()
DdlDireccionOrigen.DataSource = TmpDTDireccionCP
DdlDireccionOrigen.DataBind()
DdlDireccionDestino.DataSource = TmpDTDireccionCP
DdlDireccionDestino.DataBind()
DdlDireccionOrigen.SelectedValueExist(CveDireccionOrigen.ToString())
DdlDireccionDestino.SelectedValueExist(CveDireccionDestino.ToString())
GvMercanciasCP.DataSource = DtMercancias
GvMercanciasCP.DataBind()
Else
TmpDTDireccionCP = Nothing
End If
DdlChofer.Enabled = False
DdlUnidadCamion.Enabled = False
DdlDireccionOrigen.Enabled = False
DdlDireccionDestino.Enabled = False
UpEmitirTransitorio.Update()
End Sub
Private Sub ValidaConfiguracionVehiculo()
@@ -34371,16 +34422,16 @@ Partial Class Ventas
Dim CveTimbre As Integer = -1
Try
Dim CveDireccionOrigen As Integer = -1
Dim CveDireccionDestino As Integer = -1
Dim CveDireccionOrigen As Integer = DdlDireccionOrigen.SelectedValue.ToEntero
Dim CveDireccionDestino As Integer = DdlDireccionDestino.SelectedValue.ToEntero
If SucursalOrigenCP IsNot Nothing Then
CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
'If SucursalOrigenCP IsNot Nothing Then
' CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
'End If
If SucursalDestinoCP IsNot Nothing Then
CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
'If SucursalDestinoCP IsNot Nothing Then
' CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
'End If
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
ErrorProceso = True
@@ -34398,7 +34449,7 @@ Partial Class Ventas
If CveEntregaAlmacen > 0 Then
For Each RowPS As DataRow In ObjFactura.DtMercancias.Rows
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToDecimal, RowPS("CveUM").ToString().ToEntero, UsuarioActual.CveUsuario) Then
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToDecimal, RowPS("CveUnidadMedida").ToString().ToEntero, UsuarioActual.CveUsuario) Then
ErrorProceso = True
Exit For
End If
@@ -34650,20 +34701,24 @@ Partial Class Ventas
UpAgregarMercancia.Update()
RegistraScript("$('#DivAddMercancia').modal('show');", "M1")
End Sub
Private Sub CreaDTMercancias()
DtMercancias = New DataTable()
DtMercancias.Columns.Add(New DataColumn("Consec", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("CveUnidadMedida", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("CodigoPS", GetType(String)))
End Sub
Protected Sub LnkAddPSMercancia_Click(sender As Object, e As EventArgs)
If DtMercancias Is Nothing Then
DtMercancias = New DataTable()
DtMercancias.Columns.Add(New DataColumn("Consec", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
DtMercancias.Columns.Add(New DataColumn("CodigoPS", GetType(String)))
CreaDTMercancias()
End If
Dim CvePS As Integer = DdlPSMercancia.SelectedValue.ToEntero()
Dim DrPS As DataRow = GlobalDTPSSimplificado(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Alert("No se encontró el producto/servicio", TipoMensaje.MsgAdvertencia)
Alert("No se encontró la mercancía", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -34671,7 +34726,7 @@ Partial Class Ventas
NewRow("Consec") = DtMercancias.MAX("Consec").ToEntero() + 1
NewRow("Cantidad") = TxtCantidadMercancia.Text.ToDecimal()
NewRow("CvePS") = DrPS("CvePS")
NewRow("CveUM") = DrPS("CveUnidadMedida")
NewRow("CveUnidadMedida") = DrPS("CveUnidadMedida")
NewRow("CodigoPS") = DrPS("PSCodigo")
DtMercancias.Rows.Add(NewRow)
@@ -34679,46 +34734,50 @@ Partial Class Ventas
GvMercanciasCP.DataSource = DtMercancias
GvMercanciasCP.DataBind()
If ChkAgregarFlete.Checked Then
Dim CvePSServicio As Integer = DdlPSFlete.SelectedValue.ToEntero()
If CvePSServicio > 0 Then
Dim Cantidad As Decimal = TxtCantidadMercancia.Text.ToDecimal
Dim PU As Decimal = TxtPrecioMercancia.Text.Trim.ToDecimal
Dim Descuento As Decimal = 0
Dim CveUM As Integer = -1
Dim UnidadMedida As String = ""
Dim CveClasificacion As Integer = -1
Dim Clasificacion As String = ""
If ChkLimpiarPS.Checked Then
If TmpDT IsNot Nothing Then
TmpDT.Rows.Clear()
End If
End If
Dim drPSFlete As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSServicio).FiltroPrimero("")
If DrPS IsNot Nothing Then
CveUM = drPSFlete("CveUnidadMedida").ToString().ToEntero()
CveClasificacion = drPSFlete("CveClasificacion").ToString().ToEntero()
End If
Dim CvePSServicio As Integer = DdlPSFlete.SelectedValue.ToEntero()
If CvePSServicio > 0 Then
Dim Cantidad As Decimal = TxtCantidadMercancia.Text.ToDecimal
Dim PU As Decimal = TxtPrecioMercancia.Text.Trim.ToDecimal
Dim Descuento As Decimal = 0
Dim CveUM As Integer = -1
Dim UnidadMedida As String = ""
Dim CveClasificacion As Integer = -1
Dim Clasificacion As String = ""
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
Dim CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProyecto", "").ToEntero()
Dim drPSFlete As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSServicio).FiltroPrimero("")
If DrPS IsNot Nothing Then
CveUM = drPSFlete("CveUnidadMedida").ToString().ToEntero()
CveClasificacion = drPSFlete("CveClasificacion").ToString().ToEntero()
End If
Dim Proyecto As String = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("Proyecto", "").ToString()
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
Dim CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProyecto", "").ToEntero()
AgregarProductoServicio(Cantidad, CveUM, UnidadMedida, CveClasificacion, Clasificacion,
Dim Proyecto As String = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("Proyecto", "").ToString()
AgregarProductoServicio(Cantidad, CveUM, UnidadMedida, CveClasificacion, Clasificacion,
CvePSServicio, "", TxtObservacionesMercancia.Text.Trim, PU, Descuento,
CveProyecto, Proyecto, CveSubProyecto, DdlSubProyectoDatos.SelectedItem.Text,
Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1,
ImporteProntoPago:=0)
CalculaUsados()
CalculaTotalesVenta()
Else
Alert("No se agrego el servicio del flete", TipoMensaje.MsgAdvertencia)
End If
CalculaTotalesVenta()
Alert("Se agregó la mercancía correctamente")
Else
Alert("No se agregó el servicio", TipoMensaje.MsgAdvertencia)
End If
TxtCantidadMercancia.Text = ""
TxtObservacionesMercancia.Text = ""
TxtPrecioMercancia.Text = ""
RegistraScript("$('#DivAddMercancia').modal('hide');", "A2")
UpAgregarMercancia.Update()
UpEmitirTransitorio.Update()
End Sub
@@ -34797,19 +34856,31 @@ Partial Class Ventas
DdlDireccionDestino.DataSource = TmpDTDireccionCP
DdlDireccionDestino.DataBind()
End Sub
Protected Sub ChkAgregarFlete_CheckedChanged(sender As Object, e As EventArgs)
'Protected Sub ChkAgregarFlete_CheckedChanged(sender As Object, e As EventArgs)
DivServicioFlete.Visible = ChkAgregarFlete.Checked
' DivServicioFlete.Visible = ChkAgregarFlete.Checked
UpAgregarMercancia.Update()
End Sub
Protected Sub DdlPSMercancia_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPSMercancia.selectedindexchange
Dim CvePSParametro As Integer = DdlPSMercancia.SelectedValue.ToEntero()
' UpAgregarMercancia.Update()
'End Sub
Protected Sub DdlPSFlete_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPSFlete.selectedindexchange
Dim CvePSParametro As Integer = DdlPSFlete.SelectedValue.ToEntero()
If CvePSParametro > 0 Then
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSMercancia.SelectedValue.ToEntero()).FiltroPrimero("")
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
If drPS IsNot Nothing Then
Dim CvePSMercancia As Integer = drPS("CvePSAdicionalVigencia").ToString().ToEntero()
Dim CveClasificacion As Integer = drPS("CveClasificacion").ToString().ToEntero()
If CvePSMercancia > 0 Then
If UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
DdlPSMercancia.SelectedValue = CvePSMercancia.ToString()
'DdlPSMercancia.SelectedText = TxtPS.Text.Trim
Else
'DdlPSMercancia.ddl.Items.Insert(2, New ListItem(TxtPS.Text.Trim, ObjProductosServicios.CvePS.ToString()))
DdlPSMercancia.ddl.SelectedValueExist(CvePSMercancia.ToString())
End If
End If
'SUGIERE PRECIO
Dim PrecioSugerido As Decimal = 0
Dim tPrecioSugerido As Decimal = 0
@@ -34883,6 +34954,8 @@ Partial Class Ventas
End If
End If
UpAgregarMercancia.Update()
End Sub
End Class