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

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@311 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
David Arranz 2008-09-19 09:57:37 +00:00
parent 7947221b56
commit 2d5918b06b
15 changed files with 157 additions and 146 deletions

View File

@ -3762,7 +3762,8 @@ ALTER TABLE PEDIDOS_PROVEEDOR_DETALLES ADD CONSTRAINT FK_PEDIDOS_PROV_DET_ID_PED
ALTER TABLE REMESAS_CLIENTE ADD CONSTRAINT FK_REMESAS_CLIENTE FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID); ALTER TABLE REMESAS_CLIENTE ADD CONSTRAINT FK_REMESAS_CLIENTE FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID);
ALTER TABLE REMESAS_PROVEEDOR ADD CONSTRAINT FK_REMESAS_PROVEEDOR FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID); ALTER TABLE REMESAS_PROVEEDOR ADD CONSTRAINT FK_REMESAS_PROVEEDOR FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID);
ALTER TABLE TIENDA_WEB ADD CONSTRAINT FK_EMPRESAS_TIENDA_WEB FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE TIENDA_WEB ADD CONSTRAINT FK_EMPRESAS_TIENDA_WEB FOREIGN KEY (ID_EMPRESA) REFERENCES EMPRESAS (ID) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE PAGOS_CLIENTE ADD CONSTRAINT FK_PAGOS_CLIENTE_1 FOREIGN KEY (ID_RECIBO) REFERENCES RECIBOS_CLIENTE (ID);
ALTER TABLE PAGOS_PROVEEDOR ADD CONSTRAINT FK_PAGOS_PROVEEDOR_1 FOREIGN KEY (ID_RECIBO) REFERENCES RECIBOS_PROVEEDOR (ID);
/******************************************************************************/ /******************************************************************************/
/**** Indices ****/ /**** Indices ****/

View File

@ -826,8 +826,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;

View File

