Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
start work on billing, batch payments in particular
Browse files Browse the repository at this point in the history
  • Loading branch information
gte451f committed Dec 10, 2015
1 parent c51dba4 commit 62c0746
Show file tree
Hide file tree
Showing 25 changed files with 325 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/models/payment-batch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import DS from 'ember-data';

export default DS.Model.extend({
paymentMethod: DS.attr('string'),
status: DS.attr('string'),
amountFailed: DS.attr('number'),
amountProcessed: DS.attr('number'),
failCount: DS.attr('number'),
successCount: DS.attr('number'),
createdOn: DS.attr('date'),
processedOn: DS.attr('date'),

createdBy: DS.belongsTo('user', { async: true }),
payments: DS.hasMany('request', {
async: false
})

});
3 changes: 3 additions & 0 deletions app/models/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export default DS.Model.extend({
}),
check: DS.belongsTo('check', {
async: false
}),
paymentBatch: DS.belongsTo('payment-batch', {
async: false
})
})
;
5 changes: 5 additions & 0 deletions app/pods/billing/batch/add/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default Ember.Controller.extend({
breadCrumb: 'New Batch'
});
4 changes: 4 additions & 0 deletions app/pods/billing/batch/add/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Route.extend({
});
1 change: 1 addition & 0 deletions app/pods/billing/batch/add/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Add Batch</h1>
5 changes: 5 additions & 0 deletions app/pods/billing/batch/info/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default Ember.Controller.extend({
breadCrumb: 'Batch Info'
});
13 changes: 13 additions & 0 deletions app/pods/billing/batch/info/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Ember from 'ember';

export default Ember.Route.extend({
model: function (params) {
return this.store.find('payment-batch', {id: params.payment_batch_id, with: 'all'});
},

setupController(controller, resolved) {
var model = resolved.get('firstObject');
this._super(controller, model);
}

});
85 changes: 85 additions & 0 deletions app/pods/billing/batch/info/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<h1>Show Batch</h1>
<div class="row">
<div class="col-md-5">
<!-- Default box -->
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title"></h3>

<div class="box-tools">
<div class="btn-group pull-right">
<button class="btn btn-default btn-sm">{{fa-icon "trash"}} Delete</button>
<button class="btn btn-default btn-sm">{{fa-icon "trash"}} Print?</button>
</div>
</div>
</div>
<div class="box-body">
<dl class="dl-horizontal">
<dt>Created By</dt>
<dd>{{model.createdBy.firstName}} {{model.createdBy.lastName}}</dd>
<dt>Processed On</dt>
<dd>{{moment model.processedOn 'MM-DD-YYYY'}}</dd>
<dt>Status</dt>
<dd>{{model.status}}</dd>
<dt>Payment Method</dt>
<dd>{{model.paymentMethod}}</dd>
<dt>Amount Processed</dt>
<dd>
<span class="pull-left badge bg-green"
style="margin-left: 5px;">{{format-money model.amountProcessed}}</span>
<span class="pull-right badge bg-red"
style="margin-right: 10px;">{{format-money model.amountFailed}}</span>
</dd>
<dt>Transactions Processed</dt>
<dd>
<span class="pull-left badge bg-green" style="margin-left: 5px;">{{model.successCount}}</span>
<span class="pull-right badge bg-red" style="margin-right: 10px;">{{model.failCount}}</span>
</dd>
</dl>
</div>
<div class="box-footer"></div>
</div>
<!-- /.box -->
</div>


<div class="col-md-7">
<div class="box box-success box-solid">
<div class="box-header with-border">
<h3 class="box-title">Removable</h3>

<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool">
{{fa-icon "plus"}}
</button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
The body of the box
</div>
<!-- /.box-body -->
</div>
</div>

<div class="col-md-7">
<div class="box box-success box-solid">
<div class="box-header with-border">
<h3 class="box-title">Removable</h3>

<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool">
{{fa-icon "plus"}}
</button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
The body of the box
</div>
<!-- /.box-body -->
</div>
</div>
</div>
6 changes: 6 additions & 0 deletions app/pods/billing/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Ember from 'ember';

export default Ember.Controller.extend({
breadCrumb: 'Billing Dashboard',
breadCrumbPath: 'billing.dash'
});
5 changes: 5 additions & 0 deletions app/pods/billing/dash/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default Ember.Controller.extend({
breadCrumb: "Billing Dashboard"
});
7 changes: 7 additions & 0 deletions app/pods/billing/dash/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Ember from 'ember';

