Skip to content

Commit 1f639ab

Browse files
Add formula tabs to responsive signing (#134)
* added tabs * fix linter issue * fixing codeDepot marker --------- Co-authored-by: Paige Rossi <paige.rossi@docusign.com>
1 parent 724e326 commit 1f639ab

File tree

2 files changed

+64
-6
lines changed

2 files changed

+64
-6
lines changed

app/eSignature/examples/eg038_responsive_signing.py

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
CarbonCopy,
99
EnvelopeDefinition,
1010
Recipients,
11-
DocumentHtmlDefinition
11+
DocumentHtmlDefinition,
12+
FormulaTab,
13+
Tabs
1214
)
1315
from flask import session, url_for, request
1416

@@ -107,6 +109,60 @@ def make_envelope(cls, args):
107109
document_id=1 # a label used to reference the doc
108110
)
109111

112+
price_1 = 5
113+
formula_tab_1 = FormulaTab(
114+
font="helvetica",
115+
font_size="size11",
116+
font_color="black",
117+
anchor_string="/l1e/",
118+
anchor_y_offset="-8",
119+
anchor_units="pixels",
120+
anchor_x_offset="105",
121+
tab_label="l1e",
122+
formula=f"[l1q] * {price_1}",
123+
round_decimal_places="0",
124+
required="true",
125+
locked="true",
126+
disable_auto_size="false"
127+
)
128+
129+
price_2 = 150
130+
formula_tab_2 = FormulaTab(
131+
font="helvetica",
132+
font_size="size11",
133+
font_color="black",
134+
anchor_string="/l2e/",
135+
anchor_y_offset="-8",
136+
anchor_units="pixels",
137+
anchor_x_offset="105",
138+
tab_label="l2e",
139+
formula=f"[l2q] * {price_2}",
140+
round_decimal_places="0",
141+
required="true",
142+
locked="true",
143+
disable_auto_size="false"
144+
)
145+
146+
formula_tab_3 = FormulaTab(
147+
font="helvetica",
148+
font_size="size11",
149+
font_color="black",
150+
anchor_string="/l3t/",
151+
anchor_y_offset="-8",
152+
anchor_units="pixels",
153+
anchor_x_offset="105",
154+
tab_label="l3t",
155+
formula="[l1e] + [l2e]",
156+
round_decimal_places="0",
157+
required="true",
158+
locked="true",
159+
disable_auto_size="false"
160+
)
161+
162+
tabs = Tabs(
163+
formula_tabs=[formula_tab_1, formula_tab_2, formula_tab_3]
164+
)
165+
110166
# Create the signer recipient model
111167
signer = Signer(
112168
# The signer
@@ -116,7 +172,8 @@ def make_envelope(cls, args):
116172
routing_order="1",
117173
# Setting the client_user_id marks the signer as embedded
118174
client_user_id=args["signer_client_id"],
119-
role_name="Signer"
175+
role_name="Signer",
176+
tabs=tabs
120177
)
121178

122179
cc = CarbonCopy(
@@ -147,6 +204,7 @@ def get_html_content(cls, args):
147204
.replace("{cc_name}", args["cc_name"]) \
148205
.replace("{cc_email}", args["cc_email"]) \
149206
.replace("/sn1/", "<ds-signature data-ds-role=\"Signer\"/>") \
150-
.replace("/l1q/", "<input data-ds-type=\"number\"/>") \
151-
.replace("/l2q/", "<input data-ds-type=\"number\"/>")
152-
#ds-snippet-end:eSign38Step2
207+
.replace("/l1q/", "<input data-ds-type=\"number\" name=\"l1q\"/>") \
208+
.replace("/l2q/", "<input data-ds-type=\"number\" name=\"l2q\"/>")
209+
210+
#ds-snippet-end:eSign38Step2

app/eSignature/examples/eg041_cfr_embedded_signing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@ def get_workflow(args):
173173
except ApiException as err:
174174
return process_error(err)
175175

176-
#ds-snippet-end:eSign41Step2
176+
#ds-snippet-end:eSign41Step2

0 commit comments

Comments
 (0)