32 lines
709 B
JavaScript
32 lines
709 B
JavaScript
|
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: '<'
|
||
|
}
|
||
|
});
|