|
2 | 2 | from os import path |
3 | 3 |
|
4 | 4 | from docusign_esign import EnvelopesApi, EnvelopeDefinition, Document, Signer, SignHere, Tabs, Recipients, \ |
5 | | - CustomFields, TextCustomField, Text, RecipientViewRequest |
| 5 | + Numerical, LocalePolicyTab, CustomFields, TextCustomField, Text, RecipientViewRequest |
6 | 6 | from flask import current_app as app, session, url_for, request |
7 | 7 |
|
8 | 8 | from ...consts import demo_docs_path, authentication_method, signer_client_id, pattern |
@@ -128,32 +128,43 @@ def make_envelope(cls, args): |
128 | 128 | bold="true", value=args["signer_name"], |
129 | 129 | locked="false", tab_id="familar_name", |
130 | 130 | tab_label="Familiar name") |
| 131 | + |
| 132 | + locale_policy_tab = LocalePolicyTab( |
| 133 | + culture_name="en-US", |
| 134 | + currency_code="usd", |
| 135 | + currency_positive_format="csym_1_comma_234_comma_567_period_89", |
| 136 | + currency_negative_format="minus_csym_1_comma_234_comma_567_period_89", |
| 137 | + use_long_currency_format="true" |
| 138 | + ) |
131 | 139 |
|
132 | | - salary = 123000 |
133 | | - |
134 | | - text_salary = Text( |
135 | | - anchor_string="/salary/", |
136 | | - anchor_units="pixels", |
137 | | - anchor_y_offset="-9", |
138 | | - anchor_x_offset="5", |
| 140 | + numerical_salary = Numerical( |
| 141 | + page_number="1", |
| 142 | + document_id="1", |
| 143 | + x_position="210", |
| 144 | + y_position="235", |
| 145 | + validation_type="Currency", |
139 | 146 | font="helvetica", |
140 | 147 | font_size="size11", |
141 | 148 | bold="true", |
142 | | - value="${:.2f}".format(salary), |
143 | | - locked="true", |
| 149 | + locked="false", |
| 150 | + height="23", |
144 | 151 | tab_id="salary", |
145 | | - tab_label="Salary") |
| 152 | + tab_label="Salary", |
| 153 | + numerical_value="123000", |
| 154 | + locale_policy=locale_policy_tab |
| 155 | + |
| 156 | + ) |
146 | 157 |
|
147 | 158 | salary_custom_field = TextCustomField( |
148 | 159 | name="salary", |
149 | 160 | required="false", |
150 | 161 | show="true", # Yes, include in the CoC |
151 | | - value=str(salary) |
| 162 | + value=str(123000) |
152 | 163 | ) |
153 | 164 | cf = CustomFields(text_custom_fields=[salary_custom_field]) |
154 | 165 | # Add the tabs model (including the SignHere tab) to the signer |
155 | 166 | # The Tabs object wants arrays of the different field/tab types |
156 | | - signer.tabs = Tabs(sign_here_tabs=[sign_here], text_tabs=[text_legal, text_familar, text_salary]) |
| 167 | + signer.tabs = Tabs(sign_here_tabs=[sign_here], text_tabs=[text_legal, text_familar], numerical_tabs=[numerical_salary]) |
157 | 168 |
|
158 | 169 | # Create the top level envelope definition and populate it |
159 | 170 | envelope_definition = EnvelopeDefinition( |
|
0 commit comments