@ -102,37 +102,17 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Height = 370 Height = 370
ExplicitWidth = 757 ExplicitWidth = 757
ExplicitHeight = 370 ExplicitHeight = 370
inherited eReferencia: TcxDBTextEdit
ExplicitWidth = 159
Width = 159
end
inherited edtFecha: TcxDBDateEdit
ExplicitWidth = 159
Width = 159
end
inherited memObservaciones: TcxDBMemo inherited memObservaciones: TcxDBMemo
ExplicitWidth = 301 ExplicitWidth = 713
ExplicitHeight = 159 ExplicitHeight = 29
Height = 159 Height = 29
Width = 301 Width = 713
end
inherited cbFormaPago: TcxDBLookupComboBox
ExplicitWidth = 78
Width = 78
end
inherited frViewTienda1: TfrViewTienda
inherited dxLayoutControl1: TdxLayoutControl
inherited cbTienda: TcxComboBox
ExplicitWidth = 399
Width = 399
end
end
end end
inherited frViewClienteFactura1: TfrViewClienteFactura inherited frViewClienteFactura1: TfrViewClienteFactura
Width = 314 Width = 334
ExplicitWidth = 314 ExplicitWidth = 334
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 314 Width = 334
ExplicitWidth = 314 ExplicitWidth = 314
inherited Bevel1: TBevel inherited Bevel1: TBevel
Width = 266 Width = 266
@ -140,28 +120,28 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
end end
inherited edtlNombre: TcxDBTextEdit inherited edtlNombre: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 224 ExplicitWidth = 243
Width = 224 Width = 243
end end
inherited edtNIFCIF: TcxDBTextEdit inherited edtNIFCIF: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 562 ExplicitWidth = 243
Width = 562 Width = 243
end end
inherited edtCalle: TcxDBTextEdit inherited edtCalle: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 562 ExplicitWidth = 243
Width = 562 Width = 243
end end
inherited edtPoblacion: TcxDBTextEdit inherited edtPoblacion: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 177 ExplicitWidth = 125
Width = 177 Width = 125
end end
inherited edtProvincia: TcxDBTextEdit inherited edtProvincia: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 327 ExplicitWidth = 243
Width = 327 Width = 243
end end
inherited edtCodigoPostal: TcxDBTextEdit inherited edtCodigoPostal: TcxDBTextEdit
Left = 242 Left = 242
@ -173,8 +153,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
ExplicitLeft = 132 ExplicitLeft = 132
end end
inherited cxDBTextEdit1: TcxDBTextEdit inherited cxDBTextEdit1: TcxDBTextEdit
ExplicitWidth = 283 ExplicitWidth = 243
Width = 283 Width = 243
end end
end end
end end
@ -302,14 +282,14 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
inherited cbSubCuentas: TcxComboBox inherited cbSubCuentas: TcxComboBox
Left = 85 Left = 85
ExplicitLeft = 85 ExplicitLeft = 85
ExplicitWidth = 376 ExplicitWidth = 429
Width = 376 Width = 429
end end
inherited eContabilizar: TcxCheckBox inherited eContabilizar: TcxCheckBox
Left = 520 Left = 520
ExplicitLeft = 520 ExplicitLeft = 520
ExplicitWidth = 203 ExplicitWidth = 227
Width = 203 Width = 227
end end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Item1: TdxLayoutItem inherited dxLayoutControl1Item1: TdxLayoutItem
@ -377,8 +357,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Top = 131 Top = 131
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitTop = 131 ExplicitTop = 131
ExplicitWidth = 93 ExplicitWidth = 220
Width = 93 Width = 220
end end
inherited ImporteIVA: TcxDBCurrencyEdit inherited ImporteIVA: TcxDBCurrencyEdit
Left = 594 Left = 594
@ -386,8 +366,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 594 ExplicitLeft = 594
ExplicitTop = 57 ExplicitTop = 57
ExplicitWidth = 137 ExplicitWidth = 155
Width = 137 Width = 155
end end
inherited ImporteTotal: TcxDBCurrencyEdit inherited ImporteTotal: TcxDBCurrencyEdit
Left = 524 Left = 524
@ -395,8 +375,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 524 ExplicitLeft = 524
ExplicitTop = 131 ExplicitTop = 131
ExplicitWidth = 137 ExplicitWidth = 225
Width = 137 Width = 225
end end
inherited edtDescuento: TcxDBSpinEdit inherited edtDescuento: TcxDBSpinEdit
Top = 131 Top = 131
@ -417,8 +397,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 523 ExplicitLeft = 523
ExplicitTop = 30 ExplicitTop = 30
ExplicitWidth = 92 ExplicitWidth = 226
Width = 92 Width = 226
end end
inherited edtRE: TcxDBSpinEdit inherited edtRE: TcxDBSpinEdit
Left = 523 Left = 523
@ -434,15 +414,15 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 594 ExplicitLeft = 594
ExplicitTop = 84 ExplicitTop = 84
ExplicitWidth = 56 ExplicitWidth = 155
Width = 56 Width = 155
end end
inherited eImporteNeto: TcxDBCurrencyEdit inherited eImporteNeto: TcxDBCurrencyEdit
Top = 30 Top = 30
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitTop = 30 ExplicitTop = 30
ExplicitWidth = 147 ExplicitWidth = 291
Width = 147 Width = 291
end end
inherited ePorte: TcxDBCurrencyEdit inherited ePorte: TcxDBCurrencyEdit
Top = 158 Top = 158
@ -451,16 +431,16 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Style.IsFontAssigned = True Style.IsFontAssigned = True
OnEditing = frViewTotales1ePorteEditing OnEditing = frViewTotales1ePorteEditing
ExplicitTop = 158 ExplicitTop = 158
ExplicitWidth = 147 ExplicitWidth = 291
Width = 147 Width = 291
end end
inherited eIVA: TcxDBLookupComboBox inherited eIVA: TcxDBLookupComboBox
Top = 57 Top = 57
Properties.OnValidate = frViewTotales1eIVAPropertiesValidate Properties.OnValidate = frViewTotales1eIVAPropertiesValidate
Style.Color = clInfoBk Style.Color = clInfoBk
ExplicitTop = 57 ExplicitTop = 57
ExplicitWidth = 134 ExplicitWidth = 153
Width = 134 Width = 153
end end
inherited bTiposIVA: TButton inherited bTiposIVA: TButton
Left = 263 Left = 263
@ -473,8 +453,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Top = 84 Top = 84
Properties.OnEditValueChanged = frViewTotales1cbRecargoEquivalenciaPropertiesEditValueChanged Properties.OnEditValueChanged = frViewTotales1cbRecargoEquivalenciaPropertiesEditValueChanged
ExplicitTop = 84 ExplicitTop = 84
ExplicitWidth = 219 ExplicitWidth = 291
Width = 219 Width = 291
end end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Group1: TdxLayoutGroup inherited dxLayoutControl1Group1: TdxLayoutGroup

