Basically we just need a new doctype field that would be similar to the “attach” field (a button)…
- Button would say “Sign Document”
- User would be prompted in a modal popup for their credentials (signed in user) [SIGN] button to submit.
- Optional doc.esigned.$username.reason field (for short reason they are signing)
- Upon successfully passing username/password in the modal…
*ENTRY in the ACTIVITY log for the document “ELECTRONICALLY SIGNED BY $USERNAME ON $TIMESTAMP, REASON: $REASON”
Where to store the electronic signatures?
Keeping them safe from modification/deletion from all users, including admin, is important.
option1: store the signatures in a read-only json array doctype field of the doc itself?
option2: create a new doctype for “Electronic Signatures” that is create-only, with fields:
USERNAME | TIMESTAMP | DOCTYPE SIGNED | DOC SIGNED | REASON
Something like that anyway. Option #2 is probably best.
If you can add a password-prompted “electronic signature” field like this to doctypes, then things like finance and quality/inspection doctypes will go a long way for users of ERPNEXT