To create a new parser:

  1. Login to DocParser.com using the username [email protected]
  2. Click "Create New Parser"
  3. Click "Start with a Blank Template"
  4. Enter the Manufacturer Name and click Continue
  5. Drag a PDF with sample invoices onto the "Upload Documents" page and click Continue
  6. Close any tutorial pop-ups (like "congratulations...blah blah blah")
  7. Go down to Parser Settings on the left. Then, choose "Preprocessing" near the top left.
  8. Scroll down to "Split Documents When Importing" and choose "When RegEx pattern changes"
  9. Regex patterns are not something I can teach in this tutorial, but I reccomend using regex101.com to test your expression:
  10. When you have the expression set in DocParser, click Save Settings.
  11. Test your pre-processing rule by deleting the current file and re-uploading your PDF (see step 5 above)
  12. Then, click continue and wait for your file to be imported and processed. It might take a minute or two, but if it never shows up, then your regex is probably bad.
  13. Once it has correctly split your PDF into a single document per invoice, go to Rules on the left:
  14. Click "Create First Parsing Rule"
  15. The Rules we need to have are Invoice Number, Invoice Date, Totals, and Invoices Lines. So, scroll down to "Invoices" and add Invoice Number:
  16. If you are lucky, the system already knows how to find the invoice number and you can just click "Save Parsing Rule." If the final result is not the correct invoice number, then you will have to manipulate it with filters until it is correct (not done in this tutorial).
  17. Click "Add New Rule" and add Invoice Date the same way.
  18. When adding the Totals, make sure Net is set to the sub-total, Tax is set to Tax, "carriage" is set to Shipping, and Total is set to the Final/Grand Total.
  19. When adding Line Items, you will need to put the white box around the area of the pages that Invoice Lines appear. Then you have to add the column separators. It will start with some that you can drag to the right position, but to add more, you can click the white and red plus symbol on the right side.
  20. Verify that the data got pulled correctly. In the above example, the last column was grabbing one of the digits from the previous column. In this particular case, since they are soooo close to each other, I am going to have it ignore the last column and then process the column to remove any letters.

    After removing the separator between col9 and col10 and then adding a filter that removes the letters:
  21. You will notice, there where "Tariff Codes" on a second line below List Price. There is a way to get that kind of data into its own column, but we do not need Tariff Code, so it is perfectly fine that DocParser ignored it.
  22. If the ASCO PO number is not on every line, we need to add a separate field. So, create another rule and choose PO Number. Then, name that field CustomerPurchaseOrder.
  23. Now, we need to go into ERP and set it up to receive the invoices. The first session needed is "AP Automation Parameters" (xiext4106m000). Add a line and fill in the details for the manufacturer and BP.
  24. On the left, click Integrations and go to the very bottom and choose "Advanced Webhook" under "Custom Integrations"
  25. Next, we need to create some parameters in "External-ERP Business Partner Mapping" (xicom0116m000). Just make these up for the BP you are parsing. We will use them later:
  26. Fill out the details as below:
    • Name: ERP PROD WEBHOOK
    • HTTP Verb: POST
    • Target URL: https://erpintegration.ascoeq.com:6443/ERPIntegrator.svc/e-Emphasys/ERPIntegrator/APAUTO?Param1=HITACHI&Param2=PARTS
      Replace "HITACHI" (above) with the parameter you setup in step 25 above.
    • Content Type: XML (Encoded)
    • Repeating Data Behavior: One request per document
    • Additional Headers: (blank)
    • HTTP Body Payload Template:
      <?xml version="1.0" encoding="UTF-8"?>
      <Document>
          <Id>{{Id}}</Id>
          <DocumentId>{{DocumentId}}</DocumentId>
          <RemoteId>{{RemoteId}}</RemoteId>
          <FileName>{{FileName}}</FileName>
          <MediaLink>{{MediaLink}}</MediaLink>
          <MediaLinkOriginal>{{MediaLinkOriginal}}</MediaLinkOriginal>
          <MediaLinkData>{{MediaLinkData}}</MediaLinkData>
          <UploadedAt>{{UploadedAt}}</UploadedAt>
          <ProcessedAt>{{ProcessedAt}}</ProcessedAt>
          <InvoiceNumber>{{InvoiceNumber}}</InvoiceNumber>
          <InvoiceDate>{{InvoiceDate.iso8601}}</InvoiceDate>
          <Totals>
              <net>{{Totals.net}}</net>
              <total>{{Totals.total}}</total>
          </Totals>
          <CustomerPurchaseOrder>{{CustomerPurchaseOrder}}</CustomerPurchaseOrder>
          <InvoiceLines>
              {{#each InvoiceLines}}
              <InvoiceLine>
                  <Pos>{{@index}}</Pos>
                  <CustomerPurchaseLine>{{CustomerPurchaseLine}}</CustomerPurchaseLine>
                  <Partnumber>{{Partnumber}}</Partnumber>
                  <Description>{{Description}}</Description>
                  <Quantity>{{Quantity}}</Quantity>
                  <UnitPrice>{{UnitPrice}}</UnitPrice>
                  <Total>{{Total}}</Total>
              </InvoiceLine>
              {{/each}}
          </InvoiceLines>
      </Document>            

  27. Now you can test the parser. You can either add the documents that you have already created to the Parsing Queue and then the Integration Queue, or you can go to settings and then email to find an email address that invoices can be sent to.