mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on the invoice designs
This commit is contained in:
parent
5454adbe14
commit
76080fcc69
@ -650,6 +650,39 @@
|
|||||||
$('.main_form').submit();
|
$('.main_form').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSaveValid() {
|
||||||
|
var isValid = false;
|
||||||
|
for (var i=0; i<self.invoice().client().contacts().length; i++) {
|
||||||
|
var contact = self.invoice().client().contacts()[i];
|
||||||
|
if (isValidEmailAddress(contact.email())) {
|
||||||
|
isValid = true;
|
||||||
|
} else {
|
||||||
|
isValid = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isEmailValid() {
|
||||||
|
var isValid = false;
|
||||||
|
var sendTo = false;
|
||||||
|
var client = self.invoice().client();
|
||||||
|
for (var i=0; i<client.contacts().length; i++) {
|
||||||
|
var contact = client.contacts()[i];
|
||||||
|
if (isValidEmailAddress(contact.email())) {
|
||||||
|
isValid = true;
|
||||||
|
if (contact.send_invoice() || client.contacts().length == 1) {
|
||||||
|
sendTo = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isValid = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (isValid && sendTo)
|
||||||
|
}
|
||||||
|
|
||||||
function onCloneClick() {
|
function onCloneClick() {
|
||||||
$('#action').val('clone');
|
$('#action').val('clone');
|
||||||
$('.main_form').submit();
|
$('.main_form').submit();
|
||||||
@ -917,7 +950,7 @@
|
|||||||
self.discount = ko.observable('');
|
self.discount = ko.observable('');
|
||||||
self.frequency_id = ko.observable('');
|
self.frequency_id = ko.observable('');
|
||||||
//self.currency_id = ko.observable({{ $client && $client->currency_id ? $client->currency_id : Session::get(SESSION_CURRENCY) }});
|
//self.currency_id = ko.observable({{ $client && $client->currency_id ? $client->currency_id : Session::get(SESSION_CURRENCY) }});
|
||||||
self.terms = ko.observable(wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', $account->invoice_terms) }}', 340));
|
self.terms = ko.observable(wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', $account->invoice_terms) }}', 300));
|
||||||
self.set_default_terms = ko.observable(false);
|
self.set_default_terms = ko.observable(false);
|
||||||
self.public_notes = ko.observable('');
|
self.public_notes = ko.observable('');
|
||||||
self.po_number = ko.observable('');
|
self.po_number = ko.observable('');
|
||||||
@ -990,7 +1023,7 @@
|
|||||||
return this.terms();
|
return this.terms();
|
||||||
},
|
},
|
||||||
write: function(value) {
|
write: function(value) {
|
||||||
value = wordWrapText(value, 340);
|
value = wordWrapText(value, 300);
|
||||||
self.terms(value);
|
self.terms(value);
|
||||||
$('#terms').height(value.split('\n').length * 36);
|
$('#terms').height(value.split('\n').length * 36);
|
||||||
},
|
},
|
||||||
@ -1004,7 +1037,7 @@
|
|||||||
return this.public_notes();
|
return this.public_notes();
|
||||||
},
|
},
|
||||||
write: function(value) {
|
write: function(value) {
|
||||||
value = wordWrapText(value, 340);
|
value = wordWrapText(value, 300);
|
||||||
self.public_notes(value);
|
self.public_notes(value);
|
||||||
$('#public_notes').height(value.split('\n').length * 36);
|
$('#public_notes').height(value.split('\n').length * 36);
|
||||||
},
|
},
|
||||||
@ -1300,7 +1333,7 @@
|
|||||||
return this.notes();
|
return this.notes();
|
||||||
},
|
},
|
||||||
write: function(value) {
|
write: function(value) {
|
||||||
value = wordWrapText(value);
|
value = wordWrapText(value, 235);
|
||||||
self.notes(value);
|
self.notes(value);
|
||||||
onItemChange();
|
onItemChange();
|
||||||
},
|
},
|
||||||
|
2881
public/js/script.js
2881
public/js/script.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user