Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Backend Database MSSQL 2012 ( newer version will be used, but must be compatible with

2012)
Invoices will be uploaded to Parisio https://help.parsio.io/public-api/parsio-public-api
Parsed data will be retrieved via webhooks https://docs.webhook.site/

Prefix of “sp” indicated SQL stored procedure

Variables stored in conf file ( encrypted)


- Margsql server address:
- sql server name
- sql server password
- sql server database

Variables stored in sql database


- Parsio mailbox id
- Parsio API KEY
- Pariso_signing_secret
- web_hooks_url
- webhooks_api_key

##############################################
###
New Document
##############################################
###

Upload Document Box


—-------------------------------------------------------------------------------------------------

Uploaded new Document


- Select a vendor from spGetVendors( ) , returns list of vendor_no, vendor_name
- use a drag and drop box or select button to pick Document for upload.
- uploaded file uploadDoc( filename, vendor_no, vendor_name) returns doc_id
- Save Document spInsertDoc( vendor_no, filename, doc_id )
List Documents with Upload and Processed Status Box
—-------------------------------------------------------------------------------------------------

Get Document list


- get uploaded Documents spGetDocWithStatus(1)
- get processed Documents spGetDocWithStatus(2)

Document table list


Columns:
Vendor: vendor_name
File Name: filename
Status: 1 = upload
2 = processed
Action: if status = 1, display refresh button
if status =2 , display import button,
Delete : check boxes
Footer Buttons
Refresh All Button
Delete Button

Button Functionality
Refresh Button: Get status of single document getDocStatus( doc_id )
Refresh All: for get all document with status = uploaded do getDocStatus(
doc_id )
Delete Button: deletes selected Documents spDeleteDoc( doc_id )
Import Button:
Get json from webhooks, and pars into 2 arrays. Header and Items
getDoc(doc_id) – doc.header[] , doc.items[]
Store Header Array into AI_DocHeader. spInsertDocHeader( doc_id,
vendor_no, InvoiceID, invoice_total, AmountDue_amount )
Store Item Array into AI_DocHeader.spInsertDocDetail ( doc_id, Description,
ProductCode, Quantity, UnitPrice_Amount, )
Update Document status spUpdateDocStatus( doc_id, 3)

##############################################
###
Review Documents
##############################################
###
List Documents
---------------------------------------------------------------------------------------------------------
Get Document list
get uploaded Documents spGetDocWithStatus(3)

Document table list


Columns:
Vendor: vendor_name
Doc ID: doc_id
File Name: filename
Invoice#: InvoiceID
Action: Review Button
Delete : check boxes
Footer Buttons
Delete Button

Button Functionality
Delete Button: deletes selected Documents spDeleteDoc( doc_id )
Review Button:
Get DocHeader using doc_id spGetDocHeader( doc_id )
Get DocItems using doc_id spGetMatchDocDetail( doc_id )
Open up Document Review Window

Document review
---------------------------------------------------------------------------------------------------------
Header information comes from data returned by spGetDocHeader( doc_id )
Table information comes from data returned by spGetDocHeader( doc_id )

Document Review Header


Vendor: vendor_name
Doc ID: doc_id
File Name: filename
Invoice#: InvoiceID

Document Review table


Variables
Unmatched: Set Unmatched = 0 for all items
Columns:
Doc LineNumber: Items are arranged by LineNumber Ascending
Doc Description: doc_Description view only
Doc Item Code: doc_ProductCode view only
Doc Quantity: doc_Quantity view only
POS Description: pos_Description Searchable Field if match =
0 or Unmatched = 1
POS ItemCode: pos_ItemCode Searchable Field if match =
0 or Unmatched = 1
UPC: upc Searchable Field if match =
0 or Unmatched = 1
Matched by:
None: match = 0, no match found
Description: match = 1 , matched using
doc_Description & vendor_no highlight
orange
Item Code: match = 2 ,matched using
doc_ProductCode & vendor_no highlight green
Description Change:
yes if change_detected = 1 highlight entire
line in yellow
Vendors will recycle ItemCodes for new products
this detects Description changes
Action:
if match = 0 or Unmatched = 1, then display Save
Match button
if match = 1 or Unmatched = 1, then display Save
Match button
If match = 2 and Unmatched = 0 , then display
Unmatch button

Delete : check box

Footer Buttons
Convert to Invoice Button
Delete Button

Button Functionality
Delete Button: deletes selected Items spDeleteItem( doc_id, LineNumber )
Unmatch button: sets Unmatched = 1 for item
Save Match:
spSaveMatchProduct( doc_Description,
doc_ProductCode,pos_ItemCode, upc, vendor_no)
Set Unmatched = 0 for item
Refresh product data spGetMatchProduct(doc_Description,
doc_ProductCode,vendor_no)
Convert to Invoice:
Only allow to select if all items have a match > 0
Save header data to AI_POHeader
spInsertInvoiceHeader( doc_id, vendor_no, InvoiceID, invoice_total,
AmountDue_amount )
Save items to AI_PODetails spInsertInvoiceDetail( doc_id,
Description, ProductCode, Quantity, UnitPrice_Amount)
Update Document status spUpdateDocStatus( doc_id, 4)

