Example #1
0
    createNewAlertify('customer');
    createNewAlertify('customerShow');
});
indexTmpl.onDestroyed(function () {
    Session.set('customerId', undefined);
});

indexTmpl.helpers({
    tabularTable(){
        return CustomerTabular;
    }
});

indexTmpl.events({
    'click .js-create' (event, instance) {
        alertify.customer(fa('plus', 'Customer'), renderTemplate(formTmpl));
    },
    'click .js-update' (event, instance) {
        alertify.customer(fa('pencil', 'Customer'), renderTemplate(formTmpl, this));
    },
    'click .js-destroy' (event, instance) {
        let id = this._id;
        Meteor.call('customerExist', this._id, function (error, result) {
            if (result) {
                displayError("This record has already used !");
                //swal("Sorry can not remove", "This customer is already used!");
            } else {
                destroyAction(
                    Customer, {_id: id}, {title: 'Customer', customerTitle: id}
                );
            }
Example #2
0
//on rendered
newTmpl.onCreated(function () {
    this.branch = new ReactiveVar();
    Meteor.call('getBranch', Session.get('currentBranch'), (err, result)=> {
        if (result) {
            this.branch.set(result);
        } else {
            console.log(err);
        }

    })
});
// New
newTmpl.events({
    'click .add-new-customer'(event, instance){
        alertify.customer(fa('plus', 'New Customer'), renderTemplate(Template.Pos_customerNew));
    },
    'click .go-to-receive-payment'(event, instance){
        alertify.ringPullTransfer().close();
    },
    'change [name=customerId]'(event, instance){
        if (event.currentTarget.value != '') {
            Session.set('getCustomerId', event.currentTarget.value);
            if (FlowRouter.query.get('customerId')) {
                FlowRouter.query.set('customerId', event.currentTarget.value);
            }
        }
        Session.set('totalOrder', undefined);
    },
});
newTmpl.helpers({
Example #3
0
                },
                headerClass: function () {
                    let css = 'text-center col-action';
                    return css;
                },
                tmpl: actionTmpl, sortable: false
            }
        ];

        return reactiveTableSettings;
    }
});

indexTmpl.events({
    'click .js-create' (event, instance) {
        alertify.customer(fa('plus', TAPi18n.__('acc.customer.title')), renderTemplate(newTmpl));
    },
    'click .js-update' (event, instance) {
        alertify.customer(fa('pencil', TAPi18n.__('acc.customer.title')), renderTemplate(editTmpl, this));
    },
    'click .js-destroy' (event, instance) {
        destroyAction(
            Customer,
            {_id: this._id},
            {title: TAPi18n.__('acc.customer.title'), itemTitle: this._id}
        );
    },
    'click .js-display' (event, instance) {
        alertify.customerShow(fa('eye', TAPi18n.__('acc.customer.title')), renderTemplate(showTmpl, this));
    }
});