Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Mooring Fix & Custom Invoice #389

Merged
merged 1 commit into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export default {
return vm.form.valid() && isValid;
},
create: function() {
console.log("CREATE");
if(this.validateForm()){
this.sendData(api_endpoints.campgrounds, 'POST');
}
Expand All @@ -391,7 +392,7 @@ export default {
el.tooltip("destroy");
el.attr("data-original-title", "").parents('.form-group').removeClass('has-error');
}
if (vm.editor.getText().trim().length == 0){
if (vm.editor.getText().trim().length == 0) {
// add or update tooltips
el.tooltip({
trigger: "focus"
Expand Down Expand Up @@ -529,22 +530,22 @@ export default {
name: "required",
park: "required",
campground_type: "required",
site_type: "required",
street: "required",
// site_type: "required",
// street: "required",
email: {
required: true,
email: true
},
telephone: "required",
postcode: "required",
price_level: "required"
// postcode: "required",
// price_level: "required"
},
messages: {
name: "Enter a campground name",
name: "Enter a mooring name",
park: "Select a park from the options",
campground_type: "Select a campground type from the options",
campground_type: "Select a mooring type from the options",
site_type: "Select a site type from the options",
price_level: "Select a price level from the options"
// price_level: "Select a price level from the options"
},
showErrors: function(errorMap, errorList) {
$.each(this.validElements(), function(index, element) {
Expand Down Expand Up @@ -768,7 +769,7 @@ var source = new ol.source.Vector({wrapX: false, features: [iconFeature]});
addInteraction();

});

console.log("ENDED");

// End Map Point Selection

Expand Down
17 changes: 17 additions & 0 deletions mooring/invoice_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,21 @@ def draw(self):
self.__payment_line()
self.__footer_line()

#def _set_template_group(mooring_var):


#def get_template_group(mooring_var):



def _create_header(canvas, doc, draw_page_number=True):
canvas.saveState()
canvas.setTitle('Invoice')
canvas.setFont(BOLD_FONTNAME, LARGE_FONTSIZE)

current_y = PAGE_HEIGHT - HEADER_MARGIN
print "HEADER LOGO"
print DPAW_HEADER_LOGO

dpaw_header_logo = ImageReader(DPAW_HEADER_LOGO)
dpaw_header_logo_size = dpaw_header_logo.getSize()
Expand Down Expand Up @@ -224,6 +232,13 @@ def _create_header(canvas, doc, draw_page_number=True):
canvas.restoreState()

def _create_invoice(invoice_buffer, invoice, request,mooring_var):

global DPAW_HEADER_LOGO
if mooring_var["TEMPLATE_GROUP"] == 'rottnest':
DPAW_HEADER_LOGO = os.path.join(settings.BASE_DIR, 'mooring', 'static', 'mooring', 'img','logo-rottnest-island-sm.png')

# print DPAW_HEADER_LOGO
print DPAW_HEADER_LOGO
every_page_frame = Frame(PAGE_MARGIN, PAGE_MARGIN + 250, PAGE_WIDTH - 2 * PAGE_MARGIN,
PAGE_HEIGHT -450 , id='EveryPagesFrame',showBoundary=0)
remit_frame = Frame(PAGE_MARGIN, PAGE_MARGIN, PAGE_WIDTH - 2 * PAGE_MARGIN,
Expand Down Expand Up @@ -325,6 +340,8 @@ def _create_invoice(invoice_buffer, invoice, request,mooring_var):

def create_invoice_pdf_bytes(filename, invoice,request,mooring_var):
invoice_buffer = BytesIO()
print "MOORING URL"
print mooring_var

_create_invoice(invoice_buffer, invoice, request,mooring_var)

Expand Down
2 changes: 1 addition & 1 deletion mooring/static/parkstay/js/parkstay.js

Large diffs are not rendered by default.