##############################################
###
Review Invoices
##############################################
###
List Invoices
---------------------------------------------------------------------------------------------------------
Get Document list
get uploaded Documents spGetDocWithStatus(4)

Document table list


Columns:
Vendor: vendor_name
Doc ID: doc_id
File Name: filename
Invoice#: InvoiceID
Action: Review Button
Delete : check boxes
Footer Buttons
Delete Button

Button Functionality
Delete Button: deletes selected Documents spDeleteDoc( doc_id )
Review Button:
Get Invoice Header using doc_id spGetInvoiceHeader( doc_id )
Get Invoice items using doc_id spGetInvoiceDetail( doc_id )
Open up Invoice Review Window

Invoice review
---------------------------------------------------------------------------------------------------------
Header information comes from data returned by spGetInvoiceHeader( doc_id )
Table information comes from data returned by spGetInvoiceDetail( doc_id )

Invoice Review Header


Vendor: vendor_name
Doc ID: doc_id
Inv Date InvoiceDate
Invoice#: InvoiceID
Invoice Total: invoice_total
Amount Due: AmountDue_amount
Pieces: pieces
Add Item
UPC: SEARCH FIELD, USED TO ADD MORE ITEMS TO
INVOICE
ITEM CODE: SEARCH FIELD, USED TO ADD MORE ITEMS TO
INVOICE
Description: Only used with a search field , displays description of item
found.
Case Pack readonly

Purchase Type Drop down list 1 - Received


2 - Free
3 - Returned
QTY Received Number of Cases received

Invoice Review Table


Columns read only
LineNumber: Items are arranged by LineNumber Ascending
UPC: UPC
Description: Description
Item Code: ProductCode
Columns Editable:
Case Qty: case_qty
Columns with 2 rows Notes: Top row, Can edit most items New pricing
will be applied after the invoice is completed.
Bottom row, view only, Current pricing,
margin etc for item
Case Pack: top: Pack example if pack =12 , the display
12 / Case
Bottom pos_vendor_Pack ( this is the # of items
per case last time from vendor)
Case Cost: top : case_cost
bottom: pos_vendor_case_cost
Cost: top cost (view only)
Bottom pos_cost (view only) ( this can be different
from if calculated from vendor case cost.
This is the last
price paid to any
vendor)

Margin: top calculated using cost and normal price


or group price (view only)
Bottom calculate margin (view only) ( calculate
1-current_cost/current_normal_price)
If pricing
method = 2 ( 1 - current_cost / current_normal_price / Current_group_price )

Pricing Method top pricing_method Drop Down list


- 1 normal price

- 2 split package

- 3 group price adjusted

- 4 grouprice_quantity
Bottom: pos_pricing_method

Price Top normal_price ( cannot be edited if


pricing methods = 2)
Bottom pos_normal_price

Group QTY Top normal_qty ( cannot be edited if


pricing methods = 1)
Bottom pos_group_qty

Group Price Top group_price ( cannot be edited if pricing


methods = 1)
Bottom pos_group_price

Columns back to single rows


Total: calculate case cost x cast qty ( read only)
Action any changes made to item, display save changes box

Footer
Save Save any changes made to Invoice
spUpdateInvoiceheader(doc_id,InvoiceDate,
InvoiceID,invoice_total, AmountDue_amount, pieces)
spUpdateInvoiceDetail(doc_id,UPC,case_qty,Pack ,case_cost
,pricing_method,normal_price,normal_qty,normal_grouppricenorma
l_qty)

Save and Import


Save any changes made to Invoice
spUpdateInvoiceheader(doc_id,InvoiceDate,
InvoiceID,invoice_total, AmountDue_amount, pieces)
spUpdateInvoiceDetail(doc_id,UPC,case_Quantity,Pac
k ,case_cost,new_pricing_method,new_normal_price,new_no
rmal_qty ,new_normal_groupprice)
Import Invoice into Point of Sale
spImportInvoicePos (doc_id)
Update Document status spUpdateDocStatus( doc_id, 5)
OPEN PRICE BATCH AND LABEL BATCH WINDOW

##############################################
###
Price and Label Batches
##############################################
###
List Imported invoices
---------------------------------------------------------------------------------------------------------
Get Document list
get uploaded Documents spGetDocWithStatus(5)

Document table list


Columns:
Vendor: vendor_name
Doc ID: doc_id
Invoice#: InvoiceID
Labels : Print Labels button
Price Change: Apply Price Change button
Archive: check box
Footer
Archive Button archive selected files spGetDocWithStatus(6)

Button
Apply Price Change button - small pop up window
Doc ID: doc_id
Invoice#: InvoiceID
Apply Price change: check box - Immediately
Check box - Select date
Date box Choose date - default date is next day
Save button -> spPriceChangeBatch(doc_id,when,date)

Print Labels button print labels with bartender


spCreateBartenderLabels(doc_id)

##############################################
###
Archived Invoices
##############################################
###
List Archived invoices
---------------------------------------------------------------------------------------------------------
Get Document list
get uploaded Documents spGetDocWithStatus(6)

Document table list


Columns:
Vendor: vendor_name
Doc ID: doc_id
File Name: filename
Invoice#: InvoiceID
Clicking on invoice # will open a window with the raw sql data from
spGetInvoiceHeader(
doc_id )
spGetInvoiceDetail( doc_id
)

You might also like