1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="{$charset}" />
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7 <title>{$companyname} - {$pagetitle}</title>
8
9 <link href="{assetPath file='all.min.css'}?v={$versionHash}" rel="stylesheet">
10 <link href="{$WEB_ROOT}/assets/css/fontawesome-all.min.css" rel="stylesheet">
11 <link href="{assetPath file='invoice.css'}" rel="stylesheet">
12 <script>var whmcsBaseUrl = "{$WEB_ROOT}";</script>
13 <script src="{assetPath file='scripts.min.js'}?v={$versionHash}"></script>
14{include file="$template/includes/gtag.tpl"}
15</head>
16<body>
17
18 <div class="container-fluid invoice-container">
19
20 {if $invalidInvoiceIdRequested}
21
22 {include file="$template/includes/panel.tpl" type="danger" headerTitle=$LANG.error bodyContent=$LANG.invoiceserror bodyTextCenter=true}
23
24 {else}
25
26 <div class="row invoice-header">
27 <div class="invoice-col">
28
29
30 {if $logo}
31 <p><img src="{$logo}" title="{$companyname}" /></p>
32 {else}
33 <h2>{$companyname}</h2>
34 {/if}
35 <h3>{$pagetitle}</h3>
36
37 </div>
38 <div class="invoice-col text-center">
39
40 <div class="invoice-status">
41 {if $status eq "Draft"}
42 <span class="draft">{$LANG.invoicesdraft}</span>
43 {elseif $status eq "Unpaid"}
44 <span class="unpaid">{$LANG.invoicesunpaid}</span>
45 {elseif $status eq "Paid"}
46 <span class="paid">{$LANG.invoicespaid}</span>
47 {elseif $status eq "Refunded"}
48 <span class="refunded">{$LANG.invoicesrefunded}</span>
49 {elseif $status eq "Cancelled"}
50 <span class="cancelled">{$LANG.invoicescancelled}</span>
51 {elseif $status eq "Collections"}
52 <span class="collections">{$LANG.invoicescollections}</span>
53 {elseif $status eq "Payment Pending"}
54 <span class="paid">{$LANG.invoicesPaymentPending}</span>
55 {/if}
56 </div>
57
58 {if $status eq "Unpaid" || $status eq "Draft"}
59 <div class="small-text">
60 {$LANG.invoicesdatedue}: {$datedue}
61 </div>
62 <div class="payment-btn-container hidden-print" align="center">
63 {$paymentbutton}
64 </div>
65 {/if}
66
67 </div>
68 </div>
69
70 <hr>
71
72 {if $paymentSuccessAwaitingNotification}
73 {include file="$template/includes/panel.tpl" type="success" headerTitle=$LANG.success bodyContent=$LANG.invoicePaymentSuccessAwaitingNotify bodyTextCenter=true}
74 {elseif $paymentSuccess}
75 {include file="$template/includes/panel.tpl" type="success" headerTitle=$LANG.success bodyContent=$LANG.invoicepaymentsuccessconfirmation bodyTextCenter=true}
76 {elseif $paymentInititated}
77 {include file="$template/includes/panel.tpl" type="info" headerTitle=$LANG.success bodyContent=$LANG.invoicePaymentInitiated bodyTextCenter=true}
78 {elseif $pendingReview}
79 {include file="$template/includes/panel.tpl" type="info" headerTitle=$LANG.success bodyContent=$LANG.invoicepaymentpendingreview bodyTextCenter=true}
80 {elseif $paymentFailed}
81 {include file="$template/includes/panel.tpl" type="danger" headerTitle=$LANG.error bodyContent=$LANG.invoicepaymentfailedconfirmation bodyTextCenter=true}
82 {elseif $offlineReview}
83 {include file="$template/includes/panel.tpl" type="info" headerTitle=$LANG.success bodyContent=$LANG.invoiceofflinepaid bodyTextCenter=true}
84 {/if}
85
86 <div class="row">
87 <div class="invoice-col right">
88 <strong>{$LANG.invoicespayto}</strong>
89 <address class="small-text">
90 {$payto}
91 {if $taxCode}<br />{$taxIdLabel}: {$taxCode}{/if}
92 </address>
93 </div>
94 <div class="invoice-col">
95 <strong>{$LANG.invoicesinvoicedto}</strong>
96 <address class="small-text">
97 {if $clientsdetails.companyname}{$clientsdetails.companyname}<br />{/if}
98 {$clientsdetails.firstname} {$clientsdetails.lastname}<br />
99 {$clientsdetails.address1}, {$clientsdetails.address2}<br />
100 {$clientsdetails.city}, {$clientsdetails.state}, {$clientsdetails.postcode}<br />
101 {$clientsdetails.country}
102 {if $clientsdetails.tax_id}
103 <br />{$taxIdLabel}: {$clientsdetails.tax_id}
104 {/if}
105 {if $customfields}
106 <br /><br />
107 {foreach from=$customfields item=customfield}
108 {$customfield.fieldname}: {$customfield.value}<br />
109 {/foreach}
110 {/if}
111 </address>
112 </div>
113 </div>
114
115 <div class="row">
116 <div class="invoice-col right">
117 <strong>{$LANG.paymentmethod}</strong><br>
118 <span class="small-text" data-role="paymethod-info">
119 {if $status eq "Unpaid" && $allowchangegateway}
120 <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}" class="form-inline">
121 {$gatewaydropdown}
122 </form>
123 {else}
124 {$paymentmethod}{if $paymethoddisplayname} ({$paymethoddisplayname}){/if}
125 {/if}
126 </span>
127 <br /><br />
128 </div>
129 <div class="invoice-col">
130 <strong>{$LANG.invoicesdatecreated}</strong><br>
131 <span class="small-text">
132 {$date}<br><br>
133 </span>
134 </div>
135 </div>
136{if $hasCreditCard && $userDisableCC == 1 && $userDisableCC_viewinvoice == 1}
137{if $disableCCMessage}
138 <div class="success-message">{$disableCCMessage}</div>
139 {/if}
140<form method="POST" action="update_disablecc.php" id="autocc_form">
141 <div class="form-group">
142 <label for="disablecc">Do you want recuring payments?</label><br>
143
144 <!-- Yes/No radio buttons -->
145 <label>
146 <input type="radio" name="disableCC" value="0" required> Yes
147 </label>
148 <label>
149 <input type="radio" name="disableCC" value="1" > No
150 </label>
151 </div>
152<button type="submit" class="btn btn-primary">Update</button>
153
154
155
156
157</form>
158 <script>
159 document.addEventListener('DOMContentLoaded', function() {
160 var payNowButton = document.getElementById('btnPayNow'); // "Pay Now" button ID
161 var form = document.getElementById('autocc_form');
162 var isFormSubmitted = false;
163 form.addEventListener('submit', function() {
164 isFormSubmitted = true;
165 });
166
167 payNowButton.addEventListener('click', function(event) {
168 // Check if a radio button is selected
169 if (!form.querySelector('input[name="disableCC"]:checked')) {
170 alert('Please select whether to enable or disable Auto Credit Card Charge before proceeding with the payment.');
171 event.preventDefault(); // Prevent the "Pay Now" button from proceeding
172 }
173
174 });
175 });
176 </script>
177{/if}
178
179 <br />
180
181 {if $manualapplycredit}
182 <div class="panel panel-success">
183 <div class="panel-heading">
184 <h3 class="panel-title"><strong>{$LANG.invoiceaddcreditapply}</strong></h3>
185 </div>
186 <div class="panel-body">
187 <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}">
188 <input type="hidden" name="applycredit" value="true" />
189 {$LANG.invoiceaddcreditdesc1} <strong>{$totalcredit}</strong>. {$LANG.invoiceaddcreditdesc2}. {$LANG.invoiceaddcreditamount}:
190 <div class="row">
191 <div class="col-xs-8 col-xs-offset-2 col-sm-4 col-sm-offset-4">
192 <div class="input-group">
193 <input type="text" name="creditamount" value="{$creditamount}" class="form-control" />
194 <span class="input-group-btn">
195 <input type="submit"
196 value="{$LANG.invoiceaddcreditapply}"
197 class="btn btn-success"
198 id="btnInvoiceAddCreditApply"
199 />
200 </span>
201 </div>
202 </div>
203 </div>
204 </form>
205 </div>
206 </div>
207 {/if}
208
209 {if $notes}
210 {include file="$template/includes/panel.tpl" type="info" headerTitle=$LANG.invoicesnotes bodyContent=$notes}
211 {/if}
212
213 <div class="panel panel-default">
214 <div class="panel-heading">
215 <h3 class="panel-title"><strong>{$LANG.invoicelineitems}</strong></h3>
216 </div>
217 <div class="panel-body">
218 <div class="table-responsive">
219 <table class="table table-condensed">
220 <thead>
221 <tr>
222 <td><strong>{$LANG.invoicesdescription}</strong></td>
223 <td width="20%" class="text-center"><strong>{$LANG.invoicesamount}</strong></td>
224 </tr>
225 </thead>
226 <tbody>
227 {foreach from=$invoiceitems item=item}
228 <tr>
229 <td>{$item.description}{if $item.taxed eq "true"} *{/if}</td>
230 <td class="text-center">{$item.amount}</td>
231 </tr>
232 {/foreach}
233 <tr>
234 <td class="total-row text-right"><strong>{$LANG.invoicessubtotal}</strong></td>
235 <td class="total-row text-center">{$subtotal}</td>
236 </tr>
237 {if $taxname}
238 <tr>
239 <td class="total-row text-right"><strong>{$taxrate}% {$taxname}</strong></td>
240 <td class="total-row text-center">{$tax}</td>
241 </tr>
242 {/if}
243 {if $taxname2}
244 <tr>
245 <td class="total-row text-right"><strong>{$taxrate2}% {$taxname2}</strong></td>
246 <td class="total-row text-center">{$tax2}</td>
247 </tr>
248 {/if}
249 <tr>
250 <td class="total-row text-right"><strong>{$LANG.invoicescredit}</strong></td>
251 <td class="total-row text-center">{$credit}</td>
252 </tr>
253 <tr>
254 <td class="total-row text-right"><strong>{$LANG.invoicestotal}</strong></td>
255 <td class="total-row text-center">{$total}</td>
256 </tr>
257 </tbody>
258 </table>
259 </div>
260 </div>
261 </div>
262
263 {if $taxrate}
264 <p>* {$LANG.invoicestaxindicator}</p>
265 {/if}
266
267 <div class="transactions-container small-text">
268 <div class="table-responsive">
269 <table class="table table-condensed">
270 <thead>
271 <tr>
272 <td class="text-center"><strong>{$LANG.invoicestransdate}</strong></td>
273 <td class="text-center"><strong>{$LANG.invoicestransgateway}</strong></td>
274 <td class="text-center"><strong>{$LANG.invoicestransid}</strong></td>
275 <td class="text-center"><strong>{$LANG.invoicestransamount}</strong></td>
276 </tr>
277 </thead>
278 <tbody>
279 {foreach from=$transactions item=transaction}
280 <tr>
281 <td class="text-center">{$transaction.date}</td>
282 <td class="text-center">{$transaction.gateway}</td>
283 <td class="text-center">{$transaction.transid}</td>
284 <td class="text-center">{$transaction.amount}</td>
285 </tr>
286 {foreachelse}
287 <tr>
288 <td class="text-center" colspan="4">{$LANG.invoicestransnonefound}</td>
289 </tr>
290 {/foreach}
291 <tr>
292 <td class="text-right" colspan="3"><strong>{$LANG.invoicesbalance}</strong></td>
293 <td class="text-center">{$balance}</td>
294 </tr>
295 </tbody>
296 </table>
297 </div>
298 </div>
299
300 <div class="pull-right btn-group btn-group-sm hidden-print">
301 <a href="javascript:window.print()" class="btn btn-default"><i class="fas fa-print"></i> {$LANG.print}</a>
302 <a href="dl.php?type=i&id={$invoiceid}" class="btn btn-default"><i class="fas fa-download"></i> {$LANG.invoicesdownload}</a>
303 </div>
304
305 {/if}
306
307 </div>
308
309 <p class="text-center hidden-print"><a href="clientarea.php?action=invoices">{$LANG.invoicesbacktoclientarea}</a></a></p>
310
311 <div id="fullpage-overlay" class="hidden">
312 <div class="outer-wrapper">
313 <div class="inner-wrapper">
314 <img src="{$WEB_ROOT}/assets/img/overlay-spinner.svg">
315 <br>
316 <span class="msg"></span>
317 </div>
318 </div>
319 </div>
320
321</body>
322</html>
323