View File

@ -143,7 +143,9 @@ begin
if (Application.MessageBox(PChar(ACadena), 'Atención', MB_YESNO) = IDYES) then if (Application.MessageBox(PChar(ACadena), '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;

View File

@ -38,7 +38,7 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
Width = 640 Width = 640
ExplicitWidth = 640 ExplicitWidth = 640
inherited tbxMain: TTBXToolbar inherited tbxMain: TTBXToolbar
ExplicitWidth = 632 ExplicitWidth = 640
object TBXSubmenuItem2: TTBXSubmenuItem [0] object TBXSubmenuItem2: TTBXSubmenuItem [0]
Caption = 'Nuevo' Caption = 'Nuevo'
DisplayMode = nbdmImageAndText DisplayMode = nbdmImageAndText
@ -133,18 +133,18 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
Width = 640 Width = 640
ExplicitWidth = 640 ExplicitWidth = 640
inherited txtFiltroTodo: TcxTextEdit inherited txtFiltroTodo: TcxTextEdit
ExplicitWidth = 457 ExplicitWidth = 543
Width = 457 Width = 543
end end
inherited edtFechaIniFiltro: TcxDateEdit inherited edtFechaIniFiltro: TcxDateEdit
ExplicitWidth = 240 ExplicitWidth = 263
Width = 240 Width = 263
end end
inherited edtFechaFinFiltro: TcxDateEdit inherited edtFechaFinFiltro: TcxDateEdit
Left = 367 Left = 367
ExplicitLeft = 367 ExplicitLeft = 367
ExplicitWidth = 244 ExplicitWidth = 263
Width = 244 Width = 263
end end
end end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel inherited TBXAlignmentPanel1: TTBXAlignmentPanel
@ -3355,8 +3355,8 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
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

View File

@ -173,13 +173,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

View File

@ -833,8 +833,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;

View File

@ -106,42 +106,44 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
732 732
314) 314)
inherited eReferencia: TcxDBTextEdit inherited eReferencia: TcxDBTextEdit
ExplicitWidth = 159 ExplicitWidth = 191
Width = 159 Width = 191
end end
inherited edtFecha: TcxDBDateEdit inherited edtFecha: TcxDBDateEdit
ExplicitWidth = 159 ExplicitWidth = 191
Width = 159 Width = 191
end end
inherited memObservaciones: TcxDBMemo inherited memObservaciones: TcxDBMemo
ExplicitWidth = 301 ExplicitWidth = 671
ExplicitHeight = 159 Width = 671
Height = 159
Width = 301
end end
inherited cbFormaPago: TcxDBLookupComboBox inherited cbFormaPago: TcxDBLookupComboBox
ExplicitWidth = 169 ExplicitWidth = 53
Width = 169 Width = 53
end end
inherited bFormasPago: TButton inherited bFormasPago: TButton
Left = 183 Left = 183
ExplicitLeft = 183 ExplicitLeft = 183
end end
inherited eReferenciaProveedor: TcxDBTextEdit inherited eReferenciaProveedor: TcxDBTextEdit
ExplicitWidth = 316 ExplicitWidth = 191
Width = 316 Width = 191
end end
inherited frViewTienda1: TfrViewTienda inherited frViewTienda1: TfrViewTienda
Width = 320 Width = 293
ExplicitWidth = 320 ExplicitWidth = 293
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 320 Width = 293
inherited cbTienda: TcxComboBox inherited cbTienda: TcxComboBox
ExplicitWidth = 376 ExplicitWidth = 232
Width = 376 Width = 232
end end
end end
end end
inherited edtFechaVencimiento: TcxDBDateEdit
ExplicitWidth = 191
Width = 191
end
inherited frViewProveedorFactura1: TfrViewProveedorFactura inherited frViewProveedorFactura1: TfrViewProveedorFactura
Left = 343 Left = 343
Width = 350 Width = 350
@ -156,27 +158,27 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
end end
inherited edtlNombre: TcxDBTextEdit inherited edtlNombre: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 266 ExplicitWidth = 259
Width = 266 Width = 259
end end
inherited edtNIFCIF: TcxDBTextEdit inherited edtNIFCIF: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 266 ExplicitWidth = 259
Width = 266 Width = 259
end end
inherited edtCalle: TcxDBTextEdit inherited edtCalle: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 266 ExplicitWidth = 259
Width = 266 Width = 259
end end
inherited edtPoblacion: TcxDBTextEdit inherited edtPoblacion: TcxDBTextEdit
DataBinding.DataSource = dsDataTable DataBinding.DataSource = dsDataTable
ExplicitWidth = 148 ExplicitWidth = 141
Width = 148 Width = 141
end end
inherited edtProvincia: TcxDBTextEdit inherited edtProvincia: TcxDBTextEdit
ExplicitWidth = 266 ExplicitWidth = 259
Width = 266 Width = 259
end end
inherited edtCodigoPostal: TcxDBTextEdit inherited edtCodigoPostal: TcxDBTextEdit
Left = 258 Left = 258
@ -188,8 +190,8 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
ExplicitLeft = 142 ExplicitLeft = 142
end end
inherited cxDBTextEdit1: TcxDBTextEdit inherited cxDBTextEdit1: TcxDBTextEdit
ExplicitWidth = 276 ExplicitWidth = 259
Width = 276 Width = 259
end end
end end
end end
@ -199,10 +201,6 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
object pagContenido: TTabSheet object pagContenido: TTabSheet
Caption = 'Contenido' Caption = 'Contenido'
ImageIndex = 1 ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
inline frViewDetallesFacturaProveedor1: TfrViewDetallesFacturaProveedor inline frViewDetallesFacturaProveedor1: TfrViewDetallesFacturaProveedor
Left = 0 Left = 0
Top = 0 Top = 0
@ -320,14 +318,14 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
inherited cbSubCuentas: TcxComboBox inherited cbSubCuentas: TcxComboBox
Left = 92 Left = 92
ExplicitLeft = 92 ExplicitLeft = 92
ExplicitWidth = 376 ExplicitWidth = 407
Width = 376 Width = 407
end end
inherited eContabilizar: TcxCheckBox inherited eContabilizar: TcxCheckBox
Left = 505 Left = 505
ExplicitLeft = 505 ExplicitLeft = 505
ExplicitWidth = 203 ExplicitWidth = 217
Width = 203 Width = 217
end end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Item1: TdxLayoutItem inherited dxLayoutControl1Item1: TdxLayoutItem
@ -394,8 +392,8 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Top = 131 Top = 131
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitTop = 131 ExplicitTop = 131
ExplicitWidth = 93 ExplicitWidth = 207
Width = 93 Width = 207
end end
inherited ImporteIVA: TcxDBCurrencyEdit inherited ImporteIVA: TcxDBCurrencyEdit
Left = 581 Left = 581
@ -403,8 +401,8 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 581 ExplicitLeft = 581
ExplicitTop = 57 ExplicitTop = 57
ExplicitWidth = 137 ExplicitWidth = 143
Width = 137 Width = 143
end end
inherited ImporteTotal: TcxDBCurrencyEdit inherited ImporteTotal: TcxDBCurrencyEdit
Left = 511 Left = 511
@ -412,8 +410,8 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 511 ExplicitLeft = 511
ExplicitTop = 131 ExplicitTop = 131
ExplicitWidth = 137 ExplicitWidth = 213
Width = 137 Width = 213
end end
inherited edtDescuento: TcxDBSpinEdit inherited edtDescuento: TcxDBSpinEdit
Top = 131 Top = 131
@ -434,8 +432,8 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 510 ExplicitLeft = 510
ExplicitTop = 30 ExplicitTop = 30
ExplicitWidth = 92 ExplicitWidth = 214
Width = 92 Width = 214
end end
inherited edtRE: TcxDBSpinEdit inherited edtRE: TcxDBSpinEdit
Left = 510 Left = 510
@ -451,15 +449,15 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitLeft = 581 ExplicitLeft = 581
ExplicitTop = 84 ExplicitTop = 84
ExplicitWidth = 56 ExplicitWidth = 143
Width = 56 Width = 143
end end
inherited eImporteNeto: TcxDBCurrencyEdit inherited eImporteNeto: TcxDBCurrencyEdit
Top = 30 Top = 30
Style.IsFontAssigned = True Style.IsFontAssigned = True
ExplicitTop = 30 ExplicitTop = 30
ExplicitWidth = 147 ExplicitWidth = 278
Width = 147 Width = 278
end end
inherited ePorte: TcxDBCurrencyEdit inherited ePorte: TcxDBCurrencyEdit
Top = 158 Top = 158
@ -468,16 +466,16 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Style.IsFontAssigned = True Style.IsFontAssigned = True
OnEditing = frViewTotales1ePorteEditing OnEditing = frViewTotales1ePorteEditing
ExplicitTop = 158 ExplicitTop = 158
ExplicitWidth = 147 ExplicitWidth = 278
Width = 147 Width = 278
end end
inherited eIVA: TcxDBLookupComboBox inherited eIVA: TcxDBLookupComboBox
Top = 57 Top = 57
Properties.OnValidate = frViewTotales1eIVAPropertiesValidate Properties.OnValidate = frViewTotales1eIVAPropertiesValidate
Style.Color = clInfoBk Style.Color = clInfoBk
ExplicitTop = 57 ExplicitTop = 57
ExplicitWidth = 134 ExplicitWidth = 140
Width = 134 Width = 140
end end
inherited bTiposIVA: TButton inherited bTiposIVA: TButton
Left = 250 Left = 250
@ -490,8 +488,8 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
Top = 84 Top = 84
Properties.OnEditValueChanged = frViewTotales1cbRecargoEquivalenciaPropertiesEditValueChanged Properties.OnEditValueChanged = frViewTotales1cbRecargoEquivalenciaPropertiesEditValueChanged
ExplicitTop = 84 ExplicitTop = 84
ExplicitWidth = 219 ExplicitWidth = 278
Width = 219 Width = 278
end end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group_Root: TdxLayoutGroup
LookAndFeel = frViewFacturaProveedor1.dxLayoutOfficeLookAndFeel1 LookAndFeel = frViewFacturaProveedor1.dxLayoutOfficeLookAndFeel1

