forked from IntuitDeveloper/SampleApp-QuickBooksV3API-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (66 loc) · 3.08 KB
/
index.html
File metadata and controls
75 lines (66 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{% block body %}
<h2>Python Sample App</h2>
<script>
function hover(element) {
element.setAttribute('src', "{{ url_for('static', filename='C2QB_green_btn_lg_hover.png') }}");
}
function unhover(element) {
element.setAttribute('src', "{{ url_for('static', filename='C2QB_green_btn_lg_default.png') }}");
}
</script>
<!-- OAuth1 Apps only: Uncomment the following code to see Connect to Quickbooks button using Intuit's javascript -->
<!-- <script src="https://js.appcenter.intuit.com/Content/IA/intuit.ipp.anywhere-1.3.3.js" type="text/javascript"></script>
<script type="text/javascript">
intuit.ipp.anywhere.setup({
grantUrl: 'http://localhost:5000/auth',
datasources: {
quickbooks : true,
payments : false
}
});
</script>
<ipp:connectToIntuit></ipp:connectToIntuit> -->
{% if session['is_authorized'] == True %}
<button type="submit" onClick="location.href = 'http://localhost:5000/reset-session';" >Reset Session</button>
<button type="submit" onClick="location.href = 'http://localhost:5000/company-info';" >Get Company Info</button>
{% if company_info %}
<p>{{ company_info }}</p>
{% endif %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul>
{% for message in messages %}
<li style="background-color:#E6E6FA;">{{ message[1] }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<h3>Potential Customers from Leads.xlsx</h3>
<form action="/" method="post">
<table>
<tr style="font-weight:bold">
<td width="20%">No.</td>
<td width="20%">ID</td>
<td width="20%">Full Name</td>
<td width="20%">Phone</td>
<td width="20%">Email</td>
<td width="20%"></td>
</tr>
{% for customer in customer_dict %}
<tr>
<td width="20%">{{ loop.index }}</td>
<td width="20%">{{ customer['Id'] }}
{% set req_id = customer['Id'] %}</td>
<td width="20%">{{ customer['Full Name'] }}</td>
<td width="20%">{{ customer['Phone'] }}</td>
<td width="20%">{{ customer['Email'] }}</td>
<td><button type="submit" name="id" value="{{ req_id }}" onclick="{{ url_for('update_table') }}">Add as a Customer</button></td>
</tr>
{% endfor %}
</table>
</form>
{% else %}
<h4>Hi, welcome to Intuit Developer's Python Flask app. This app adds customer from Excel file to QBO and also shows how to get CompanyInfo of the connected QBO account. This app can be used with both OAuth1 and OAuth2. Don't forget to add your app's token in config file.</h4>
<a href="{{ url_for('auth') }}"><img id="my-img" src="{{ url_for('static', filename='C2QB_green_btn_lg_default.png') }}" onmouseover="hover(this);" onmouseout="unhover(this);" width=170 height=50/></a>
{% endif %}
{% endblock %}