Arreglo, al eliminar una o varias facturas de proveedor si tiene recibos con devoluciones la factura esta pendiente y se puede borar pero por integridad no se permite borrar, antes este caso no decia nada ahora se saca un mensaje
(Ya esta hecho en ACANA) git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@599 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
d143a31fc6
commit
84c1d29a98
@ -577,8 +577,14 @@ begin
|
||||
|
||||
if bEliminado then
|
||||
begin
|
||||
AFactura.DataTable.ApplyUpdates;
|
||||
Result := True;
|
||||
try
|
||||
AFactura.DataTable.ApplyUpdates;
|
||||
Result := True
|
||||
except
|
||||
//En el caso de una factura que tiene recibos con devoluciones hechas no se puede borrar aunque la factura este en situacion de pendiente
|
||||
AFactura.DataTable.CancelUpdates;
|
||||
Result := False;
|
||||
end;
|
||||
end
|
||||
else
|
||||
Result := False;
|
||||
|
||||
@ -269,10 +269,10 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
inherited FontSize: TEdit
|
||||
Left = 544
|
||||
Top = 0
|
||||
Width = 120
|
||||
Width = 136
|
||||
ExplicitLeft = 544
|
||||
ExplicitTop = 0
|
||||
ExplicitWidth = 120
|
||||
ExplicitWidth = 136
|
||||
end
|
||||
inherited ToolButton13: TToolButton [7]
|
||||
Left = 0
|
||||
|
||||
@ -135,7 +135,9 @@ begin
|
||||
|
||||
if (Application.MessageBox(PChar(AMensaje), 'Atención', MB_YESNO) = IDYES) then
|
||||
begin
|
||||
FController.Eliminar(Factura);
|
||||
//Es el caso de querer borrar una factura pendiente cuyos recibos tienen devoluciones
|
||||
if not FController.Eliminar(Factura) then
|
||||
Application.MessageBox('La factura no ha podido ser eliminada porque tiene recibos con pagos o devoluciones emitidas.', 'Atención', MB_OK);
|
||||
inherited;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -131,22 +131,40 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
|
||||
Width = 849
|
||||
ExplicitWidth = 849
|
||||
inherited txtFiltroTodo: TcxTextEdit
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitWidth = 809
|
||||
Width = 809
|
||||
end
|
||||
inherited edtFechaIniFiltro: TcxDateEdit
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitWidth = 282
|
||||
Width = 282
|
||||
end
|
||||
inherited edtFechaFinFiltro: TcxDateEdit
|
||||
Left = 386
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 386
|
||||
ExplicitWidth = 453
|
||||
Width = 453
|
||||
end
|
||||
inherited eLista: TcxComboBox
|
||||
Left = 876
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
StyleDisabled.LookAndFeel.SkinName = ''
|
||||
StyleFocused.LookAndFeel.SkinName = ''
|
||||
StyleHot.LookAndFeel.SkinName = ''
|
||||
ExplicitLeft = 876
|
||||
ExplicitWidth = 215
|
||||
Width = 215
|
||||
end
|
||||
end
|
||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||
@ -3372,8 +3390,8 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
|
||||
82866906D6993E62F6F1C3F45D160A5305BE68FF8095CF5B4302134CFE1185EA
|
||||
1FB8A1B4FF4FE32FF6FADB8B5E0000000049454E44AE426082}
|
||||
Instruction.Text =
|
||||
'Las siguientes facturas no han podido ser eliminadas, porque est' +
|
||||
#225'n parcialmente pagadas o totalmete pagadas'
|
||||
'Las siguientes facturas no han podido ser eliminadas, porque tie' +
|
||||
'nen recibos con pagos o devoluciones emitidas'
|
||||
Instruction.Glyph.Data = {
|
||||
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001C00
|
||||
00001C0806000000720DDF940000000970485973000017120000171201679FD2
|
||||
|
||||
@ -172,13 +172,21 @@ begin
|
||||
|
||||
if Assigned(AFacturas) then
|
||||
begin
|
||||
FController.Eliminar(AFacturas, AllItems);
|
||||
if (not FController.Eliminar(AFacturas, AllItems))
|
||||
and (not AllItems) then //Es el caso de querer borrar una factura pendiente cuyos recibos tienen devoluciones
|
||||
begin
|
||||
JsListaFacturasNoEliminadas.Content.Clear;
|
||||
JsListaFacturasNoEliminadas.Content.Add('Ref. factura: ' + AFacturas.REFERENCIA + ' ' + AFacturas.NOMBRE);
|
||||
JsListaFacturasNoEliminadas.Execute;
|
||||
end;
|
||||
|
||||
if AllItems then
|
||||
begin
|
||||
if (AFacturas.DataTable.RecordCount > 0) then
|
||||
begin
|
||||
with AFacturas.DataTable do
|
||||
begin
|
||||
JsListaFacturasNoEliminadas.Content.Clear;
|
||||
First;
|
||||
while not EOF do
|
||||
begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user