This commit is contained in:
gsinghpal
2026-03-11 12:15:53 -04:00
parent f81e0cd918
commit db4b9aa278
1210 changed files with 173089 additions and 4044 deletions

View File

@@ -71,8 +71,16 @@
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;border-bottom:1px solid #f0f0f0;">New Return</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;border-bottom:1px solid #f0f0f0;"><t t-out="object.rental_return_date and format_datetime(object.rental_return_date, tz=object.company_id.partner_id.tz or 'America/Toronto', dt_format='MMMM dd, yyyy \'at\' hh:mm a') or ''"/></td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;font-weight:600;border-top:2px solid #e2e8f0;">Renewal #</td><td style="padding:10px 14px;color:#38a169;font-size:14px;font-weight:700;border-top:2px solid #e2e8f0;"><t t-out="object.rental_renewal_count"/></td></tr>
</table>
<t t-set="inv" t-value="ctx.get('renewal_invoice')"/>
<t t-if="inv and ctx.get('payment_ok')">
<table style="width:100%;border-collapse:collapse;margin:0 0 24px 0;">
<tr><td colspan="2" style="padding:10px 14px;font-size:12px;font-weight:600;color:#718096;text-transform:uppercase;letter-spacing:0.5px;border-bottom:2px solid #e2e8f0;">Payment Receipt</td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;border-bottom:1px solid #f0f0f0;width:35%;">Invoice</td><td style="padding:10px 14px;color:#2d3748;font-size:14px;border-bottom:1px solid #f0f0f0;"><t t-out="inv.name or 'Draft'"/></td></tr>
<tr><td style="padding:10px 14px;color:#718096;font-size:14px;font-weight:600;border-top:2px solid #e2e8f0;">Amount Charged</td><td style="padding:10px 14px;color:#38a169;font-size:14px;font-weight:700;border-top:2px solid #e2e8f0;"><t t-out="inv.amount_total" t-options="{'widget': 'monetary', 'display_currency': object.currency_id}"/></td></tr>
</table>
</t>
<div style="border-left:3px solid #38a169;padding:12px 16px;margin:0 0 24px 0;background:#f7fafc;">
<p style="margin:0;font-size:14px;line-height:1.5;color:#2d3748;" t-if="ctx.get('payment_ok')">Payment has been collected from your card on file. No further action is required.</p>
<p style="margin:0;font-size:14px;line-height:1.5;color:#2d3748;" t-if="ctx.get('payment_ok')">Payment has been collected from your card on file. The invoice and payment receipt are attached. No further action is required.</p>
<p style="margin:0;font-size:14px;line-height:1.5;color:#2d3748;" t-if="not ctx.get('payment_ok')">Our team will be in touch regarding payment for this renewal period.</p>
</div>
<t t-if="not is_html_empty(object.user_id.signature)" data-o-mail-quote-container="1">
@@ -1265,10 +1273,43 @@
</div>
</div>
<!-- Google Places API -->
<script t-att-src="'https://maps.googleapis.com/maps/api/js?key=%s&amp;libraries=places' % (google_api_key or '')">/* Google Places */</script>
<!-- Poynt Collect JS SDK -->
<script src="https://cdn.poynt.net/collect.js"/>
<script>
(function() {
/* ---- Google Places address autocomplete ---- */
var addrInput = document.getElementById('billingAddress');
if (addrInput &amp;&amp; typeof google !== 'undefined' &amp;&amp; google.maps &amp;&amp; google.maps.places) {
var autocomplete = new google.maps.places.Autocomplete(addrInput, {
types: ['address'],
componentRestrictions: { country: ['ca', 'us'] },
});
autocomplete.setFields(['address_components', 'formatted_address']);
autocomplete.addListener('place_changed', function() {
var place = autocomplete.getPlace();
if (!place.address_components) return;
var street = '', city = '', prov = '', postal = '';
place.address_components.forEach(function(c) {
var t = c.types;
if (t.includes('street_number')) street = c.long_name + ' ';
if (t.includes('route')) street += c.long_name;
if (t.includes('locality')) city = c.long_name;
if (t.includes('administrative_area_level_1')) prov = c.short_name;
if (t.includes('postal_code')) postal = c.long_name;
});
addrInput.value = street.trim();
var cityEl = document.getElementById('billingCity');
var stateEl = document.getElementById('billingState');
var postalEl = document.getElementById('billingPostalCode');
if (cityEl) cityEl.value = city;
if (stateEl) stateEl.value = prov;
if (postalEl) postalEl.value = postal;
});
}
var cEl = document.querySelector('.container[data-poynt-business-id]');
var bizId = cEl ? cEl.getAttribute('data-poynt-business-id') : '';
var appId = cEl ? cEl.getAttribute('data-poynt-application-id') : '';
@@ -1329,7 +1370,15 @@
if (!poyntCollect) { showAlert('Payment form is not ready.', 'danger'); return; }
poyntNonce = null;
poyntCollect.getNonce({ businessId: bizId });
var nameParts = name.split(' ');
var firstName = nameParts[0] || '';
var lastName = nameParts.slice(1).join(' ') || '';
poyntCollect.getNonce({
businessId: bizId,
firstName: firstName,
lastName: lastName,
zipCode: postal,
});
var btn = this;
btn.disabled = true;
@@ -1341,7 +1390,7 @@
if (poyntNonce) {
clearInterval(waitForNonce);
submitReauthorization(poyntNonce, btn);
} else if (attempts > 50) {
} else if (attempts > 75) {
clearInterval(waitForNonce);
showAlert('Card authorization timed out. Please try again.', 'danger');
btn.disabled = false;