salix/modules/invoiceIn/front/dueDay/index.js

32 lines
709 B
JavaScript
Raw Normal View History

2022-02-07 11:24:08 +00:00
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
add() {
this.$.model.insert({
dueDated: new Date(),
bankFk: this.vnConfig.local.bankFk
});
}
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
this.card.reload();
});
}
}
ngModule.vnComponent('vnInvoiceInDueDay', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnInvoiceInCard'
},
bindings: {
invoiceIn: '<'
}
});