Input

698 of 32000

Output

-- 
-- Generated by MRX on 16.10.2018 18:54:58 using Quick PL/SQL
-- 
-- 
-- Number of generated packages: 2
-- 

create or replace package invoice_pkg
as

  /*
  
  Purpose:    package handles accounting and invoices
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- create new invoice
  function new_invoice (p_invoice_type in varchar2,
                        p_due_date in date := null) return number;

  function get_invoice (p_invoice_id in number) return invoice%rowtype;

  procedure delete_invoice (p_invoice_id in number);

  function get_due_date (p_invoice_id in number) return date;


end invoice_pkg;
/


create or replace package body invoice_pkg
as

  /*
  
  Purpose:    package handles accounting and invoices
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

function new_invoice (p_invoice_type in varchar2,
                      p_due_date in date := null) return number
as
  l_returnvalue number;
begin

  /*
  
  Purpose:    create new invoice
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

  return l_returnvalue;

end new_invoice;


function get_invoice (p_invoice_id in number) return invoice%rowtype
as
  l_returnvalue invoice%rowtype;
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  begin
    select *
    into l_returnvalue
    from invoice
    where id = p_id;
  exception
    when no_data_found then
      l_returnvalue := null;
  end;

  return l_returnvalue;

end get_invoice;


procedure validate_invoice (p_invoice_id in number)
as
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

end validate_invoice;


procedure delete_invoice (p_invoice_id in number)
as
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

end delete_invoice;


function get_due_date (p_invoice_id in number) return date
as
  l_returnvalue date;
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

  return l_returnvalue;

end get_due_date;



end invoice_pkg;
/


create or replace package pdf_builder_pkg
as

  /*
  
  Purpose:    package generates PDFs
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- specify using A4, A3, etc
  procedure set_page_size (p_page_size in varchar2);

  procedure set_page_orientation (p_orientation in varchar2);

  procedure set_doc_info (p_author in varchar2,
                          p_company in varchar2);

  -- get the PDF as clob
  function get_pdf () return clob;


end pdf_builder_pkg;
/


create or replace package body pdf_builder_pkg
as

  /*
  
  Purpose:    package generates PDFs
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

procedure set_page_size (p_page_size in varchar2)
as
begin

  /*
  
  Purpose:    specify using A4, A3, etc
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

end set_page_size;


procedure set_page_orientation (p_orientation in varchar2)
as
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

end set_page_orientation;


procedure set_doc_info (p_author in varchar2,
                        p_company in varchar2)
as
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

end set_doc_info;


function get_pdf () return clob
as
  l_returnvalue clob;
begin

  /*
  
  Purpose:    get the PDF as clob
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  -- TODO: add your own magic here...
  null;

  return l_returnvalue;

end get_pdf;


procedure init_output ()
as
  l_scope  logger_logs.scope%type := lower($$plsql_unit) || '.' || 'init_output';
  l_params logger.tab_param;
begin

  /*
  
  Purpose:    
  
  Remarks:    
  
  Date        Who  Description
  ----------  ---  -------------------------------------
  16.10.2018  MRX  Created

  */

  logger.log('START', l_scope, null, l_params);

  -- TODO: add your own magic here...
  null;

  logger.log('END', l_scope);

exception
  when others then
    logger.log_error('Unhandled Exception', l_scope, null, l_params);
    raise;

end init_output;



end pdf_builder_pkg;
/