View File

@ -140,7 +140,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;

View File

@ -38,7 +38,7 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
Width = 640 Width = 640
ExplicitWidth = 640 ExplicitWidth = 640
inherited tbxMain: TTBXToolbar inherited tbxMain: TTBXToolbar
ExplicitWidth = 632 ExplicitWidth = 640
object TBXSubmenuItem2: TTBXSubmenuItem [0] object TBXSubmenuItem2: TTBXSubmenuItem [0]
Caption = 'Nuevo' Caption = 'Nuevo'
DisplayMode = nbdmImageAndText DisplayMode = nbdmImageAndText
@ -131,18 +131,18 @@ inherited fEditorFacturasProveedor: TfEditorFacturasProveedor
Width = 640 Width = 640
ExplicitWidth = 640 ExplicitWidth = 640
inherited txtFiltroTodo: TcxTextEdit inherited txtFiltroTodo: TcxTextEdit
ExplicitWidth = 457 ExplicitWidth = 543
Width = 457 Width = 543
end end
inherited edtFechaIniFiltro: TcxDateEdit inherited edtFechaIniFiltro: TcxDateEdit
ExplicitWidth = 240 ExplicitWidth = 263
Width = 240 Width = 263
end end
inherited edtFechaFinFiltro: TcxDateEdit inherited edtFechaFinFiltro: TcxDateEdit
Left = 367 Left = 367
ExplicitLeft = 367 ExplicitLeft = 367
ExplicitWidth = 244 ExplicitWidth = 263
Width = 244 Width = 263
end end
end end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel inherited TBXAlignmentPanel1: TTBXAlignmentPanel
@ -3353,8 +3353,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

View File

@ -180,13 +180,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

View File

@ -13,4 +13,4 @@ BEGIN
END END
/* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Controller\GestorDocumentos_Controller.res */ /* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Controller\GestorDocumentos_Controller.res */
/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf36A.tmp */ /* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf1F7.tmp */

View File

@ -14,4 +14,4 @@ END
/* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\uDataModuleGestorDocumentos.dfm */ /* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\uDataModuleGestorDocumentos.dfm */
/* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\GestorDocumentos_data.res */ /* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\GestorDocumentos_data.res */
/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf368.tmp */ /* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf1F5.tmp */

Binary file not shown.

View File

@ -16,7 +16,7 @@ BEGIN
VALUE "FileVersion", "2.2.4.0\0" VALUE "FileVersion", "2.2.4.0\0"
VALUE "ProductName", "FactuGES (Servidor)\0" VALUE "ProductName", "FactuGES (Servidor)\0"
VALUE "ProductVersion", "2.2.4.0\0" VALUE "ProductVersion", "2.2.4.0\0"
VALUE "CompileDate", "lunes, 08 de septiembre de 2008 18:46\0" VALUE "CompileDate", "viernes, 19 de septiembre de 2008 11:50\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"