Untitled diff

Created Diff never expires
161 removals
Words removed160
Total words1755
Words removed (%)9.12
846 lines
104 additions
Words added170
Total words1765
Words added (%)9.63
816 lines
/* jshint ignore:start */
/* jshint ignore:start */


/* jshint ignore:end */
/* jshint ignore:end */


define('piqu-ember/adapters/application', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/adapters/application', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].ActiveModelAdapter.extend({

___ExportObject___ = DS['default'].ActiveModelAdapter.extend({
coalesceFindRequests: true
coalesceFindRequests: true
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/app', ['exports', 'ember', 'ember/resolver', 'ember/load-initializers', 'piqu-ember/config/environment'], function (exports, Ember, Resolver, loadInitializers, config) {
define('piqu-ember/app', ['exports', 'ember', 'ember/resolver', 'ember/load-initializers', 'piqu-ember/config/environment'], function (exports, Ember, Resolver, loadInitializers, config) {


'use strict';
'use strict';


Ember['default'].MODEL_FACTORY_INJECTIONS = false;
Ember['default'].MODEL_FACTORY_INJECTIONS = false;


var App = Ember['default'].Application.extend({
var App = Ember['default'].Application.extend({
modulePrefix: config['default'].modulePrefix,
modulePrefix: config['default'].modulePrefix,
podModulePrefix: config['default'].podModulePrefix,
podModulePrefix: config['default'].podModulePrefix,
Resolver: Resolver['default']
Resolver: Resolver['default']
});
});


loadInitializers['default'](App, config['default'].modulePrefix);
loadInitializers['default'](App, config['default'].modulePrefix);


exports['default'] = App;
exports['default'] = App;


});
});
define('piqu-ember/components/pikaday-input', ['exports', 'ember', 'ember-pikaday/components/pikaday-input'], function (exports, Ember, PikadayInputComponent) {
define('piqu-ember/components/pikaday-input', ['exports', 'ember', 'ember-pikaday/components/pikaday-input'], function (exports, Ember, PikadayInputComponent) {


'use strict';
'use strict';


exports['default'] = PikadayInputComponent['default'];
exports['default'] = PikadayInputComponent['default'];


});
});
define('piqu-ember/controllers/application', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/controllers/application', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend({

___ExportObject___ = Ember['default'].ObjectController.extend({
errors: null
errors: null
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/expenses-invoices/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/expenses-invoices/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Edit received invoice";
return "Edit received invoice";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Update";
return "Update";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'expenses';
return 'expenses';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/expenses-invoices/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/expenses-invoices/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Create new received invoice";
return "Create new received invoice";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Create";
return "Create";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'expenses';
return 'expenses';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/expenses-tickets/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/expenses-tickets/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Edit received ticket";
return "Edit received ticket";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Update";
return "Update";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'expenses';
return 'expenses';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/expenses-tickets/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/expenses-tickets/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Create new received ticket";
return "Create new received ticket";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Create";
return "Create";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'expenses';
return 'expenses';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/expenses', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/controllers/expenses', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend({

___ExportObject___ = Ember['default'].ObjectController.extend({
total: (function() {
total: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('total') * 100;
return total += invoice.get('total') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('total') * 100;
return total += ticket.get('total') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each'),
}).property('invoices.@each', 'tickets.@each'),
totalWithoutTaxes: (function() {
totalWithoutTaxes: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('totalWithoutTaxes') * 100;
return total += invoice.get('totalWithoutTaxes') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('totalWithoutTaxes') * 100;
return total += ticket.get('totalWithoutTaxes') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each'),
}).property('invoices.@each', 'tickets.@each'),
vat: (function() {
vat: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('vat') * 100;
return total += invoice.get('vat') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('vat') * 100;
return total += ticket.get('vat') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each'),
}).property('invoices.@each', 'tickets.@each'),
irpf: (function() {
irpf: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('irpf') * 100;
return total += invoice.get('irpf') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('irpf') * 100;
return total += ticket.get('irpf') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each')
}).property('invoices.@each', 'tickets.@each')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/income-invoices/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/income-invoices/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Edit emitted invoice";
return "Edit emitted invoice";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Update";
return "Update";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'income';
return 'income';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/income-invoices/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/income-invoices/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Create new emitted invoice";
return "Create new emitted invoice";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Create";
return "Create";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'income';
return 'income';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/income-invoices/show', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/controllers/income-invoices/show', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend();

___ExportObject___ = Ember['default'].ObjectController.extend();

exports['default'] = ___ExportObject___;


});
});
define('piqu-ember/controllers/income-tickets/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/income-tickets/edit', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Edit emitted ticket";
return "Edit emitted ticket";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Update";
return "Update";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'income';
return 'income';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/income-tickets/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {
define('piqu-ember/controllers/income-tickets/new', ['exports', 'ember', 'piqu-ember/mixins/billing-document-mixin'], function (exports, Ember, BillingDocumentMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {

___ExportObject___ = Ember['default'].ObjectController.extend(BillingDocumentMixin['default'], {
title: (function() {
title: (function() {
return "Create new emitted ticket";
return "Create new emitted ticket";
}).property(),
}).property(),
actionName: (function() {
actionName: (function() {
return "Create";
return "Create";
}).property(),
}).property(),
afterSaveUrl: (function() {
afterSaveUrl: (function() {
return 'income';
return 'income';
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/income', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/controllers/income', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend({

___ExportObject___ = Ember['default'].ObjectController.extend({
total: (function() {
total: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('total') * 100;
return total += invoice.get('total') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('total') * 100;
return total += ticket.get('total') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each'),
}).property('invoices.@each', 'tickets.@each'),
totalWithoutTaxes: (function() {
totalWithoutTaxes: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('totalWithoutTaxes') * 100;
return total += invoice.get('totalWithoutTaxes') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('totalWithoutTaxes') * 100;
return total += ticket.get('totalWithoutTaxes') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each'),
}).property('invoices.@each', 'tickets.@each'),
vat: (function() {
vat: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('vat') * 100;
return total += invoice.get('vat') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('vat') * 100;
return total += ticket.get('vat') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each'),
}).property('invoices.@each', 'tickets.@each'),
irpf: (function() {
irpf: (function() {
var total;
var total;
total = 0;
total = 0;
this.get('invoices').forEach(function(invoice) {
this.get('invoices').forEach(function(invoice) {
return total += invoice.get('irpf') * 100;
return total += invoice.get('irpf') * 100;
});
});
this.get('tickets').forEach(function(ticket) {
this.get('tickets').forEach(function(ticket) {
return total += ticket.get('irpf') * 100;
return total += ticket.get('irpf') * 100;
});
});
return total / 100;
return total / 100;
}).property('invoices.@each', 'tickets.@each')
}).property('invoices.@each', 'tickets.@each')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/index', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/controllers/index', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend({

___ExportObject___ = Ember['default'].ObjectController.extend({
year: (function() {
year: (function() {
return moment().year();
return moment().year();
}).property(),
}).property(),
quarter: (function() {}).property(),
quarter: (function() {}).property(),
years: (function() {
years: (function() {
return [2012, 2013, 2014, 2015];
return [2012, 2013, 2014, 2015];
}).property(),
}).property(),
quarters: (function() {
quarters: (function() {
return [null, '1T', '2T', '3T', '4T'];
return [null, '1T', '2T', '3T', '4T'];
}).property(),
}).property(),
fetchBalace: (function() {
fetchBalace: (function() {
var newId;
var newId;
newId = this.get('year').toString();
newId = this.get('year').toString();
if (this.get('quarter')) {
if (this.get('quarter')) {
newId += '-' + this.get('quarter');
newId += '-' + this.get('quarter');
}
}
return this.store.fetchById('balance', newId).then((function(_this) {
return this.store.fetchById('balance', newId).then((function(_this) {
return function(balance) {
return function(balance) {
return _this.set('content', balance);
return _this.set('content', balance);
};
};
})(this));
})(this));
}).observes('quarter', 'year')
}).observes('quarter', 'year')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/item-fields', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/controllers/item-fields', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].ObjectController.extend({

___ExportObject___ = Ember['default'].ObjectController.extend({
actions: {
actions: {
destroy: function(item) {
destroy: function(item) {
item.destroyRecord();
item.destroyRecord();
return false;
return false;
}
}
}
}
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/controllers/login', ['exports', 'ember', 'simple-auth/mixins/login-controller-mixin'], function (exports, Ember, LoginControllerMixin) {
define('piqu-ember/controllers/login', ['exports', 'ember', 'simple-auth/mixins/login-controller-mixin'], function (exports, Ember, LoginControllerMixin) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].Controller.extend(LoginControllerMixin['default'], {

___ExportObject___ = Ember['default'].Controller.extend(LoginControllerMixin['default'], {
authenticator: 'simple-auth-authenticator:oauth2-password-grant',
authenticator: 'simple-auth-authenticator:oauth2-password-grant',
actions: {
actions: {
authenticate: function() {
authenticate: function() {
return this._super().then(null, (function(_this) {
return this._super().then(null, (function(_this) {
return function() {
return function() {
return _this.set('loginFailed', true);
return _this.set('loginFailed', true);
};
};
})(this));
})(this));
}
}
}
}
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/initializers/app-version', ['exports', 'piqu-ember/config/environment', 'ember'], function (exports, config, Ember) {
define('piqu-ember/initializers/app-version', ['exports', 'piqu-ember/config/environment', 'ember'], function (exports, config, Ember) {


'use strict';
'use strict';


var classify = Ember['default'].String.classify;
var classify = Ember['default'].String.classify;


exports['default'] = {
exports['default'] = {
name: "App Version",
name: "App Version",
initialize: function (container, application) {
initialize: function (container, application) {
var appName = classify(application.toString());
var appName = classify(application.toString());
Ember['default'].libraries.register(appName, config['default'].APP.version);
Ember['default'].libraries.register(appName, config['default'].APP.version);
}
}
};
};


});
});
define('piqu-ember/initializers/current-user', ['exports', 'ember', 'simple-auth/session'], function (exports, Ember, Session) {
define('piqu-ember/initializers/current-user', ['exports', 'ember', 'simple-auth/session'], function (exports, Ember, Session) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = {

___ExportObject___ = {
name: 'current-user',
name: 'current-user',
before: 'simple-auth',
before: 'simple-auth',
initialize: function(container) {
initialize: function(container) {
return Session['default'].reopen({
return Session['default'].reopen({
setCurrentUser: (function() {
setCurrentUser: (function() {
var store, token;
var store, token;
token = this.get('content.access_token');
token = this.get('content.access_token');
store = container.lookup('store:main');
store = container.lookup('store:main');
if (!Ember['default'].isEmpty(token)) {
if (!Ember['default'].isEmpty(token)) {
return store.find('user', token).then((function(_this) {
return store.find('user', token).then((function(_this) {
return function(user) {
return function(user) {
return _this.set('currentUser', user);
return _this.set('currentUser', user);
};
};
})(this));
})(this));
}
}
}).observes('access_token')
}).observes('access_token')
});
});
}
}
};
};


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/initializers/ember-moment', ['exports', 'ember-moment/helpers/moment', 'ember-moment/helpers/ago', 'ember'], function (exports, moment, ago, Ember) {
define('piqu-ember/initializers/ember-moment', ['exports', 'ember-moment/helpers/moment', 'ember-moment/helpers/ago', 'ember'], function (exports, moment, ago, Ember) {


'use strict';
'use strict';


var initialize = function () {
var initialize = function () {
Ember['default'].Handlebars.helper("moment", moment.moment);
Ember['default'].Handlebars.helper("moment", moment.moment);
Ember['default'].Handlebars.helper("ago", ago.ago);
Ember['default'].Handlebars.helper("ago", ago.ago);
};
};


exports['default'] = {
exports['default'] = {
name: "ember-moment",
name: "ember-moment",


initialize: initialize
initialize: initialize
};
};
/* container, app */
/* container, app */


exports.initialize = initialize;
exports.initialize = initialize;


});
});
define('piqu-ember/initializers/export-application-global', ['exports', 'ember', 'piqu-ember/config/environment'], function (exports, Ember, config) {
define('piqu-ember/initializers/export-application-global', ['exports', 'ember', 'piqu-ember/config/environment'], function (exports, Ember, config) {


'use strict';
'use strict';


exports.initialize = initialize;
exports.initialize = initialize;


function initialize() {
function initialize() {
var application = arguments[1] || arguments[0];
var application = arguments[1] || arguments[0];
if (config['default'].exportApplicationGlobal !== false) {
if (config['default'].exportApplicationGlobal !== false) {
var value = config['default'].exportApplicationGlobal;
var value = config['default'].exportApplicationGlobal;
var globalName;
var globalName;


if (typeof value === "string") {
if (typeof value === "string") {
globalName = value;
globalName = value;
} else {
} else {
globalName = Ember['default'].String.classify(config['default'].modulePrefix);
globalName = Ember['default'].String.classify(config['default'].modulePrefix);
}
}


if (!window[globalName]) {
if (!window[globalName]) {
window[globalName] = application;
window[globalName] = application;


application.reopen({
application.reopen({
willDestroy: function () {
willDestroy: function () {
this._super.apply(this, arguments);
this._super.apply(this, arguments);
delete window[globalName];
delete window[globalName];
}
}
});
});
}
}
}
}
}exports['default'] = {
}exports['default'] = {
name: "export-application-global",
name: "export-application-global",


initialize: initialize
initialize: initialize
};
};


});
});
define('piqu-ember/initializers/simple-auth-oauth2', ['exports', 'simple-auth-oauth2/configuration', 'simple-auth-oauth2/authenticators/oauth2', 'simple-auth-oauth2/authorizers/oauth2', 'piqu-ember/config/environment'], function (exports, Configuration, Authenticator, Authorizer, ENV) {
define('piqu-ember/initializers/simple-auth-oauth2', ['exports', 'simple-auth-oauth2/configuration', 'simple-auth-oauth2/authenticators/oauth2', 'simple-auth-oauth2/authorizers/oauth2', 'piqu-ember/config/environment'], function (exports, Configuration, Authenticator, Authorizer, ENV) {


'use strict';
'use strict';


exports['default'] = {
exports['default'] = {
name: "simple-auth-oauth2",
name: "simple-auth-oauth2",
before: "simple-auth",
before: "simple-auth",
initialize: function (container, application) {
initialize: function (container, application) {
Configuration['default'].load(container, ENV['default']["simple-auth-oauth2"] || {});
Configuration['default'].load(container, ENV['default']["simple-auth-oauth2"] || {});
container.register("simple-auth-authorizer:oauth2-bearer", Authorizer['default']);
container.register("simple-auth-authorizer:oauth2-bearer", Authorizer['default']);
container.register("simple-auth-authenticator:oauth2-password-grant", Authenticator['default']);
container.register("simple-auth-authenticator:oauth2-password-grant", Authenticator['default']);
}
}
};
};


});
});
define('piqu-ember/initializers/simple-auth', ['exports', 'simple-auth/configuration', 'simple-auth/setup', 'piqu-ember/config/environment'], function (exports, Configuration, setup, ENV) {
define('piqu-ember/initializers/simple-auth', ['exports', 'simple-auth/configuration', 'simple-auth/setup', 'piqu-ember/config/environment'], function (exports, Configuration, setup, ENV) {


'use strict';
'use strict';


exports['default'] = {
exports['default'] = {
name: "simple-auth",
name: "simple-auth",
initialize: function (container, application) {
initialize: function (container, application) {
Configuration['default'].load(container, ENV['default']["simple-auth"] || {});
Configuration['default'].load(container, ENV['default']["simple-auth"] || {});
setup['default'](container, application);
setup['default'](container, application);
}
}
};
};


});
});
define('piqu-ember/mixins/billing-document-mixin', ['exports', 'ember'], function (exports, Ember) {
define('piqu-ember/mixins/billing-document-mixin', ['exports', 'ember'], function (exports, Ember) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = Ember['default'].Mixin.create({

___ExportObject___ = Ember['default'].Mixin.create({
resetRelatedCompanyError: (function() {
resetRelatedCompanyError: (function() {
return Ember['default'].run.scheduleOnce('afterRender', this, function() {
return Ember['default'].run.scheduleOnce('afterRender', this, function() {
return $('#related-company').on('change', (function(_this) {
return $('#related-company').on('change', (function(_this) {
return function() {
return function() {
return _this.set('relatedCompanyMissing', false);
return _this.set('relatedCompanyMissing', false);
};
};
})(this));
})(this));
});
});
}).on('init'),
}).on('init'),
saveItems: function() {
saveItems: function() {
var document, itemPromises;
var document, itemPromises;
document = this.get('model');
document = this.get('model');
itemPromises = Ember['default'].A();
itemPromises = Ember['default'].A();
this.get('items').forEach((function(_this) {
this.get('items').forEach((function(_this) {
return function(item) {
return function(item) {
document.get('items').addObject(item);
document.get('items').addObject(item);
return itemPromises.push(item.save());
return itemPromises.push(item.save());
};
};
})(this));
})(this));
return Ember['default'].RSVP.all(itemPromises).then((function(_this) {
return Ember['default'].RSVP.all(itemPromises).then((function(_this) {
return function() {
return function() {
var url;
var url;
url = _this.get('afterSaveUrl');
url = _this.get('afterSaveUrl');
return _this.transitionToRoute(url);
return _this.transitionToRoute(url);
};
};
})(this), function() {});
})(this), function() {});
},
},
saveDocument: function() {
saveDocument: function() {
if (this.get('model.isDirty')) {
if (this.get('model.isDirty')) {
return this.get('model').save().then((function(_this) {
return this.get('model').save().then((function(_this) {
return function() {
return function() {
return _this.saveItems();
return _this.saveItems();
};
};
})(this), function() {});
})(this), function() {});
} else {
} else {
return this.saveItems();
return this.saveItems();
}
}
},
},
createOrAssociateRelatedCompany: function() {
createOrAssociateRelatedCompany: function() {
return new Ember['default'].RSVP.Promise((function(_this) {
return new Ember['default'].RSVP.Promise((function(_this) {
return function(resolve, reject) {
return function(resolve, reject) {
var companyId;
var companyId;
if (_this.get('newRelatedCompany')) {
if (_this.get('newRelatedCompany')) {
if (_this.get('newCompany.isDirty')) {
if (_this.get('newCompany.isDirty')) {
return _this.get('newCompany').save().then(function(company) {
return _this.get('newCompany').save().then(function(company) {
_this.set('model.relatedCompany', company);
_this.set('model.relatedCompany', company);
return resolve();
return resolve();
}, function() {
}, function() {
return reject();
return reject();
});
});
} else {
} else {
return resolve();
return resolve();
}
}
} else {
} else {
companyId = $('#related-company').val();
companyId = $('#related-company').val();
if (!companyId) {
if (!companyId) {
_this.set('relatedCompanyMissing', true);
_this.set('relatedCompanyMissing', true);
reject();
reject();
return;
return;
}
}
if (!_this.get('newCompany.isDeleted')) {
if (!_this.get('newCompany.isDeleted')) {
_this.get('newCompany').deleteRecord();
_this.get('newCompany').deleteRecord();
}
}
return _this.store.find('relatedCompany', companyId).then(function(company) {
return _this.store.find('relatedCompany', companyId).then(function(company) {
_this.set('model.relatedCompany', company);
_this.set('model.relatedCompany', company);
return resolve();
return resolve();
});
});
}
}
};
};
})(this));
})(this));
},
},
actions: {
actions: {
createBillingDocument: function() {
createBillingDocument: function() {
if (this.get('model.constructor.typeKey') === 'invoice') {
if (this.get('model.constructor.typeKey') === 'invoice') {
return this.createOrAssociateRelatedCompany().then((function(_this) {
return this.createOrAssociateRelatedCompany().then((function(_this) {
return function() {
return function() {
return _this.saveDocument();
return _this.saveDocument();
};
};
})(this));
})(this));
} else {
} else {
return this.saveDocument();
return this.saveDocument();
}
}
},
},
addItem: function() {
addItem: function() {
return this.get('items').addObject(this.store.createRecord('item', {
return this.get('items').addObject(this.store.createRecord('item', {
quantity: 1,
quantity: 1,
vatPercentage: 21,
vatPercentage: 21,
irpfPercentage: 0
irpfPercentage: 0
}));
}));
},
},
newRelatedCompany: function() {
newRelatedCompany: function() {
$('#related-company').prop('disabled', true);
$('#related-company').prop('disabled', true);
$('#new-company-button').prop('disabled', true);
$('#new-company-button').prop('disabled', true);
this.set('newRelatedCompany', true);
this.set('newRelatedCompany', true);
this.set('relatedCompanyMissing', false);
this.set('relatedCompanyMissing', false);
$('#new-company').removeClass('hide');
$('#new-company').removeClass('hide');
return $('#select-company').addClass('hide');
return $('#select-company').addClass('hide');
},
},
cancelNewCompany: function() {
cancelNewCompany: function() {
$('#related-company').prop('disabled', false);
$('#related-company').prop('disabled', false);
$('#new-company-button').prop('disabled', false);
$('#new-company-button').prop('disabled', false);
this.set('newRelatedCompany', false);
this.set('newRelatedCompany', false);
$('#new-company').addClass('hide');
$('#new-company').addClass('hide');
return $('#select-company').removeClass('hide');
return $('#select-company').removeClass('hide');
}
}
}
}
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/account', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/account', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
name: DS['default'].attr('string'),
name: DS['default'].attr('string'),
taxId: DS['default'].attr('string'),
taxId: DS['default'].attr('string'),
phone: DS['default'].attr('string'),
phone: DS['default'].attr('string'),
address: DS['default'].attr('string'),
address: DS['default'].attr('string'),
zipCode: DS['default'].attr('string'),
zipCode: DS['default'].attr('string'),
city: DS['default'].attr('string'),
city: DS['default'].attr('string'),
country: DS['default'].attr('string'),
country: DS['default'].attr('string'),
user: DS['default'].belongsTo('user', {
user: DS['default'].belongsTo('user', {
async: true
async: true
})
})
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/balance', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/balance', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
title: DS['default'].attr('string'),
title: DS['default'].attr('string'),
incomeBase: DS['default'].attr('number'),
incomeBase: DS['default'].attr('number'),
expensesBase: DS['default'].attr('number'),
expensesBase: DS['default'].attr('number'),
incomeVat: DS['default'].attr('number'),
incomeVat: DS['default'].attr('number'),
expensesVat: DS['default'].attr('number'),
expensesVat: DS['default'].attr('number'),
incomeIrpf: DS['default'].attr('number'),
incomeIrpf: DS['default'].attr('number'),
expensesIrpf: DS['default'].attr('number'),
expensesIrpf: DS['default'].attr('number'),
incomeTotal: DS['default'].attr('number'),
incomeTotal: DS['default'].attr('number'),
expensesTotal: DS['default'].attr('number'),
expensesTotal: DS['default'].attr('number'),
totalBase: DS['default'].attr('number'),
totalBase: DS['default'].attr('number'),
totalVat: DS['default'].attr('number'),
totalVat: DS['default'].attr('number'),
totalTotal: DS['default'].attr('number')
totalTotal: DS['default'].attr('number')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/billing-document', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/billing-document', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
items: DS['default'].hasMany('items', {
items: DS['default'].hasMany('items', {
async: true,
async: true,
inverse: 'billingDocument'
inverse: 'billingDocument'
}),
}),
total: DS['default'].attr('number'),
total: DS['default'].attr('number'),
totalWithoutTaxes: DS['default'].attr('number'),
totalWithoutTaxes: DS['default'].attr('number'),
vat: DS['default'].attr('number'),
vat: DS['default'].attr('number'),
irpf: DS['default'].attr('number'),
irpf: DS['default'].attr('number'),
dateOutputFormat: (function() {
dateOutputFormat: (function() {
return "L";
return "L";
}).property()
}).property()
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/invoice', ['exports', 'piqu-ember/models/billing-document.js'], function (exports, BillingDocument) {
define('piqu-ember/models/invoice', ['exports', 'piqu-ember/models/billing-document.js'], function (exports, BillingDocument) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = BillingDocument['default'].extend({

___ExportObject___ = BillingDocument['default'].extend({
number: DS.attr('number'),
number: DS.attr('number'),
kind: DS.attr('string'),
kind: DS.attr('string'),
state: DS.attr('string'),
state: DS.attr('string'),
emittedAt: DS.attr('date'),
emittedAt: DS.attr('date'),
paidAt: DS.attr('date'),
paidAt: DS.attr('date'),
relatedCompany: DS.belongsTo('relatedCompany', {
relatedCompany: DS.belongsTo('relatedCompany', {
inverse: null,
inverse: null,
async: true
async: true
})
})
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/item', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/item', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
concept: DS['default'].attr('string'),
concept: DS['default'].attr('string'),
unitPrice: DS['default'].attr('number'),
unitPrice: DS['default'].attr('number'),
quantity: DS['default'].attr('number', {
quantity: DS['default'].attr('number', {
defaultValue: 1
defaultValue: 1
}),
}),
vatPercentage: DS['default'].attr('number'),
vatPercentage: DS['default'].attr('number'),
irpfPercentage: DS['default'].attr('number'),
irpfPercentage: DS['default'].attr('number'),
vat: DS['default'].attr('number'),
vat: DS['default'].attr('number'),
irpf: DS['default'].attr('number'),
irpf: DS['default'].attr('number'),
totalWithoutTaxes: DS['default'].attr('number'),
totalWithoutTaxes: DS['default'].attr('number'),
total: DS['default'].attr('number'),
total: DS['default'].attr('number'),
billingDocument: DS['default'].belongsTo('billingDocument', {
billingDocument: DS['default'].belongsTo('billingDocument', {
async: true,
async: true,
polymorphic: true,
polymorphic: true,
inverse: 'items'
inverse: 'items'
})
})
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/registration', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/registration', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
email: DS['default'].attr('string'),
email: DS['default'].attr('string'),
password: DS['default'].attr('string'),
password: DS['default'].attr('string'),
passwordConfirmation: DS['default'].attr('string')
passwordConfirmation: DS['default'].attr('string')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/related-company', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/related-company', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
taxId: DS['default'].attr('string'),
taxId: DS['default'].attr('string'),
name: DS['default'].attr('string'),
name: DS['default'].attr('string'),
phone: DS['default'].attr('string'),
phone: DS['default'].attr('string'),
address: DS['default'].attr('string'),
address: DS['default'].attr('string'),
zipCode: DS['default'].attr('string'),
zipCode: DS['default'].attr('string'),
city: DS['default'].attr('string'),
city: DS['default'].attr('string'),
country: DS['default'].attr('string'),
country: DS['default'].attr('string'),
kind: DS['default'].attr('string')
kind: DS['default'].attr('string')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/ticket', ['exports', 'piqu-ember/models/billing-document.js'], function (exports, BillingDocument) {
define('piqu-ember/models/ticket', ['exports', 'piqu-ember/models/billing-document.js'], function (exports, BillingDocument) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = BillingDocument['default'].extend({

___ExportObject___ = BillingDocument['default'].extend({
number: DS.attr('number'),
number: DS.attr('number'),
kind: DS.attr('string'),
kind: DS.attr('string'),
state: DS.attr('string'),
state: DS.attr('string'),
emittedAt: DS.attr('date'),
emittedAt: DS.attr('date'),
paidAt: DS.attr('date'),
paidAt: DS.attr('date'),
relatedCompanyName: DS.attr('string')
relatedCompanyName: DS.attr('string')
});
});


exports['default'] = ___ExportObject___;

});
});
define('piqu-ember/models/user', ['exports', 'ember-data'], function (exports, DS) {
define('piqu-ember/models/user', ['exports', 'ember-data'], function (exports, DS) {


'use strict';
'use strict';


var ___ExportObject___;
exports['default'] = DS['default'].Model.extend({

___ExportObject___ = DS['default'].Model.extend({
email: DS['default'].attr('string'),
email: DS['default'].attr('string'),
account: DS['default'].belongsTo('account', {
account: DS['default'].belongsTo('account', {
async: tru
async: true
})
});

});
define('piqu-ember/router', ['exports', 'ember', 'piqu-ember/config/environment'], function (exports, Ember, config) {

'use strict';

var Router;

Router = Ember['default'].Router.extend({
location: config['default'].locationType
});

Router.map(function() {
this.route('configuration');
this.route('login');
this.resource('income', function() {});
this.resource('income-invoices', {
path: 'income/invoices'
}, function() {
this.route('new');
this.route('show', {
path: ':id'
});
return this.route('edit', {
path: ':id/edit'
});
});
this.resource('income-tickets', {
path: 'income/tickets'
}, function() {
this.route('new');
this.route('show', {
path: ':id'
});
return this.route('edit', {
path: ':id/edit'
});
});
this.resource('expenses', function() {});
this.resource('expenses-invoices', {
path: 'expenses/invoices'
}, function() {
this.route('new');
this.route('show', {
path: ':id'
});
return this.route('edit', {
path: ':id/edit'
});
});
return this.resource('expenses-tickets', {
path: 'expenses/tickets'
}, function() {
this.route('new');
this.route('show', {
path: ':id'
});
return this.route('edit', {
path: ':id/edit'
});
});
});

exports['default'] = Router;

});
define('piqu-ember/routes/application', ['exports', 'ember', 'simple-auth/mixins/application-route-mixin'], function (exports, Ember, ApplicationRouteMixin) {

'use strict';

exports['default'] = Ember['default'].Route.extend(ApplicationRouteMixin['default'], {
model: function() {
if (this.get('session.isAuthenticated')) {
return this.store.find('user', this.