Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -207,7 +207,7 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<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: 535px;">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
@@ -233,14 +233,14 @@
|
||||
<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 border="0" width="530px">
|
||||
|
||||
<tr align="left" runat="server" id="trNombreCliente">
|
||||
<td width="95px"><b>Nombre:</b> </td>
|
||||
<td width="200px">
|
||||
<td width="170px">
|
||||
<asp:Label ID="LblCliente" runat="server" Text="Cliente"></asp:Label></td>
|
||||
<td width="95px" runat="server" ><b></b></td>
|
||||
<td width="200px">
|
||||
<td width="170px">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -337,7 +337,7 @@
|
||||
</tr>
|
||||
<tr >
|
||||
<td runat="server" id="TdRequiereTecnico1" visible="false">
|
||||
<b>Rquiere Técnico:</b>
|
||||
<b>Requiere Técnico:</b>
|
||||
</td>
|
||||
<td runat="server" id="TdRequiereTecnico2" visible="false">
|
||||
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" />
|
||||
|
||||
@@ -5991,22 +5991,7 @@ Partial Class VentasMedicas
|
||||
End If
|
||||
End If
|
||||
|
||||
'Try
|
||||
' 'RMF, cuando es pedido, se manda autorización.
|
||||
' If ObjFactura.TipoDocto.Contiene("PA") Then
|
||||
|
||||
' Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
||||
' Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
||||
' 'If UsuarioActual.CveEmpresa = 119 Then
|
||||
' ' ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
||||
' ' ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
||||
' ' ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
||||
' 'End If
|
||||
|
||||
' End If
|
||||
'Catch ex As Exception
|
||||
' OnError("Ocurrió un error al mandar las notificaciones de autorización", ex)
|
||||
'End Try
|
||||
|
||||
Try
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
@@ -6516,8 +6501,8 @@ Partial Class VentasMedicas
|
||||
ObjFactura.UsuarioCreo = LblUsuario.Text.Trim
|
||||
ObjFactura.CveCondicionEntrega = --1
|
||||
ObjFactura.CondicionEntrega = "-1"
|
||||
ObjFactura.CondicionesPago = 0 ' 0 - Contado, 1 - Credito, 2 - termianl
|
||||
ObjFactura.FormaPago = 0 'DdlFormaPago.SelectedValue.ToEntero()
|
||||
ObjFactura.CondicionesPago = 2 ' 0 - Contado, 1 - Credito, 2 - termianl
|
||||
ObjFactura.FormaPago = 0
|
||||
|
||||
ObjFactura.AtencionA = ""
|
||||
ObjFactura.FordGSDB = ""
|
||||
@@ -6732,13 +6717,13 @@ Partial Class VentasMedicas
|
||||
End If
|
||||
Next
|
||||
|
||||
ObjFactura.SubTotal = TmpDT.SUM("Total").ToDecimal
|
||||
ObjFactura.Descuento = TmpDT.SUM("Descuento").ToDecimal
|
||||
ObjFactura.SubTotal = TmpDT.SUM("Total")
|
||||
ObjFactura.Descuento = TmpDT.SUM("Descuento")
|
||||
ObjFactura.Amortizacion = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * ObjFactura.TipoCambio, NumeroDecimales)
|
||||
ObjFactura.IVA = TmpDT.SUM("ImporteIVA").ToDecimal
|
||||
ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal
|
||||
ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR").ToDecimal
|
||||
ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS").ToDecimal
|
||||
ObjFactura.IVA = TmpDT.SUM("ImporteIVA")
|
||||
ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA")
|
||||
ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR")
|
||||
ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS")
|
||||
ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales).ToDecimal
|
||||
|
||||
TipoCambioRemision = ObjFactura.TipoCambio
|
||||
@@ -6767,13 +6752,13 @@ Partial Class VentasMedicas
|
||||
End If
|
||||
Next
|
||||
|
||||
ObjFactura.SubTotal = TmpDT.SUM("Total").ToDecimal
|
||||
ObjFactura.Descuento = TmpDT.SUM("Descuento").ToDecimal
|
||||
ObjFactura.SubTotal = TmpDT.SUM("Total")
|
||||
ObjFactura.Descuento = TmpDT.SUM("Descuento")
|
||||
ObjFactura.Amortizacion = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / ObjFactura.TipoCambioDolares, NumeroDecimales)
|
||||
ObjFactura.IVA = TmpDT.SUM("ImporteIVA").ToDecimal
|
||||
ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal
|
||||
ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR").ToDecimal
|
||||
ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS").ToDecimal
|
||||
ObjFactura.IVA = TmpDT.SUM("ImporteIVA")
|
||||
ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA")
|
||||
ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR")
|
||||
ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS")
|
||||
ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales).ToDecimal
|
||||
|
||||
TipoCambioRemision = ObjFactura.TipoCambioDolares
|
||||
@@ -8074,11 +8059,11 @@ Partial Class VentasMedicas
|
||||
|
||||
'Se agregan los PS
|
||||
For Each Row As DataRow In TmpDTDetalle.Rows
|
||||
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
|
||||
Row("PU").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
|
||||
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(),
|
||||
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble,
|
||||
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then
|
||||
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(),
|
||||
Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
|
||||
Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(),
|
||||
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal,
|
||||
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Exit For
|
||||
Else
|
||||
@@ -8259,7 +8244,7 @@ Partial Class VentasMedicas
|
||||
|
||||
Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim Errores As Boolean = False
|
||||
|
||||
Dim ObjOrdenServicio As New ClsOS(TransacSQL)
|
||||
@@ -8275,45 +8260,40 @@ Partial Class VentasMedicas
|
||||
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFecha.Text.Replace(",", "").ToDateTime, $"Venta: {Serie}-{FolioActual}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSubProyectoDatos.SelectedValue.ToEntero,
|
||||
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
|
||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero) Then
|
||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFecha.Text.Replace(",", "").ToDateTime) Then
|
||||
CveOS = ObjOrdenServicio.CveOS
|
||||
Else
|
||||
errorList.Add("Se presento un error al guardar la orden de servicio.")
|
||||
Errores = True
|
||||
End If
|
||||
|
||||
Dim CvePSDetalle As Integer = UsuarioActual.Empresa.Funcionalidad(708).ToEntero
|
||||
|
||||
If Not CvePSDetalle > 0 Then
|
||||
errorList.Add("No se tiene asignado un producto para la orden de servicio (FNC 708).")
|
||||
Errores = True
|
||||
End If
|
||||
|
||||
If Not Errores Then
|
||||
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePSDetalle, 1, -1, -1, $"Venta: {Serie}-{FolioActual}", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="")
|
||||
|
||||
'Dim Consecutivo As Integer = Row("Consecutivo").ToString.ToEntero
|
||||
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
|
||||
Dim Obs As String = Row("Obs").ToString
|
||||
'Dim SeFacturara As Boolean = CBool(Row("SeFacturara").ToString)
|
||||
'Dim CveCuentaEquipo As Integer = Row("CveCuentaEquipo").ToString.ToEntero
|
||||
'Dim ComentarioTecnico As String = Row("ComentarioTecnico").ToString
|
||||
Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero
|
||||
'Dim Archivo As New System.IO.FileInfo(String.Format("{0}OS\Temp\{1}", UsuarioActual.Empresa.Ruta, Row("Archivo").ToString))
|
||||
If CveOsDetalle > 0 Then
|
||||
'MENSAJE PRINCIPAL
|
||||
Dim MensajeAlertOS As New StringBuilder
|
||||
MensajeAlertOS.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio))
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
|
||||
Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
|
||||
Alert(MensajeAlertOS.ToString, TipoMensaje.MsgInformacion, Liga)
|
||||
Else
|
||||
errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.")
|
||||
Errores = True
|
||||
End If
|
||||
|
||||
Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePS, Cantidad, -1, -1, Obs, False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="")
|
||||
|
||||
If CveOsDetalle > 0 Then
|
||||
'MENSAJE PRINCIPAL
|
||||
Dim MensajeAlertOS As New StringBuilder
|
||||
MensajeAlertOS.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio))
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
|
||||
Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
|
||||
Alert(MensajeAlertOS.ToString, TipoMensaje.MsgInformacion, Liga)
|
||||
Else
|
||||
errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.")
|
||||
Errores = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
Return If(Errores, False, True)
|
||||
|
||||
End Function
|
||||
|
||||
@@ -13798,7 +13778,7 @@ Partial Class VentasMedicas
|
||||
End If
|
||||
|
||||
If Not PermiteCredito AndAlso TienePagos AndAlso Total > 0 Then
|
||||
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
|
||||
Dim TotalPago As Decimal = DtPagos.SUM("Importe") + AmortizacionNC
|
||||
|
||||
If TotalPago < Total Then
|
||||
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -14110,7 +14090,7 @@ Partial Class VentasMedicas
|
||||
RowServicio("PorcentajeRetIVA") = ClienteRetIVA
|
||||
|
||||
Next
|
||||
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2)
|
||||
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").FormatoNumero(2)
|
||||
Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
|
||||
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
|
||||
If PorcentajeRetIVA > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user