export default Ember.Route.extend({
model: function (params) {
return this.store.findAll('payment-batch');
},
});
30 changes: 30 additions & 0 deletions app/pods/billing/dash/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="row">
<div class="col-md-4">
<div class="box box-widget widget-user-2">
<!-- Add the bg color to the header using any of the bg-* classes -->
<div class="widget-user-header bg-yellow">
<h3 class="widget-user-username">Batch Billing
{{#link-to 'billing.batch.add' class="btn btn-default btn-sm pull-right"}}Add{{/link-to}}
</h3>
<h5 class="widget-user-desc">Bill multiple accounts based on common rules</h5>
</div>
<div class="box-footer no-padding">
<ul class="nav nav-stacked">
{{#each model as |record| }}
<li>
{{#link-to 'billing.batch.info' record.id}}
{{record.status}} - {{moment record.processedOn 'MM-DD-YYYY'}}
<span class="pull-right badge bg-green">{{format-money record.amountProcessed}}</span>
<span class="pull-right badge bg-red"
style="margin-right: 5px;;">{{format-money record.amountFailed}}</span>
{{/link-to}}
</li>
{{/each}}
</ul>
</div>
</div>
</div>
<div class="col-md-4">
<h3>Invoices</h3>
</div>
</div>
4 changes: 4 additions & 0 deletions app/pods/billing/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Route.extend({
});
21 changes: 21 additions & 0 deletions app/pods/billing/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="wrapper">
{{partial "navigation/setup-header"}}
{{partial "navigation/main-sidebar"}}
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" style="min-height: 1068px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Billing & Payments
</h1>
{{partial "navigation/main-breadcrumb"}}
</section>
<!-- Main content -->
<section class="content">
{{outlet}}
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
{{partial "navigation/main-footer"}}
</div>
7 changes: 7 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ Router.map(function () {
this.route('edit', {"path": "edit/:employee_id"});
this.route('info', {"path": "info/:employee_id"});
});
this.route('billing', function () {
this.route('dash');
this.route('batch', function () {
this.route('info', {"path": "info/:payment_batch_id"});
this.route('add');
});
});
});

export default Router;
7 changes: 7 additions & 0 deletions app/templates/navigation/main-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
{{fa-icon "angle-left" classNames="pull-right"}}
{{/link-to}}
</li>
<li>
{{#link-to 'billing.dash'}}
{{fa-icon "usd"}}
<span>Billing</span>
{{fa-icon "angle-left" classNames="pull-right"}}
{{/link-to}}
</li>
<li>
{{#link-to 'setup'}}
<span class="glyphicon glyphicon-tent menu-icon"></span>
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/models/payment-batch-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleForModel, test } from 'ember-qunit';

moduleForModel('payment-batch', 'Unit | Model | payment batch', {
// Specify the other units that are required for this test.
needs: []
});

test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
assert.ok(!!model);
});
12 changes: 12 additions & 0 deletions tests/unit/pods/billing/batch/add/controller-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('controller:billing/batch/add', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
var controller = this.subject();
assert.ok(controller);
});
11 changes: 11 additions & 0 deletions tests/unit/pods/billing/batch/add/route-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:billing/batch/add', 'Unit | Route | billing/batch/add', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});
12 changes: 12 additions & 0 deletions tests/unit/pods/billing/batch/info/controller-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('controller:billing/batch/info', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
var controller = this.subject();
assert.ok(controller);
});
11 changes: 11 additions & 0 deletions tests/unit/pods/billing/batch/info/route-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:billing/batch/info', 'Unit | Route | billing/batch/info', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});
12 changes: 12 additions & 0 deletions tests/unit/pods/billing/controller-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('controller:billing', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
var controller = this.subject();
assert.ok(controller);
});
12 changes: 12 additions & 0 deletions tests/unit/pods/billing/dash/controller-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('controller:billing/dash', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
var controller = this.subject();
assert.ok(controller);
});
11 changes: 11 additions & 0 deletions tests/unit/pods/billing/dash/route-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:billing/dash', 'Unit | Route | billing/dash', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});
11 changes: 11 additions & 0 deletions tests/unit/pods/billing/route-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:billing', 'Unit | Route | billing', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});

0 comments on commit 62c0746

Please sign in to comment.