Soporte en ventas al convrtir remision.

Cambios en BDH PV
This commit is contained in:
Raul Pimienta
2019-09-04 12:57:53 -07:00
parent 8c96f0ea12
commit 7a0ff8f799
3 changed files with 57 additions and 19 deletions

View File

@@ -1193,11 +1193,22 @@
<ajax:FilteredTextBoxExtender ID="FBEImporteContado" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FBEImporteContado" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," />
<asp:CompareValidator ID="CVImporteContado" runat="server" ControlToValidate="TxtImporteContado" Display="None" ErrorMessage="Importe excedido." Operator="LessThanEqual" Type="Double" ValidationGroup="GrpAgregarPago"></asp:CompareValidator> <%--<asp:CompareValidator ID="CVImporteContado" runat="server" ControlToValidate="TxtImporteContado" Display="None" ErrorMessage="Importe excedido." Operator="LessThanEqual" Type="Double" ValidationGroup="GrpAgregarPago"></asp:CompareValidator>--%>
<ajax:ValidatorCalloutExtender ID="VCEImporteContado" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteContado" Width="300px"></ajax:ValidatorCalloutExtender> <%--<ajax:ValidatorCalloutExtender ID="VCEImporteContado" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteContado" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<br></br> <br></br>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-6">
</div>
<label class="col-md-2">Cambio:</label>
<div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBECambio" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
<br></br>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -3180,7 +3191,17 @@
var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value); var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia; var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia;
var totalVenta = ToDouble($get('TxtTotal').value);
if (totalEfectivo > totalVenta) {
$get("TxtCambio").value = FormatoNumero(totalEfectivo - totalVenta);
} else {
$get("TxtCambio").value = "0.00";
}
$get("TxtImporteContado").value = total; $get("TxtImporteContado").value = total;
} }
// **************************************************************************************************************************************************************************** // ****************************************************************************************************************************************************************************
@@ -3491,9 +3512,17 @@
$('#divAgregarCliente').modal(); $('#divAgregarCliente').modal();
} }
function hideDivEC() { function hideDivEC() {
$('#divAgregarCliente').modal('hide'); $('#divAgregarCliente').modal('hide');
} }
function CambiaAjuste(txt, txtajuste) {
Recalcula();
if (txtajuste != null) {
txtajuste.value = ToDouble(txt.value)
}
}
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -1032,8 +1032,8 @@ Partial Class PV
TxtFecha.Text = Now.ToShortDateString() TxtFecha.Text = Now.ToShortDateString()
LblUsuario.Text = UsuarioActual.Usuario LblUsuario.Text = UsuarioActual.Usuario
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();") TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();")
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
'ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';") 'ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
@@ -1476,7 +1476,7 @@ Partial Class PV
HdnIVAOriginal.Value = TxtIVA.Text HdnIVAOriginal.Value = TxtIVA.Text
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False DdlVendedor.Enabled = False
@@ -1967,7 +1967,7 @@ Partial Class PV
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion) Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
UpContado.Update() UpContado.Update()
End Sub End Sub
@@ -3085,7 +3085,7 @@ Partial Class PV
End If End If
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
UpContado.Update() UpContado.Update()
Else Else
@@ -3903,7 +3903,7 @@ Partial Class PV
HdnIVAOriginal.Value = TxtIVA.Text HdnIVAOriginal.Value = TxtIVA.Text
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = Total.ToString 'CVImporteContado.ValueToCompare = Total.ToString
Dim view As DataView = New DataView(TmpDT) Dim view As DataView = New DataView(TmpDT)
view.Sort = "Consec" view.Sort = "Consec"
@@ -4264,6 +4264,7 @@ Partial Class PV
TxtImporteCheque.Text = "0.00" TxtImporteCheque.Text = "0.00"
TxtImporteTransferencia.Text = "0.00" TxtImporteTransferencia.Text = "0.00"
TxtImporteContado.Text = "0.00" TxtImporteContado.Text = "0.00"
TxtCambio.Text = "0.00"
End Sub End Sub
Private Sub LimpiaEscondeContado() Private Sub LimpiaEscondeContado()
'LIMPIA 'LIMPIA
@@ -4336,7 +4337,7 @@ Partial Class PV
'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P. 'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P.
Dim abonado = DtPagos.SUM("Importe") Dim abonado = DtPagos.SUM("Importe")
Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString
CargaGridContado() CargaGridContado()
UpContado.Update() UpContado.Update()
@@ -4350,7 +4351,7 @@ Partial Class PV
If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub
If DtPagos.SUM("Importe").ToString.ToDecimal + total > TxtTotal.Text.ToDecimal Then If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -4363,7 +4364,7 @@ Partial Class PV
DrEfectivo("TipoMovimiento") = "Pago en Efectivo" DrEfectivo("TipoMovimiento") = "Pago en Efectivo"
DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue
DrEfectivo("Cuenta") = DdlCuentaEfectivo.SelectedItem.Text DrEfectivo("Cuenta") = DdlCuentaEfectivo.SelectedItem.Text
DrEfectivo("Importe") = TxtImporteEfectivo.Text DrEfectivo("Importe") = TxtImporteEfectivo.Text.ToDecimal - TxtCambio.Text.ToDecimal
DrEfectivo("Folio") = CargaFolioContado(DdlCuentaEfectivo.SelectedValue.ToEntero, 6) DrEfectivo("Folio") = CargaFolioContado(DdlCuentaEfectivo.SelectedValue.ToEntero, 6)
DrEfectivo("Observaciones") = "" DrEfectivo("Observaciones") = ""
DrEfectivo("Tipo") = "Caja Chica" DrEfectivo("Tipo") = "Caja Chica"
@@ -4456,7 +4457,7 @@ Partial Class PV
'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P. 'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P.
abonado = DtPagos.SUM("Importe") abonado = DtPagos.SUM("Importe")
saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString
CargaGridContado() CargaGridContado()
UpContado.Update() UpContado.Update()
@@ -4873,7 +4874,7 @@ Partial Class PV
Dim ObjVenta As New ClsVentas Dim ObjVenta As New ClsVentas
If ObjVenta.GetVentas(UsuarioActual.CveEmpresa, "Ing", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then If ObjVenta.GetVentas(UsuarioActual.CveEmpresa, "Ing", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
DdlFacturas.DataSource = ObjVenta.DtResultados DdlFacturas.DataSource = ObjVenta.DtResultados
DdlFacturas.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlFacturas.Items.Insert(0, New ListItem("Sin Factura", "-1"))
End If End If
ObjVenta.Dispose() ObjVenta.Dispose()
DdlFacturas.DataBind() DdlFacturas.DataBind()
@@ -4888,7 +4889,7 @@ Partial Class PV
End If End If
DdlFacturas.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlFacturas.Items.Insert(0, New ListItem("Sin Factura", "-1"))
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -4920,7 +4921,7 @@ Partial Class PV
DtPUFacturas.Rows.Clear() DtPUFacturas.Rows.Clear()
If DdlFacturas.SelectedValue.ToEntero > 0 Then If DdlFacturas.SelectedValue.ToEntero > 0 Then
TxtPUFactura.Enabled = False 'TxtPUFactura.Enabled = False
Dim ObjVenta As New ClsVentas Dim ObjVenta As New ClsVentas
If ObjVenta.GetVentaDetalle(DdlFacturas.SelectedValue.ToEntero) Then If ObjVenta.GetVentaDetalle(DdlFacturas.SelectedValue.ToEntero) Then
DdlPSAjuste.DataSource = ObjVenta.DtResultados DdlPSAjuste.DataSource = ObjVenta.DtResultados
@@ -4929,8 +4930,8 @@ Partial Class PV
End If End If
ObjVenta.Dispose() ObjVenta.Dispose()
Else Else
TxtPUFactura.Enabled = True 'TxtPUFactura.Enabled = True
TxtPUFactura.Text = "" 'TxtPUFactura.Text = ""
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
End If End If
DdlPSAjuste.DataBind() DdlPSAjuste.DataBind()
@@ -4944,11 +4945,13 @@ Partial Class PV
LimpiaAjuste() LimpiaAjuste()
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then
ModalidadAjuste = "U" ModalidadAjuste = "U"
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});")
ChkAjuste.Checked = True ChkAjuste.Checked = True
DivAjuste.Visible = True DivAjuste.Visible = True
CargaAjusteDetalle() CargaAjusteDetalle()
Else Else
ModalidadAjuste = "A" ModalidadAjuste = "A"
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
End If End If
End Sub End Sub
@@ -4958,6 +4961,7 @@ Partial Class PV
TxtCodEnsamble.Text = "" TxtCodEnsamble.Text = ""
DdlTipoUso.SelectedIndex = -1 DdlTipoUso.SelectedIndex = -1
TxtCodLinea.Text = "" TxtCodLinea.Text = ""
TxtPUFactura.Text = ""
TxtFechaAjuste.Text = Now.ToShortDateString TxtFechaAjuste.Text = Now.ToShortDateString
CEEFechaAjuste.EndDate = Now CEEFechaAjuste.EndDate = Now
TxtCodInspeccion.Text = "" TxtCodInspeccion.Text = ""
@@ -5023,11 +5027,11 @@ Partial Class PV
End If End If
Contador += 1 Contador += 1
Next Next
TxtPUFactura.Text = PUFactura.FormatoNumero(2) 'TxtPUFactura.Text = PUFactura.FormatoNumero(2)
End If End If
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
TxtPUFactura.Text = "" 'TxtPUFactura.Text = ""
End If End If
CalculaPorcentajeAjuste() CalculaPorcentajeAjuste()
@@ -5115,6 +5119,9 @@ Partial Class PV
'End Function 'End Function
Private Sub GuardaAjuste() Private Sub GuardaAjuste()
TxtPUFactura.Text = TxtPrecio.Text
UpAjuste.Update()
Dim CargoAnterior As Double = 0 Dim CargoAnterior As Double = 0
Dim CargoActual As Double = 0 Dim CargoActual As Double = 0
If ModalidadAjuste = "A" Then If ModalidadAjuste = "A" Then
@@ -5222,9 +5229,12 @@ Partial Class PV
DivAjuste.Attributes.Add("class", "col-md-6") DivAjuste.Attributes.Add("class", "col-md-6")
DivDatosVenta.Attributes.Remove("class") DivDatosVenta.Attributes.Remove("class")
DivDatosVenta.Attributes.Add("class", "col-md-6") DivDatosVenta.Attributes.Add("class", "col-md-6")
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});")
TxtPUFactura.Text = TxtPrecio.Text
Else Else
DivAjuste.Visible = False DivAjuste.Visible = False
TxtCantidad.Enabled = True TxtCantidad.Enabled = True
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
DivModalVenta.Attributes.Remove("class") DivModalVenta.Attributes.Remove("class")
DivModalVenta.Attributes.Add("class", "modal-dialog") DivModalVenta.Attributes.Add("class", "modal-dialog")
DivAjuste.Attributes.Remove("class") DivAjuste.Attributes.Remove("class")

View File

@@ -15679,7 +15679,6 @@ Partial Class Ventas
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales) Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales) Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales) Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales) Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales) Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
Next Next