Skip to content

Commit

Permalink
Merge branch 'multibook'
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Percival committed Apr 13, 2018
2 parents de9a7af + 8146e49 commit 95207ac
Show file tree
Hide file tree
Showing 8 changed files with 759 additions and 608 deletions.
49 changes: 25 additions & 24 deletions ledger/payments/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,30 @@ def __payment_line(self):
canvas.drawString(cheque_x + 32, cheque_y, 'Locked Bag 30')
cheque_y -= 15
canvas.drawString(cheque_x + 32, cheque_y, 'Bentley Delivery Centre WA 6983')
# Outer BPAY Box
canvas.rect(current_x,current_y - 25,2.3*inch,-1.2*inch)
canvas.setFillColorCMYK(0.8829,0.6126,0.0000,0.5647)
# Move into bpay box
current_y += 5
box_pos = current_x + 0.1 * inch
bpay_logo_size = bpay_logo.getSize()
canvas.drawImage(bpay_logo, box_pos, current_y - (bpay_logo_size[1]/12 * 1.7), height= bpay_logo_size[1]/12,width=bpay_logo_size[0]/12, mask='auto')
# Create biller information box
biller_x = box_pos + bpay_logo_size[0]/12 + 1
canvas.rect(biller_x,(current_y - (bpay_logo_size[1]/12 * 1.7)) + 3,1.65*inch,(bpay_logo_size[1]/12)-5)
# Bpay info
canvas.setFont(BOLD_FONTNAME, MEDIUM_FONTSIZE)
info_y = ((current_y - (bpay_logo_size[1]/12 * 1.7)) + 3) + (0.35 * inch)
canvas.drawString(biller_x + 5, info_y, 'Biller Code: {}'.format(self.invoice.biller_code))
canvas.drawString(biller_x + 5, info_y - 20, 'Ref: {}'.format(self.invoice.reference))
# Bpay Info string
canvas.setFont(BOLD_FONTNAME,SMALL_FONTSIZE)
canvas.drawString(box_pos, info_y - 0.55 * inch, 'Telephone & Internet Banking - BPAY')
canvas.setFont(DEFAULT_FONTNAME,6.5)
canvas.drawString(box_pos, info_y - 0.65 * inch, 'Contact your bank or financial institution to make')
canvas.drawString(box_pos, info_y - 0.75 * inch, 'this payment from your cheque, savings, debit or')
canvas.drawString(box_pos, info_y - 0.85 * inch, 'transaction account. More info: www.bpay.com.au')
if settings.BPAY_ALLOWED:
# Outer BPAY Box
canvas.rect(current_x,current_y - 25,2.3*inch,-1.2*inch)
canvas.setFillColorCMYK(0.8829,0.6126,0.0000,0.5647)
# Move into bpay box
current_y += 5
box_pos = current_x + 0.1 * inch
bpay_logo_size = bpay_logo.getSize()
canvas.drawImage(bpay_logo, box_pos, current_y - (bpay_logo_size[1]/12 * 1.7), height= bpay_logo_size[1]/12,width=bpay_logo_size[0]/12, mask='auto')
# Create biller information box
biller_x = box_pos + bpay_logo_size[0]/12 + 1
canvas.rect(biller_x,(current_y - (bpay_logo_size[1]/12 * 1.7)) + 3,1.65*inch,(bpay_logo_size[1]/12)-5)
# Bpay info
canvas.setFont(BOLD_FONTNAME, MEDIUM_FONTSIZE)
info_y = ((current_y - (bpay_logo_size[1]/12 * 1.7)) + 3) + (0.35 * inch)
canvas.drawString(biller_x + 5, info_y, 'Biller Code: {}'.format(self.invoice.biller_code))
canvas.drawString(biller_x + 5, info_y - 20, 'Ref: {}'.format(self.invoice.reference))
# Bpay Info string
canvas.setFont(BOLD_FONTNAME,SMALL_FONTSIZE)
canvas.drawString(box_pos, info_y - 0.55 * inch, 'Telephone & Internet Banking - BPAY')
canvas.setFont(DEFAULT_FONTNAME,6.5)
canvas.drawString(box_pos, info_y - 0.65 * inch, 'Contact your bank or financial institution to make')
canvas.drawString(box_pos, info_y - 0.75 * inch, 'this payment from your cheque, savings, debit or')
canvas.drawString(box_pos, info_y - 0.85 * inch, 'transaction account. More info: www.bpay.com.au')

self.current_y = current_y

Expand Down Expand Up @@ -304,7 +305,7 @@ def _create_invoice(invoice_buffer, invoice):
elements.append(Spacer(1, SECTION_BUFFER_HEIGHT * 2))
# /Products Table
if invoice.payment_status != 'paid' and invoice.payment_status != 'over_paid':
elements.append(Paragraph('Your application cannot be processed until payment is received.', styles['Left']))
elements.append(Paragraph(settings.INVOICE_UNPAID_WARNING, styles['Left']))

elements.append(Spacer(1, SECTION_BUFFER_HEIGHT * 6))

Expand Down
19 changes: 1 addition & 18 deletions ledger/payments/templates/dpaw_payments/invoice/invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,24 +224,7 @@ <h4 class="subheader text-center">Remittance Advice</h4>
</div>
</div>
<!-- BPAY -->
<div class="row">
<div class="column large-6">
<div class="bpay_div column large-7">
<div class="row">
<div class="column small-4">
<img style="margin-top: 10px;" width="55px" height="55px" src="/media/BPAY_2012_PORT_BLUE.png"alt="BPAY Logo"/>
</div>
<div style="margin-top: 10px; margin-left:-10px;" class="bpay_div column small-7">
<p style="margin-bottom: 0;">Biller Code: {{invoice.biller_code}}</p>
<p style="margin-bottom: 0;">Ref: {{invoice.reference}}</p>
</div>
</div>
<p style="margin-bottom: 0;">Telephone & Internet Banking - BPAY</p>
<small>Contact your bank or financial institution to make</small>
<small>this payment from your cheque, savings, debit or</small>
<small>transaction account.More info:www.bpay.com.au</small>
</div>
</div>
<div class="row">
<div class="column large-6">
<strong>Pay By Cheque</strong>
<p>Make cheque payable to: Department of Parks and Wildlife</p>
Expand Down
1 change: 1 addition & 0 deletions ledger/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
LEDGER_PASS=env('LEDGER_PASS')
NOTIFICATION_EMAIL=env('NOTIFICATION_EMAIL')
BPAY_GATEWAY = env('BPAY_GATEWAY', None)
INVOICE_UNPAID_WARNING = env('INVOICE_UNPAID_WARNING', '')
# GST Settings
LEDGER_GST = env('LEDGER_GST',10)
# BPAY settings
Expand Down
7 changes: 5 additions & 2 deletions parkstay/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1635,9 +1635,12 @@ def list(self, request, *args, **kwargs):
bk['campground_site_type'] = ""
else:
first_campsite_list = booking.first_campsite_list
campground_site_type = ""
campground_site_type = []
for item in first_campsite_list:
campground_site_type += ' {}{}'.format('{} - '.format(item.name if item else ""),'({})'.format(item.type if item.type else ""))
campground_site_type.append ({
"name": '{}'.format(item.name if item else ""),
"type": '{}'.format(item.type if item.type else "")
})
bk['campground_site_type'] = campground_site_type
else:
bk['campground_site_type'] = ""
Expand Down
Loading

0 comments on commit 95207ac

Please sign in to comment.