As already mentioned in one of the former chapters - the invoices that need to be validated usually arrive attached as PDF file to emails or as postal letters which need to be scanned afterwards.
To enhance the described scenario with own invoices - different from the 3 provided sample invoices - the following steps are necessary:
- Store the PDF invoice file in your Object Store of choice. Say, you use Amazon S3 (as in this sample), you can store it e.g., via
the AWS CLI. Any credentials required to be authorized to store the PDF, you can find in the service key
of your Object Store service instance. Alternatively, if you don't want to use the CLI, copy your custom invoices to
api/srv/samples
. As naming schema we use 'INVOICEID.pdf'. From here the files will be uploaded automatically to the bucket on server startup. Copy the keys (the file names) under which you stored the PDFs - we will need them in the next step. - Add each invoice's metadata to the DOX_INVOICE table in SAP HANA Cloud. For that you can store the metadata as a new row first in the
dox-Invoices.csv
and deploy the changes in the next step. Additionally, add a new entry todox-FlowStatuses.csv
; it represents the initial workflow status of the new invoice. - Deploy the changes you have made to the CSV files to HANA with
npm run deploy
(from inside theapi/
folder): Your changes should be reflected now in the
DOX_INVOICES, DOX_FLOWSTATUSES HANA tables.