Tareas #1246: En albaranes de cliente debe salir la base imponible (y no el importe total) Tareas #1248: REvisar agrupaciones facturas proveedor Tareas #1254: Que al seleccionar el cliente se copie la forma de pago del mismo Tareas #1255: Forma de pago, notas y observaciones a nivel de empresa Tareas #1261: Se arregla el tipo de id_tipo_IVA y ID_forma_pago de empresa para que soporte integers Tareas #1264: Revisar el guardar los datos de configuración de la empresa ya que da error Tareas #1265: Revisar forma de pago por defecto de los contactos ya que no está bien Tareas #1269: Que en la lista de contratos se puedan ver las facturas asociadas si las tuviera git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@84 93f398dd-4eb6-7a46-baf6-13f46f578da2
137 lines
4.4 KiB
ObjectPascal
137 lines
4.4 KiB
ObjectPascal
unit srvEmpresas_Impl;
|
||
|
||
{----------------------------------------------------------------------------}
|
||
{ This unit was automatically generated by the RemObjects SDK after reading }
|
||
{ the RODL file associated with this project . }
|
||
{ }
|
||
{ This is where you are supposed to code the implementation of your objects. }
|
||
{----------------------------------------------------------------------------}
|
||
|
||
interface
|
||
|
||
uses
|
||
{vcl:} Classes, SysUtils,
|
||
{RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
|
||
{Ancestor Implementation:} DataAbstractService_Impl,
|
||
{Used RODLs:} DataAbstract4_Intf,
|
||
{Generated:} FactuGES_Intf, uDAScriptingProvider, uDABusinessProcessor,
|
||
uDABin2DataStreamer, uDADataStreamer, uDAClasses, uDAInterfaces;
|
||
|
||
type
|
||
{ TsrvEmpresas }
|
||
TsrvEmpresas = class(TDataAbstractService, IsrvEmpresas)
|
||
Diagrams: TDADiagrams;
|
||
DABin2DataStreamer: TDABin2DataStreamer;
|
||
schEmpresas: TDASchema;
|
||
DataDictionary: TDADataDictionary;
|
||
bpEmpresas: TDABusinessProcessor;
|
||
procedure DARemoteServiceCreate(Sender: TObject);
|
||
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
|
||
var aConnectionName: string);
|
||
procedure DataAbstractServiceBeforeGetDatasetData(aSender: TObject;
|
||
const aDataset: IDADataset; const aIncludeSchema: Boolean;
|
||
const aMaxRecords: Integer);
|
||
private
|
||
protected
|
||
function DarTiendaUsuario(const ID_EMPRESA: Integer; const ID_USUARIO: Integer): Integer;
|
||
function DarNombre(const ID_EMPRESA: Integer): AnsiString;
|
||
function DarListaFormasPago: Binary;
|
||
function DarListaTiposIVA: Binary;
|
||
end;
|
||
|
||
implementation
|
||
|
||
{$R *.dfm}
|
||
uses
|
||
{Generated:} FactuGES_Invk, uDataModuleServer, uRORemoteDataModule,
|
||
uDatabaseUtils, Dialogs, Variants, uROStreamSerializer, uROBinaryHelpers,
|
||
uSesionesUtils, schEmpresasClient_Intf, uUsersManager,
|
||
uRestriccionesUsuarioUtils, srvFormasPago_Impl, srvTiposIva_Impl;
|
||
|
||
procedure Create_srvEmpresas(out anInstance : IUnknown);
|
||
begin
|
||
anInstance := TsrvEmpresas.Create(NIL);
|
||
end;
|
||
|
||
{ srvEmpresas }
|
||
procedure TsrvEmpresas.DARemoteServiceCreate(Sender: TObject);
|
||
begin
|
||
//SessionManager := dmServer.SessionManager;
|
||
end;
|
||
|
||
function TsrvEmpresas.DarListaFormasPago: Binary;
|
||
var
|
||
AFormasPagoServer : TsrvFormasPago;
|
||
begin
|
||
AFormasPagoServer := TsrvFormasPago.Create(nil);
|
||
try
|
||
Result := AFormasPagoServer.DarListaFormasPago;
|
||
finally
|
||
FreeAndNIL(AFormasPagoServer);
|
||
end;
|
||
end;
|
||
|
||
function TsrvEmpresas.DarListaTiposIVA: Binary;
|
||
var
|
||
ATiposIVAServer : TsrvTiposIVA;
|
||
begin
|
||
ATiposIVAServer := TsrvTiposIVA.Create(nil);
|
||
try
|
||
Result := ATiposIVAServer.DarListaTiposIVA;
|
||
finally
|
||
FreeAndNIL(ATiposIVAServer);
|
||
end;
|
||
end;
|
||
|
||
function TsrvEmpresas.DarNombre(const ID_EMPRESA: Integer): AnsiString;
|
||
var
|
||
ADataSet : IDADataset;
|
||
begin
|
||
try
|
||
ADataSet := schEmpresas.NewDataset(Connection, 'DarNombre', ['ID_EMPRESA'], [ID_EMPRESA]);
|
||
ADataSet.Open;
|
||
if ADataSet.Dataset.RecordCount > 0 then
|
||
Result := ADataSet.Dataset.Fields[0].AsString
|
||
else
|
||
Result := 'NO EXISTE'
|
||
finally
|
||
ADataSet.Close;
|
||
end;
|
||
end;
|
||
|
||
function TsrvEmpresas.DarTiendaUsuario(const ID_EMPRESA, ID_USUARIO: Integer): Integer;
|
||
var
|
||
AContactosService : IsrvContactos;
|
||
Intf : IInterface;
|
||
begin
|
||
GetClassFactory('srvContactos').CreateInstance(ClientID, Intf);
|
||
AContactosService := Intf as IsrvContactos;
|
||
Result := AContactosService.DarTiendaDeUsuario(ID_EMPRESA, ID_USUARIO)
|
||
end;
|
||
|
||
procedure TsrvEmpresas.DataAbstractServiceBeforeAcquireConnection(
|
||
aSender: TObject; var aConnectionName: string);
|
||
begin
|
||
ConnectionName := dmServer.ConnectionName;
|
||
end;
|
||
|
||
procedure TsrvEmpresas.DataAbstractServiceBeforeGetDatasetData(aSender: TObject;
|
||
const aDataset: IDADataset; const aIncludeSchema: Boolean;
|
||
const aMaxRecords: Integer);
|
||
begin
|
||
Exit;
|
||
if (aDataset.Name <> nme_EmpresasDatosBanco) then
|
||
begin
|
||
{ Aqu<71> se asegura que el usuario s<>lo accede a las empresas a
|
||
las que tiene permiso para acceder filtrando DataSet por ID_EMPRESA. }
|
||
FiltrarAccesoUsuario(Session, Connection, ServiceSchema, aDataset, fld_EmpresasID);
|
||
end;
|
||
end;
|
||
|
||
initialization
|
||
TROClassFactory.Create('srvEmpresas', Create_srvEmpresas, TsrvEmpresas_Invoker);
|
||
|
||
finalization
|
||
|
||
end.
|