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
|
if bEliminado then
|
||||||
begin
|
begin
|
||||||
AFactura.DataTable.ApplyUpdates;
|
try
|
||||||
Result := True;
|
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
|
end
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|||||||
@ -269,10 +269,10 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
|||||||
inherited FontSize: TEdit
|
inherited FontSize: TEdit
|
||||||
Left = 544
|
Left = 544
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 120
|
Width = 136
|
||||||
ExplicitLeft = 544
|
ExplicitLeft = 544
|
||||||
ExplicitTop = 0
|
ExplicitTop = 0
|
||||||
ExplicitWidth = 120
|
ExplicitWidth = 136
|
||||||
end
|
end
|
||||||
inherited ToolButton13: TToolButton [7]
|
inherited ToolButton13: TToolButton [7]
|
||||||
Left = 0
|
Left = 0
|
||||||
|
|||||||
@ -135,7 +135,9 @@ begin
|
|||||||
|
|
||||||
if (Application.MessageBox(PChar(AMensaje), 'Atención', MB_YESNO) = IDYES) then
|
if (Application.MessageBox(PChar(AMensaje), 'Atención', MB_YESNO) = IDYES) then
|
||||||
begin
|
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;
|
inherited;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -131,22 +131,40 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
|
|||||||
Width = 849
|
Width = 849
|
||||||
ExplicitWidth = 849
|
ExplicitWidth = 849
|
||||||
inherited txtFiltroTodo: TcxTextEdit
|
inherited txtFiltroTodo: TcxTextEdit
|
||||||
|
Style.LookAndFeel.SkinName = ''
|
||||||
|
StyleDisabled.LookAndFeel.SkinName = ''
|
||||||
|
StyleFocused.LookAndFeel.SkinName = ''
|
||||||
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
ExplicitWidth = 809
|
ExplicitWidth = 809
|
||||||
Width = 809
|
Width = 809
|
||||||
end
|
end
|
||||||
inherited edtFechaIniFiltro: TcxDateEdit
|
inherited edtFechaIniFiltro: TcxDateEdit
|
||||||
|
Style.LookAndFeel.SkinName = ''
|
||||||
|
StyleDisabled.LookAndFeel.SkinName = ''
|
||||||
|
StyleFocused.LookAndFeel.SkinName = ''
|
||||||
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
ExplicitWidth = 282
|
ExplicitWidth = 282
|
||||||
Width = 282
|
Width = 282
|
||||||
end
|
end
|
||||||
inherited edtFechaFinFiltro: TcxDateEdit
|
inherited edtFechaFinFiltro: TcxDateEdit
|
||||||
Left = 386
|
Left = 386
|
||||||
|
Style.LookAndFeel.SkinName = ''
|
||||||
|
StyleDisabled.LookAndFeel.SkinName = ''
|
||||||
|
StyleFocused.LookAndFeel.SkinName = ''
|
||||||
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
ExplicitLeft = 386
|
ExplicitLeft = 386
|
||||||
ExplicitWidth = 453
|
ExplicitWidth = 453
|
||||||
Width = 453
|
Width = 453
|
||||||
end
|
end
|
||||||
inherited eLista: TcxComboBox
|
inherited eLista: TcxComboBox
|
||||||
Left = 876
|
Left = 876
|
||||||
|
Style.LookAndFeel.SkinName = ''
|
||||||
|
StyleDisabled.LookAndFeel.SkinName = ''
|
||||||
|
StyleFocused.LookAndFeel.SkinName = ''
|
||||||
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
ExplicitLeft = 876
|
ExplicitLeft = 876
|
||||||
|
ExplicitWidth = 215
|
||||||
|
Width = 215
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||||
@ -3372,8 +3390,8 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
|
|||||||
82866906D6993E62F6F1C3F45D160A5305BE68FF8095CF5B4302134CFE1185EA
|
82866906D6993E62F6F1C3F45D160A5305BE68FF8095CF5B4302134CFE1185EA
|
||||||
1FB8A1B4FF4FE32FF6FADB8B5E0000000049454E44AE426082}
|
1FB8A1B4FF4FE32FF6FADB8B5E0000000049454E44AE426082}
|
||||||
Instruction.Text =
|
Instruction.Text =
|
||||||
'Las siguientes facturas no han podido ser eliminadas, porque est' +
|
'Las siguientes facturas no han podido ser eliminadas, porque tie' +
|
||||||
#225'n parcialmente pagadas o totalmete pagadas'
|
'nen recibos con pagos o devoluciones emitidas'
|
||||||
Instruction.Glyph.Data = {
|
Instruction.Glyph.Data = {
|
||||||
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001C00
|
0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000001C00
|
||||||
00001C0806000000720DDF940000000970485973000017120000171201679FD2
|
00001C0806000000720DDF940000000970485973000017120000171201679FD2
|
||||||
|
|||||||
@ -172,13 +172,21 @@ begin
|
|||||||
|
|
||||||
if Assigned(AFacturas) then
|
if Assigned(AFacturas) then
|
||||||
begin
|
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
|
if AllItems then
|
||||||
begin
|
begin
|
||||||
if (AFacturas.DataTable.RecordCount > 0) then
|
if (AFacturas.DataTable.RecordCount > 0) then
|
||||||
begin
|
begin
|
||||||
with AFacturas.DataTable do
|
with AFacturas.DataTable do
|
||||||
begin
|
begin
|
||||||
|
JsListaFacturasNoEliminadas.Content.Clear;
|
||||||
First;
|
First;
|
||||||
while not EOF do
|
while not EOF do
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user