diff --git a/Conversion/Converter.vshost.exe b/Conversion/Converter.vshost.exe
deleted file mode 100644
index 58da5217..00000000
Binary files a/Conversion/Converter.vshost.exe and /dev/null differ
diff --git a/Conversion/Converter.vshost.exe.config b/Conversion/Converter.vshost.exe.config
deleted file mode 100644
index 5fdb54fc..00000000
--- a/Conversion/Converter.vshost.exe.config
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Conversion/Logs/converter.log b/Conversion/Logs/converter.log
deleted file mode 100644
index e69de29b..00000000
diff --git a/brewman/brewman/__init__.py b/brewman/brewman/__init__.py
index 75c6cc13..e406ba76 100644
--- a/brewman/brewman/__init__.py
+++ b/brewman/brewman/__init__.py
@@ -44,13 +44,6 @@ def main(global_config, **settings):
config.add_route('login', '/login')
config.add_route('logout', '/logout')
- config.add_route('contact', '/contact')
- config.add_route('json_test', '/json')
- config.add_route('blog_add', '/blog/new')
- config.add_route('blog_post', '/post/{id}')
- config.add_route('blog', '/blog')
- config.add_route('gallery', '/gallery')
- config.add_route('upload_picture', '/upload')
config.add_route('home', '/')
config.add_route('cost_center_id', '/CostCenter/{id}')
@@ -107,12 +100,12 @@ def main(global_config, **settings):
config.add_route('ledger_id', '/Ledger/{id}')
config.add_route('ledger', '/Ledger')
+ config.add_route('product_ledger_id', '/ProductLedger/{id}')
+ config.add_route('product_ledger', '/ProductLedger')
+
config.add_route('trial_balance_date', '/TrialBalance/{date}')
config.add_route('trial_balance', '/TrialBalance')
- config.add_route('product_ledger_id', '/Reports/ProductLedger/{id}')
- config.add_route('product_ledger', '/Reports/ProductLedger')
-
config.add_route('cash_flow_id', '/Reports/CashFlow/{id}')
config.add_route('cash_flow', '/Reports/CashFlow')
diff --git a/brewman/brewman/static/partial/home.html b/brewman/brewman/static/partial/home.html
new file mode 100644
index 00000000..e55e9fc9
--- /dev/null
+++ b/brewman/brewman/static/partial/home.html
@@ -0,0 +1,8 @@
+
@@ -35,24 +35,24 @@
- | {{item.Date}} |
- {{item.Name}} |
- {{item.Type}} |
- {{item.Narration}} |
- {{item.Debit}} |
- {{item.Credit}} |
- {{item.Running}} |
+ {{item.Date}} |
+ {{item.Name}} |
+ {{item.Type}} |
+ {{item.Narration}} |
+ {{item.Debit}} |
+ {{item.Credit}} |
+ {{item.Running}} |
- | {{info.Footer.Date}} |
- {{info.Footer.Name}} |
- {{info.Footer.Type}} |
- {{info.Footer.Narration}} |
- {{info.Footer.Debit}} |
- {{info.Footer.Credit}} |
- {{info.Footer.Running}} |
+ {{info.Footer.Date}} |
+ {{info.Footer.Name}} |
+ {{info.Footer.Type}} |
+ {{info.Footer.Narration}} |
+ {{info.Footer.Debit}} |
+ {{info.Footer.Credit}} |
+ {{info.Footer.Running}} |
diff --git a/brewman/brewman/static/partial/product-ledger.html b/brewman/brewman/static/partial/product-ledger.html
new file mode 100644
index 00000000..e2df291b
--- /dev/null
+++ b/brewman/brewman/static/partial/product-ledger.html
@@ -0,0 +1,70 @@
+
diff --git a/brewman/brewman/static/scripts/angular_service.js b/brewman/brewman/static/scripts/angular_service.js
index 84b2eb38..c7f3e518 100644
--- a/brewman/brewman/static/scripts/angular_service.js
+++ b/brewman/brewman/static/scripts/angular_service.js
@@ -1,72 +1,5 @@
var overlord_service = angular.module('overlord.service', ['ngResource']);
-overlord_service.factory('get_voucher', ['$http', function ($http) {
- return function (scope) {
- $http.post('', scope.voucher).
- success(function (data, status) {
- scope.voucher = data;
- scope.toasts.push({Type:'Success', Message:data.Code});
- }).
- error(function (data, status) {
- scope.toasts.push({Type:'Error', Message:data});
- });
- };
-}]);
-
-overlord_service.factory('save_voucher', ['$http', function ($http) {
- return function (scope) {
- $http.post('', scope.voucher).
- success(function (data, status) {
- scope.voucher = data;
- scope.toasts.push({Type:'Success', Message:data.Code});
- }).
- error(function (data, status) {
- scope.toasts.push({Type:'Error', Message:data});
- });
- };
-}]);
-
-overlord_service.factory('delete_voucher', ['$http', function ($http) {
- return function (scope) {
- $http.post(delete_url, {}).
- success(function (data, status) {
- scope.voucher = {};
- scope.toasts.push({Type:'Success', Message:data.Code});
- }).
- error(function (data, status) {
- scope.toasts.push({Type:'Error', Message:data});
- });
- };
-}]);
-
-overlord_service.factory('post_voucher', ['$http', function ($http) {
- return function (scope) {
- $http.post(post_url, {}).
- success(function (data, status) {
- scope.voucher.Posted = true;
- scope.voucher.Poster = data.name;
- scope.toasts.push({Type:'Success', Message:data.Code});
- }).
- error(function (data, status) {
- scope.toasts.push({Type:'Error', Message:data});
- });
- };
-}]);
-
-overlord_service.factory('remove_toast', function () {
- return function (toast) {
- $http.post(post_url, {}).
- success(function (data, status) {
- scope.voucher.Posted = true;
- scope.voucher.Poster = data.name;
- scope.toasts.push({Type:'Success', Message:data.Code});
- }).
- error(function (data, status) {
- scope.toasts.push({Type:'Error', Message:data});
- });
- };
-});
-
// TODO: Replace hardcoded url with route_url
overlord_service.factory('issue_grid', ['$resource', function ($resource) {
return $resource('/Issues/Services/:date');
@@ -93,6 +26,11 @@ overlord_service.factory('Ledger', ['$resource', function ($resource) {
return $resource('/Ledger/:id');
}]);
+// TODO: Replace hardcoded url with route_url
+overlord_service.factory('ProductLedger', ['$resource', function ($resource) {
+ return $resource('/ProductLedger/:id');
+}]);
+
// TODO: Replace hardcoded url with route_url
overlord_service.factory('Permission', ['$resource', function ($resource) {
return $resource('/Permissions');
@@ -144,11 +82,6 @@ overlord_service.factory('CostCenter', ['$resource', function ($resource) {
}]);
-// TODO: Replace hardcoded url with route_url
-overlord_service.factory('TrialBalance', ['$resource', function ($resource) {
- return $resource('/TrialBalance/:date');
-}]);
-
// TODO: Replace hardcoded url with route_url
overlord_service.factory('TrialBalance', ['$resource', function ($resource) {
return $resource('/TrialBalance/:date');
diff --git a/brewman/brewman/static/scripts/autocomplete.js b/brewman/brewman/static/scripts/autocomplete.js
index 33e32f1d..ff849582 100644
--- a/brewman/brewman/static/scripts/autocomplete.js
+++ b/brewman/brewman/static/scripts/autocomplete.js
@@ -1,50 +1,4 @@
-var overlord = angular.module('overlord', ['overlord.directive', 'overlord.filter', 'overlord.service']).
- config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
- $routeProvider.
- when('/Journal', {templateUrl: '/partial/journal.html', controller: JournalCtrl}).
- when('/Journal/:id', {templateUrl: '/partial/journal.html', controller: JournalCtrl}).
-
- when('/Payment', {templateUrl: '/partial/payment.html', controller: PaymentCtrl}).
- when('/Payment/:id', {templateUrl: '/partial/payment.html', controller: PaymentCtrl}).
-
- when('/Receipt', {templateUrl: '/partial/receipt.html', controller: ReceiptCtrl}).
- when('/Receipt/:id', {templateUrl: '/partial/receipt.html', controller: ReceiptCtrl}).
-
- when('/Purchase', {templateUrl: '/partial/purchase.html', controller: PurchaseCtrl}).
- when('/Purchase/:id', {templateUrl: '/partial/purchase.html', controller: PurchaseCtrl}).
-
- when('/Issue', {templateUrl: '/partial/issue.html', controller: IssueCtrl}).
- when('/Issue/:id', {templateUrl: '/partial/issue.html', controller: IssueCtrl}).
-
- when('/Ledger', {templateUrl: '/partial/ledger.html', controller: LedgerCtrl}).
- when('/Ledger/:id', {templateUrl: '/partial/ledger.html', controller: LedgerCtrl}).
-
- when('/TrialBalance', {templateUrl: '/partial/trial-balance.html', controller: TrialBalanceCtrl}).
- when('/TrialBalance/:date', {templateUrl: '/partial/trial-balance.html', controller: TrialBalanceCtrl}).
-
- when('/Accounts', {templateUrl: '/partial/account-list.html', controller: AccountListCtrl}).
- when('/Account', {templateUrl: '/partial/account-detail.html', controller: AccountCtrl}).
- when('/Account/:id', {templateUrl: '/partial/account-detail.html', controller: AccountCtrl}).
-
- when('/CostCenters', {templateUrl: '/partial/cost-center-list.html', controller: CostCenterListCtrl}).
- when('/CostCenter', {templateUrl: '/partial/cost-center-detail.html', controller: CostCenterCtrl}).
- when('/CostCenter/:id', {templateUrl: '/partial/cost-center-detail.html', controller: CostCenterCtrl}).
-
- when('/Products', {templateUrl: '/partial/product-list.html', controller: ProductListCtrl}).
- when('/Product', {templateUrl: '/partial/product-detail.html', controller: ProductCtrl}).
- when('/Product/:id', {templateUrl: '/partial/product-detail.html', controller: ProductCtrl}).
-
- when('/ProductGroups', {templateUrl: '/partial/product-group-list.html', controller: ProductGroupListCtrl}).
- when('/ProductGroup', {templateUrl: '/partial/product-group-detail.html', controller: ProductGroupCtrl}).
- when('/ProductGroup/:id', {templateUrl: '/partial/product-group-detail.html', controller: ProductGroupCtrl}).
-
- when('/Users', {templateUrl: '/partial/user-list.html', controller: UserListCtrl}).
- when('/User', {templateUrl: '/partial/user-detail.html', controller: UserCtrl}).
- when('/User/:id', {templateUrl: '/partial/user-detail.html', controller: UserCtrl});
-// .otherwise({redirectTo: '/phones'});
- $locationProvider.html5Mode(true);
-}]);
-function AutoComplete(matchFieldName, lookupURL) {
+function AutoComplete(matchFieldName, lookupURL) {
$(matchFieldName).autocomplete({
source:function (request, response) {
$.ajax({
@@ -66,20 +20,3 @@ function AutoComplete(matchFieldName, lookupURL) {
autoFocus:true
});
}
-
-
-
-function BaseCtrl($scope, Permission) {
- $scope.perms = Permission.get();
-
- $scope.toasts = [];
- $scope.clearToast = function(item) {
- var idx = $scope.toasts.indexOf(item);
- if (idx !== -1) {
- //injected into repeater scope by fadey directive
- this.destroy(function() {
- $scope.toasts.splice(idx, 1);
- });
- }
- };
-}
diff --git a/brewman/brewman/static/scripts/issue.js b/brewman/brewman/static/scripts/issue.js
index cf409d53..b4161e3a 100644
--- a/brewman/brewman/static/scripts/issue.js
+++ b/brewman/brewman/static/scripts/issue.js
@@ -1,5 +1,6 @@
function IssueCtrl($scope, $routeParams, $location, Voucher, CostCenter, issue_grid) {
if (typeof $routeParams.id === 'undefined') {
+// $scope.voucher = Voucher.get({type:'Issue', date:$routeParams.Date, source:$routeParams.Source, destination:$routeParams.Destination});
$scope.voucher = Voucher.get({type:'Issue'});
} else {
$scope.voucher = Voucher.get({id:$routeParams.id});
@@ -60,7 +61,7 @@
}
var doUpdate = false;
- if (typeof oldJournals !== 'undefined' && typeof $scope.source === 'undefined' ) {
+ if (typeof oldJournals !== 'undefined' && typeof $scope.source === 'undefined') {
for (var i = 0, l = oldJournals.length; i < l; i++) {
if (oldJournals[i].Debit === -1) {
$scope.source = oldJournals[i].CostCenter.CostCenterID;
@@ -74,13 +75,13 @@
if (!doUpdate) {
for (var i = 0, l = newJournals.length; i < l; i++) {
if (newJournals[i].Debit === -1) {
- if (newJournals[i].CostCenter.CostCenterID != $scope.source){
+ if (newJournals[i].CostCenter.CostCenterID != $scope.source) {
$scope.source = newJournals[i].CostCenter.CostCenterID;
doUpdate = true;
}
} else {
- if (newJournals[i].CostCenter.CostCenterID != $scope.destination){
+ if (newJournals[i].CostCenter.CostCenterID != $scope.destination) {
$scope.destination = newJournals[i].CostCenter.CostCenterID;
doUpdate = true;
}
@@ -106,8 +107,9 @@
}, true);
$scope.resetVoucher = function (voucherid) {
+// $location.path('/Issue').search({Date:voucher.Date, Source:'', Destination:''});
$scope.voucher = Voucher.get({id:voucherid, type:'Issue'}, function (u, putResponseHeaders) {
- $location.path('/Issue')
+ $location.path('/Issue');
}, function (data, status) {
$scope.toasts.push({Type:'Error', Message:data.data});
});
@@ -115,7 +117,7 @@
$scope.get = function (voucherid) {
$scope.voucher = Voucher.get({id:voucherid}, function (u, putResponseHeaders) {
- $location.path('/Issue/' + u.VoucherID)
+ $location.path('/Issue/' + u.VoucherID);
}, function (data, status) {
$scope.toasts.push({Type:'Error', Message:data.data});
});
@@ -123,7 +125,7 @@
$scope.save = function () {
$scope.voucher.$save(function (u, putResponseHeaders) {
- $location.path('/Issue/' + u.VoucherID)
+ $location.path('/Issue/' + u.VoucherID);
$scope.toasts.push({Type:'Success', Message:u.Code});
$scope.updateGrid();
}, function (data, status) {
@@ -133,7 +135,7 @@
$scope.delete = function () {
$scope.voucher.$delete(function (u, putResponseHeaders) {
- $location.path('/Issue')
+ $location.path('/Issue').replace();
$scope.toasts.push({Type:'Success', Message:''});
$scope.updateGrid();
}, function (data, status) {
diff --git a/brewman/brewman/static/scripts/ledger.js b/brewman/brewman/static/scripts/ledger.js
index 147092c6..b40253b5 100644
--- a/brewman/brewman/static/scripts/ledger.js
+++ b/brewman/brewman/static/scripts/ledger.js
@@ -16,3 +16,15 @@
};
$('#txtLedger').focus();
}
+
+//LedgerCtrl.resolve = {
+// ledger_data:function ($route, Ledger) {
+// var params = $route.current.params;
+// if (typeof params.id === 'undefined') {
+// return Ledger.get({});
+// } else {
+// return Ledger.get({id:params.id, StartDate:params.StartDate, FinishDate:params.FinishDate});
+//
+// }
+// }
+//}
\ No newline at end of file
diff --git a/brewman/brewman/static/scripts/overlord.js b/brewman/brewman/static/scripts/overlord.js
new file mode 100644
index 00000000..adf5c212
--- /dev/null
+++ b/brewman/brewman/static/scripts/overlord.js
@@ -0,0 +1,71 @@
+'use strict';
+
+var overlord = angular.module('overlord', ['overlord.directive', 'overlord.filter', 'overlord.service']).
+ config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
+ $routeProvider.
+ when('/', {templateUrl:'/partial/home.html'}).
+
+ when('/Journal', {templateUrl:'/partial/journal.html', controller:JournalCtrl}).
+ when('/Journal/:id', {templateUrl:'/partial/journal.html', controller:JournalCtrl}).
+
+ when('/Payment', {templateUrl:'/partial/payment.html', controller:PaymentCtrl}).
+ when('/Payment/:id', {templateUrl:'/partial/payment.html', controller:PaymentCtrl}).
+
+ when('/Receipt', {templateUrl:'/partial/receipt.html', controller:ReceiptCtrl}).
+ when('/Receipt/:id', {templateUrl:'/partial/receipt.html', controller:ReceiptCtrl}).
+
+ when('/Purchase', {templateUrl:'/partial/purchase.html', controller:PurchaseCtrl}).
+ when('/Purchase/:id', {templateUrl:'/partial/purchase.html', controller:PurchaseCtrl}).
+
+ when('/Issue', {templateUrl:'/partial/issue.html', controller:IssueCtrl}).
+ when('/Issue/:id', {templateUrl:'/partial/issue.html', controller:IssueCtrl}).
+
+ when('/Ledger', {templateUrl:'/partial/ledger.html', controller:LedgerCtrl}).
+ when('/Ledger/:id', {templateUrl:'/partial/ledger.html', controller:LedgerCtrl}).
+
+ when('/ProductLedger', {templateUrl:'/partial/product-ledger.html', controller:ProductLedgerCtrl}).
+ when('/ProductLedger/:id', {templateUrl:'/partial/product-ledger.html', controller:ProductLedgerCtrl}).
+
+// when('/Ledger', {templateUrl:'/partial/ledger.html', controller:LedgerCtrl, resolve: LedgerCtrl.resolve}).
+// when('/Ledger/:id', {templateUrl:'/partial/ledger.html', controller:LedgerCtrl, resolve: LedgerCtrl.resolve}).
+
+ when('/TrialBalance', {templateUrl:'/partial/trial-balance.html', controller:TrialBalanceCtrl}).
+ when('/TrialBalance/:date', {templateUrl:'/partial/trial-balance.html', controller:TrialBalanceCtrl}).
+
+ when('/Accounts', {templateUrl:'/partial/account-list.html', controller:AccountListCtrl}).
+ when('/Account', {templateUrl:'/partial/account-detail.html', controller:AccountCtrl}).
+ when('/Account/:id', {templateUrl:'/partial/account-detail.html', controller:AccountCtrl}).
+
+ when('/CostCenters', {templateUrl:'/partial/cost-center-list.html', controller:CostCenterListCtrl}).
+ when('/CostCenter', {templateUrl:'/partial/cost-center-detail.html', controller:CostCenterCtrl}).
+ when('/CostCenter/:id', {templateUrl:'/partial/cost-center-detail.html', controller:CostCenterCtrl}).
+
+ when('/Products', {templateUrl:'/partial/product-list.html', controller:ProductListCtrl}).
+ when('/Product', {templateUrl:'/partial/product-detail.html', controller:ProductCtrl}).
+ when('/Product/:id', {templateUrl:'/partial/product-detail.html', controller:ProductCtrl}).
+
+ when('/ProductGroups', {templateUrl:'/partial/product-group-list.html', controller:ProductGroupListCtrl}).
+ when('/ProductGroup', {templateUrl:'/partial/product-group-detail.html', controller:ProductGroupCtrl}).
+ when('/ProductGroup/:id', {templateUrl:'/partial/product-group-detail.html', controller:ProductGroupCtrl}).
+
+ when('/Users', {templateUrl:'/partial/user-list.html', controller:UserListCtrl}).
+ when('/User', {templateUrl:'/partial/user-detail.html', controller:UserCtrl}).
+ when('/User/:id', {templateUrl:'/partial/user-detail.html', controller:UserCtrl});
+// .otherwise({redirectTo: '/phones'});
+ $locationProvider.html5Mode(true);
+}]);
+
+function BaseCtrl($scope, Permission) {
+ $scope.perms = Permission.get();
+
+ $scope.toasts = [];
+ $scope.clearToast = function (item) {
+ var idx = $scope.toasts.indexOf(item);
+ if (idx !== -1) {
+ //injected into repeater scope by fadey directive
+ this.destroy(function () {
+ $scope.toasts.splice(idx, 1);
+ });
+ }
+ };
+}
diff --git a/brewman/brewman/static/scripts/product-ledger.js b/brewman/brewman/static/scripts/product-ledger.js
new file mode 100644
index 00000000..61ee1703
--- /dev/null
+++ b/brewman/brewman/static/scripts/product-ledger.js
@@ -0,0 +1,18 @@
+function ProductLedgerCtrl($scope, $routeParams, $location, ProductLedger) {
+ if (typeof $routeParams.id === 'undefined') {
+ $scope.info = ProductLedger.get({});
+ } else {
+ $scope.info = ProductLedger.get({id:$routeParams.id, StartDate:$routeParams.StartDate, FinishDate:$routeParams.FinishDate});
+
+ }
+ $scope.show = function () {
+ $scope.info = ProductLedger.get({id:$scope.info.Product.ProductID, StartDate:$scope.info.StartDate, FinishDate:$scope.info.FinishDate}, function (u, putResponseHeaders) {
+ $location.path('/ProductLedger/' + u.Product.ProductID);
+ $location.search('StartDate', u.StartDate);
+ $location.search('FinishDate', u.FinishDate);
+ }, function (data, status) {
+ $scope.toasts.push({Type:'Error', Message:data.data});
+ });
+ };
+ $('#txtProduct').focus();
+}
diff --git a/brewman/brewman/static/scripts/productledger.js b/brewman/brewman/static/scripts/productledger.js
deleted file mode 100644
index 8007f153..00000000
--- a/brewman/brewman/static/scripts/productledger.js
+++ /dev/null
@@ -1,28 +0,0 @@
-function Populate(vouchers, editUrl) {
- if (vouchers != null) {
- var stateObj = { 'LedgerID':vouchers.id, 'Name':vouchers.name, 'StartDate':vouchers.start_date, 'FinishDate':vouchers.finish_date };
- history.pushState(stateObj, 'Display', vouchers.url);
- $('#txtProduct').val(vouchers.name);
- $('#tbodyMain').html(vouchers.body);
- $('#tfootMain').html(vouchers.footer);
- }
-}
-
-function Show(productString, productID, startDate, finishDate) {
- $.ajax({
- type:"POST",
- contentType:"application/json; charset=utf-8",
- url:show_url,
- data:JSON.stringify({ productString:productString, productID: productID, startDate:startDate, finishDate:finishDate }),
- dataType:"json",
- success:function (response) {
- Populate(response);
- },
- error:function (jqXHR, textStatus) {
- $("#ctl00_statusDiv").removeClass().addClass("error");
- var msg = $.parseJSON(jqXHR.responseText).Message;
- $("#ctl00_statusDiv").html(msg);
- }
- });
- return false;
-}
diff --git a/brewman/brewman/templates/angular_base.mako b/brewman/brewman/templates/angular_base.mako
index 11c9eabf..d414a59e 100644
--- a/brewman/brewman/templates/angular_base.mako
+++ b/brewman/brewman/templates/angular_base.mako
@@ -26,12 +26,7 @@
${h.JsLink(request, 'angular-1.0.1.js')}
${h.JsLink(request, 'angular-resource-1.0.1.js')}
-
-
- ${h.ScriptLink(request, 'autocomplete.js')}
+ ${h.ScriptLink(request, 'overlord.js')}
${h.ScriptLink(request, 'angular_directive.js')}
${h.ScriptLink(request, 'angular_filter.js')}
${h.ScriptLink(request, 'angular_service.js')}
@@ -44,6 +39,7 @@
${h.ScriptLink(request, 'issue.js')}
${h.ScriptLink(request, 'ledger.js')}
+ ${h.ScriptLink(request, 'product-ledger.js')}
${h.ScriptLink(request, 'trial_balance.js')}
${h.ScriptLink(request, 'account.js')}
diff --git a/brewman/brewman/templates/base.mako b/brewman/brewman/templates/base.mako
index 2b84378c..dba9acc3 100644
--- a/brewman/brewman/templates/base.mako
+++ b/brewman/brewman/templates/base.mako
@@ -31,26 +31,8 @@
${h.ScriptLink(request, 'autocomplete.js')}
- ${h.ScriptLink(request, 'angular_directive.js')}
- ${h.ScriptLink(request, 'angular_filter.js')}
- ${h.ScriptLink(request, 'angular_service.js')}
${h.ScriptLink(request, 'session.js')}
- ${h.ScriptLink(request, 'journal.js')}
- ${h.ScriptLink(request, 'payment.js')}
- ${h.ScriptLink(request, 'receipt.js')}
- ${h.ScriptLink(request, 'purchase.js')}
- ${h.ScriptLink(request, 'issue.js')}
-
- ${h.ScriptLink(request, 'ledger.js')}
- ${h.ScriptLink(request, 'trial_balance.js')}
-
- ${h.ScriptLink(request, 'account.js')}
- ${h.ScriptLink(request, 'user.js')}
- ${h.ScriptLink(request, 'cost-center.js')}
- ${h.ScriptLink(request, 'product.js')}
- ${h.ScriptLink(request, 'product-group.js')}
-
<%block name="header" />
diff --git a/brewman/brewman/templates/home.mako b/brewman/brewman/templates/home.mako
deleted file mode 100644
index 038b172b..00000000
--- a/brewman/brewman/templates/home.mako
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-<%inherit file="base.mako"/>
-<%block name="content">
-
-
Hello, world!
-
This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.
-
Learn more »
-
-%block>
diff --git a/brewman/brewman/templates/reports/product_ledger.mako b/brewman/brewman/templates/reports/product_ledger.mako
deleted file mode 100644
index a5a7cd3a..00000000
--- a/brewman/brewman/templates/reports/product_ledger.mako
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-<%inherit file="../base.mako"/>
-<%block name="header">
- ${h.ScriptLink(request, 'productledger.js')}
-
-%block>
-<%block name="content">
-
-
-%block>
\ No newline at end of file
diff --git a/brewman/brewman/views/__init__.py b/brewman/brewman/views/__init__.py
index 0de9dd23..2e3573ad 100644
--- a/brewman/brewman/views/__init__.py
+++ b/brewman/brewman/views/__init__.py
@@ -1,6 +1,13 @@
from decimal import Decimal
import json
import uuid
+from pyramid.view import view_config
+
+@view_config(route_name='home', renderer='brewman:templates/angular_base.mako')
+def home(request):
+ return {}
+
+
class DecimalAsFloatHack(float):
def __init__(self, d):
diff --git a/brewman/brewman/views/other_views.py.exclude b/brewman/brewman/views/other_views.py.exclude
deleted file mode 100644
index c4af01dc..00000000
--- a/brewman/brewman/views/other_views.py.exclude
+++ /dev/null
@@ -1,48 +0,0 @@
-from brewman.models import DBSession, BeerType, Brew
-
-
-def list_beer_types(request):
- dbsession = DBSession()
- list = dbsession.query(BeerType).all()
- return {'list':list, 'project':'brewman'}
-
-def show_beer_type(request):
- id = request.matchdict['id']
- dbsession = DBSession()
- item = dbsession.query(BeerType).filter(BeerType.id==id).one()
- return {'item':item, 'title':item.name, 'project':'brewman', 'top_block': page_title_and_breadcrumb(request)}
-
-def add_beer_type(request):
-# id = request.matchdict['id']
-# dbsession = DBSession()
-# item = dbsession.query(BeerType).filter_by(id==id).one()
- return {'title':'Add Beer Style', 'pageclass': "class page-contacts page-sidebar-right", 'top_block': page_title_and_breadcrumb(request)}
-
-def edit_beer_type(request):
- id = request.matchdict['id']
- dbsession = DBSession()
- item = dbsession.query(BeerType).filter_by(id==id).one()
- return {'item':item, 'project':'brewman'}
-
-def list_brews(request):
- dbsession = DBSession()
- list = dbsession.query(Brew).all()
- return {'list':list, 'project':'brewman'}
-
-def show_brew(request):
- id = request.matchdict['id']
- dbsession = DBSession()
- item = dbsession.query(Brew).filter_by(id==id).one()
- return {'item':item, 'project':'brewman'}
-
-def add_brew(request):
- id = request.matchdict['id']
- dbsession = DBSession()
- item = dbsession.query(Brew).filter_by(id==id).one()
- return {'item':item, 'project':'brewman'}
-
-def edit_brew(request):
- id = request.matchdict['id']
- dbsession = DBSession()
- item = dbsession.query(Brew).filter_by(id==id).one()
- return {'item':item, 'project':'brewman'}
diff --git a/brewman/brewman/views/pages.py b/brewman/brewman/views/pages.py
index 3ad5d020..19af8f6d 100644
--- a/brewman/brewman/views/pages.py
+++ b/brewman/brewman/views/pages.py
@@ -6,43 +6,8 @@ from pyramid.security import remember, forget
from pyramid.view import view_config
from brewman.models.auth import User
-from brewman.views.widgets import footer, contact_widget, recent_posts, categories, archive
-@view_config(route_name='home', renderer='brewman:templates/home.mako')
-def home(request):
- return {'title': 'Hops n Grains - Welcome'}
-
-
-@view_config(route_name='contact', renderer='brewman:templates/contact.pt')
-def contact(request):
- return {'title': 'Hops n Grains - Contact Us',
- 'pageclass': "page-contacts page-sidebar-right skin-5",
- 'pagecontentclass': "page-content grid_8",
- 'top_block': breadcrumb(request, "Contacts", "Feel free to contact us any time."),
- 'widget1': recent_posts(request),
- 'wid1': "grid_6",
- 'widget2': categories(request),
- 'wid2': "grid_3",
- 'widget3': archive(request),
- 'wid3': "grid_3",
- 'footer': footer(request)}
-
-
-@view_config(route_name='gallery', renderer='brewman:templates/gallery.pt')
-def gallery(request):
- return {'title': 'Hops n Grains - Gallery',
- 'pageclass': "page-gallery",
- 'pagecontentclass': "page-content",
- 'top_block': breadcrumb(request, "Gallery", "Nice and clean gallery grid."),
- 'widget1': tweets(request),
- 'wid1': "grid_4",
- 'widget2': categories(request),
- 'wid2': "grid_4",
- 'widget3': contact_widget(request),
- 'wid3': "grid_4",
- 'footer': footer(request),
- 'widget_comments': comments(request)}
@view_config(context=HTTPNotFound, renderer='brewman:templates/404.mako')
diff --git a/brewman/brewman/views/pages.py.exclude b/brewman/brewman/views/pages.py.exclude
deleted file mode 100644
index 463b9b0a..00000000
--- a/brewman/brewman/views/pages.py.exclude
+++ /dev/null
@@ -1,148 +0,0 @@
-import os
-import random
-import transaction
-
-from pyramid.httpexceptions import HTTPNotFound, HTTPFound
-from pyramid.response import Response
-from pyramid.security import authenticated_userid, remember, forget
-from pyramid.view import view_config
-
-from brewman.models import DBSession, UploadedImage, User
-
-from brewman.views.top_parts import slidernivo, breadcrumb, slider3d, slideraccordion, slidercarousel, sliderstatic, randomslider
-from brewman.views.widgets import footer, widget_gallery, tweets, contact_widget, archive, categories, recent_posts, comments, blog_roll, events
-
-
-@view_config(request_method='POST', route_name='upload_picture', renderer='brewman:templates/upload_picture.pt')
-def upload_picture_submit(request):
- filename = request.POST['picture'].filename
- input_file = request.POST['picture'].file
- comment = request.POST['comment']
- size = request.POST['size']
- file_path = os.getcwd() + '\\brewman\\static\\pictures\\' + filename
- output_file = open(file_path, 'wb')
- input_file.seek(0)
- while 1:
- data = input_file.read(2<<16)
- if not data:
- break
- output_file.write(data)
- output_file.close()
-
- session = DBSession()
- pinf = UploadedImage(location='brewman:static/pictures/' + filename, comment=comment, size=size)
- session.add(pinf)
- session.flush()
- transaction.commit()
-
- return Response(pinf.comment)
-
-@view_config(request_method='GET', route_name='upload_picture', renderer='brewman:templates/upload_picture.pt')
-def upload_picture(request):
- return {'title':'Hops n Grains - Upload a picture',
- 'pageclass': "page-frontpage skin-4",
- 'pagecontentclass': "page-content",
- 'top_block': randomslider(request),
- 'widget1': widget_gallery(request),
- 'wid1': "grid_4",
- 'widget2': tweets(request),
- 'wid2': "grid_4",
- 'widget3': contact_widget(request),
- 'wid3': "grid_4",
- 'footer': footer(request)}
-
-@view_config(route_name='home', renderer='brewman:templates/home.pt')
-def home(request):
- return {'title':'Hops n Grains - Welcome',
- 'pageclass': "page-frontpage skin-2",
- 'pagecontentclass': "page-content",
- 'top_block': randomslider(request),
- 'widget1': widget_gallery(request),
- 'wid1': "grid_4",
- 'widget2': tweets(request),
- 'wid2': "grid_4",
- 'widget3': contact_widget(request),
- 'wid3': "grid_4",
- 'footer': footer(request)}
-
-@view_config(route_name='contact', renderer='brewman:templates/contact.pt')
-def contact(request):
- return {'title':'Hops n Grains - Contact Us',
- 'pageclass': "page-contacts page-sidebar-right skin-5",
- 'pagecontentclass': "page-content grid_8",
- 'top_block': breadcrumb(request, "Contacts", "Feel free to contact us any time."),
- 'widget1': recent_posts(request),
- 'wid1': "grid_6",
- 'widget2': categories(request),
- 'wid2': "grid_3",
- 'widget3': archive(request),
- 'wid3': "grid_3",
- 'footer': footer(request)}
-
-@view_config(route_name='gallery', renderer='brewman:templates/gallery.pt')
-def gallery(request):
- return {'title':'Hops n Grains - Gallery',
- 'pageclass': "page-gallery",
- 'pagecontentclass': "page-content",
- 'top_block': breadcrumb(request, "Gallery", "Nice and clean gallery grid."),
- 'widget1': tweets(request),
- 'wid1': "grid_4",
- 'widget2': categories(request),
- 'wid2': "grid_4",
- 'widget3': contact_widget(request),
- 'wid3': "grid_4",
- 'footer': footer(request),
- 'widget_comments': comments(request)}
-
-@view_config(context=HTTPNotFound, renderer='brewman:templates/404.pt')
-def not_found(request):
- return {'title':'Hops n Grains - 404',
- 'pageclass': "page-404 skin-9",
- 'pagecontentclass': "page-content",
- 'top_block': "",
- 'widget1': tweets(request),
- 'wid1': "grid_4",
- 'widget2': recent_posts(request),
- 'wid2': "grid_4",
- 'widget3': contact_widget(request),
- 'wid3': "grid_4",
- 'footer': footer(request)}
-
-@view_config(request_method='POST', route_name='login', renderer='brewman:templates/login.pt')
-def login_submit(request):
- username = request.POST['username']
- password = request.POST['password']
-
- found, user = User.check_password(username, password)
- if found == True:
- headers = remember(request, user.id)
- request.session.flash(u'Logged in successfully.')
- return HTTPFound(location=request.route_url('home'), headers=headers)
- else:
- return Response('Login Failure')
-
-@view_config(request_method='GET', route_name='login', renderer='brewman:templates/login.pt')
-def login(request):
- return {'title':'Hops n Grains - Login',
- 'pageclass': "page-gallery skin-7",
- 'pagecontentclass': "page-content",
- 'top_block': breadcrumb(request, "Login", "This is the place to login."),
- 'widget1': tweets(request),
- 'wid1': "grid_4",
- 'widget2': recent_posts(request),
- 'wid2': "grid_4",
- 'widget3': contact_widget(request),
- 'wid3': "grid_4",
- 'footer': footer(request)}
-
-@view_config(route_name='logout')
-def logout(request):
- request.session.invalidate()
- request.session.flash(u'Logged out successfully.')
- headers = forget(request)
- return HTTPFound(location=request.route_url('home'), headers=headers)
-
-@view_config(request_method='POST', route_name='json_test', renderer='json', http_cache=0, xhr=True)
-def json_test(request):
- rand = random.randrange(1, 400, 1)
- return {'myid': rand}
diff --git a/brewman/brewman/views/reports/ledger.py b/brewman/brewman/views/reports/ledger.py
index 6f209bc7..643f83d0 100644
--- a/brewman/brewman/views/reports/ledger.py
+++ b/brewman/brewman/views/reports/ledger.py
@@ -114,7 +114,6 @@ def opening_balance(ledgerID, start_date):
creditShow = ""
runningTotal = opening
running = "\u20B9 {0:,.2f}".format(abs(runningTotal)) + (' Dr' if runningTotal >= 0 else ' Cr')
- voucher_type = VoucherType.by_name('Opening Balance')
- return debit, credit, runningTotal, {'Date': start_date, 'Name': voucher_type.name, 'Type': voucher_type.name,
+ return debit, credit, runningTotal, {'Date': start_date, 'Name': 'Opening Balance', 'Type': 'Opening Balance',
'Narration': '', 'Debit': debitShow, 'Credit': creditShow,
'Running': running, 'Posted': True}
diff --git a/brewman/brewman/views/reports/product_ledger.py b/brewman/brewman/views/reports/product_ledger.py
index a8c339d7..e9064d22 100644
--- a/brewman/brewman/views/reports/product_ledger.py
+++ b/brewman/brewman/views/reports/product_ledger.py
@@ -10,31 +10,28 @@ from brewman.models import DBSession
from brewman.models.master import Product, CostCenter
from brewman.models.voucher import Voucher, Journal, VoucherType, Inventory
+from brewman.views.services.session import services_session_period_start, services_session_period_finish
from brewman.views.transactions import get_edit_url
-@view_config(request_method='GET', route_name='product_ledger_id',
- renderer='brewman:templates/reports/product_ledger.mako')
-@view_config(request_method='GET', route_name='product_ledger', renderer='brewman:templates/reports/product_ledger.mako')
+@view_config(request_method='GET', route_name='product_ledger_id', renderer='brewman:templates/angular_base.mako',
+ xhr=False)
+@view_config(request_method='GET', route_name='product_ledger', renderer='brewman:templates/angular_base.mako',
+ xhr=False)
+def ledger_display_get(request):
+ return {}
+
+
def product_ledger_get(request):
product_id = request.matchdict.get('id', None)
- if product_id is None:
- body = ""
- footer = ""
- product = ""
- startDate = Literal(
- "StartDate('#txtStartDate', '{0}');".format(request.route_url('services_session_period_start')))
- finishDate = Literal(
- "FinishDate('#txtFinishDate', '{0}');".format(request.route_url('services_session_period_finish')))
- else:
- product = Product.by_id(uuid.UUID(product_id))
- startDate = request.GET.get('startDate', None)
- finishDate = request.GET.get('finishDate', None)
- report = build_report(request, product, startDate, finishDate)
- body = Literal(report['body'])
- footer = Literal(report['footer'])
- startDate = Literal("$('#txtStartDate').val('{0}');".format(startDate))
- finishDate = Literal("$('#txtFinishDate').val('{0}');".format(finishDate))
- product = Literal("$('#txtProduct').val('{0}');".format(product.full_name))
+ product = Product.by_id(uuid.UUID(product_id))
+ startDate = request.GET.get('startDate', None)
+ finishDate = request.GET.get('finishDate', None)
+ report = build_report(request, product, startDate, finishDate)
+ body = Literal(report['body'])
+ footer = Literal(report['footer'])
+ startDate = Literal("$('#txtStartDate').val('{0}');".format(startDate))
+ finishDate = Literal("$('#txtFinishDate').val('{0}');".format(finishDate))
+ product = Literal("$('#txtProduct').val('{0}');".format(product.full_name))
return {'title': 'Display Ledger - Hops n Grains',
'pageclass': "page-blogpost page-sidebar-right",
@@ -47,6 +44,24 @@ def product_ledger_get(request):
'product': product}
+@view_config(request_method='GET', route_name='product_ledger_id', renderer='json', xhr=True)
+@view_config(request_method='GET', route_name='product_ledger', renderer='json', xhr=True)
+def ledger_display_post(request):
+ id = request.matchdict.get('id', None)
+ if id is None:
+ return {'StartDate': services_session_period_start(request),
+ 'FinishDate': services_session_period_finish(request), 'Product': {}, 'Body': [], 'Footer': {}}
+ else:
+ product = Product.by_id(uuid.UUID(id))
+ start_date = request.GET.get('StartDate', services_session_period_start(request))
+ finish_date = request.GET.get('FinishDate', services_session_period_finish(request))
+ info = {'StartDate': start_date, 'FinishDate': finish_date,
+ 'Product': {'ProductID': product.id, 'Name': product.name},
+ 'Body': [], 'Footer': {}}
+ build_report(request, info)
+ return info
+
+
@view_config(request_method='POST', route_name='product_ledger', renderer='json', xhr=True)
def product_ledger_post(request):
productID = request.json_body['productID']
@@ -61,113 +76,81 @@ def product_ledger_post(request):
return build_report(request, product, startDate, finishDate)
-def build_report(request, product, startDate, finishDate):
- body = ''
- totalDebitQuantity, totalDebitAmount, totalCreditQuantity, totalCreditAmount, runningTotalQuantity, runningTotalAmount, opening = opening_balance(
- product.id, startDate)
- body += opening
+def build_report(request, info):
+ product_id = info['Product']['ProductID']
+ start_date = info['StartDate']
+ finish_date = info['FinishDate']
+
+ runningTotalQ, runningTotalA, opening = opening_balance(product_id, start_date)
+ totalDebitQ = runningTotalQ
+ totalDebitA = runningTotalA
+ totalCreditQ = 0
+ totalCreditA = 0
+
+ info['Body'].append(opening)
query = DBSession.query(Voucher, Inventory, Journal).options(
joinedload(Journal.ledger, innerjoin=True),
joinedload(Journal.costcenter, innerjoin=True))\
.filter(Voucher.id == Inventory.voucher_id)\
.filter(Voucher.id == Journal.voucher_id)\
- .filter(Inventory.product_id == product.id)\
+ .filter(Inventory.product_id == product_id)\
.filter(Journal.cost_center_id != CostCenter.cost_center_purchase())\
- .filter(Voucher.date >= datetime.datetime.strptime(startDate, '%d-%b-%Y'))\
- .filter(Voucher.date <= datetime.datetime.strptime(finishDate, '%d-%b-%Y'))\
+ .filter(Voucher.date >= datetime.datetime.strptime(start_date, '%d-%b-%Y'))\
+ .filter(Voucher.date <= datetime.datetime.strptime(finish_date, '%d-%b-%Y'))\
.order_by(Voucher.date).order_by(Voucher.last_edit_date).all()
for row in query:
journalDebit = row.Journal.debit * -1
name = row.Journal.costcenter.name if row.Voucher.type == VoucherType.by_name(
'Issue').id else row.Journal.ledger.name
- debitQuantity = "{0:.2f}".format(row.Inventory.quantity) if journalDebit == 1 else ""
- debitAmount = "\u20B9 {0:.2f}".format(row.Inventory.amount) if journalDebit == 1 else ""
- creditQuantity = "{0:.2f}".format(row.Inventory.quantity) if journalDebit != 1 else ""
- creditAmount = "\u20B9 {0:.2f}".format(row.Inventory.amount) if journalDebit != 1 else ""
+ debitQ = "{0:.2f}".format(row.Inventory.quantity) if journalDebit == 1 else ""
+ debitA = "\u20B9 {0:.2f}".format(row.Inventory.amount) if journalDebit == 1 else ""
+ creditQ = "{0:.2f}".format(row.Inventory.quantity) if journalDebit != 1 else ""
+ creditA = "\u20B9 {0:.2f}".format(row.Inventory.amount) if journalDebit != 1 else ""
- runningTotalQuantity += (row.Inventory.quantity * journalDebit)
- runningTotalAmount += (row.Inventory.amount * journalDebit)
+ runningTotalQ += (row.Inventory.quantity * journalDebit)
+ runningTotalA += (row.Inventory.amount * journalDebit)
if journalDebit == 1:
- totalDebitQuantity += row.Inventory.quantity
- totalDebitAmount += row.Inventory.amount
+ totalDebitQ += row.Inventory.quantity
+ totalDebitA += row.Inventory.amount
else:
- totalCreditQuantity += row.Inventory.quantity
- totalCreditAmount += row.Inventory.amount
+ totalCreditQ += row.Inventory.quantity
+ totalCreditA += row.Inventory.amount
- name = '
' + name + ''
- body += '
| {1} | {2} | '\
- '{3} | {4} | {5} | '\
- '{6} | {7} | {8} | '\
- '{9:.2f} | \u20B9 {10:.2f} |
'\
- .format(str(row.Voucher.id), row.Voucher.date.strftime('%d-%b-%Y'), name,
- VoucherType.by_id(row.Voucher.type).name, row.Voucher.narration, debitQuantity, debitAmount,
- creditQuantity, creditAmount, runningTotalQuantity, runningTotalAmount)
+ info['Body'].append(
+ {'Date': row.Voucher.date.strftime('%d-%b-%Y'), 'Name': name, 'Url': get_edit_url(request, row.Voucher),
+ 'Type': VoucherType.by_id(row.Voucher.type).name, 'Narration': row.Voucher.narration, 'DebitQ': debitQ,
+ 'DebitA': debitA,
+ 'CreditQ': creditQ, 'CreditA': creditA, 'RunningQ': "{0:.2f}".format(runningTotalQ),
+ 'RunningA': "\u20B9 {0:.2f}".format(runningTotalA)})
- voucher_type = VoucherType.by_name('Closing Balance')
- footer = '
| {0} | {1} | '\
- '{1} | | {2:.2f} | '\
- '\u20B9 {3:.2f} | {4:.2f} | '\
- '\u20B9 {5:.2f} | {6:.2f} | '\
- '\u20B9 {7:.2f} |
'\
- .format(finishDate, voucher_type.name, totalDebitQuantity, totalDebitAmount,
- totalCreditQuantity, totalCreditAmount, runningTotalQuantity, runningTotalAmount)
-
- return {'body': body, 'footer': footer, 'start_date': startDate, 'finish_date': finishDate, 'id': str(product.id),
- 'name': product.full_name, 'url': request.route_url('product_ledger_id', id=str(product.id),
- _query={'startDate': startDate, 'finishDate': finishDate})}
+ info['Footer'] = {'Date': finish_date, 'Name': 'Closing Balance', 'Type': 'Closing Balance', 'Narration': '',
+ 'DebitQ': "{0:,.2f}".format(totalDebitQ), 'DebitA': "\u20B9 {0:,.2f}".format(totalDebitA),
+ 'CreditQ': "{0:,.2f}".format(totalCreditQ), 'CreditA': "\u20B9 {0:,.2f}".format(totalCreditA),
+ 'RunningQ': "{0:,.2f}".format(runningTotalQ), 'RunningA': "\u20B9 {0:,.2f}".format(runningTotalA)}
-def opening_balance(productID, startDate):
- runningTotalQuantity = 0
- runningTotalAmount = 0
- totalDebitQuantity = 0
- totalDebitAmount = 0
- totalCreditQuantity = 0
- totalCreditAmount = 0
-
+def opening_balance(product_id, start_date):
quantity, amount = DBSession.query(func.sum(Inventory.quantity * Journal.debit),
func.sum(Inventory.amount * Journal.debit))\
.join(Voucher)\
.filter(Voucher.id == Inventory.voucher_id)\
.filter(Voucher.id == Journal.voucher_id)\
- .filter(Inventory.product_id == productID)\
+ .filter(Inventory.product_id == product_id)\
.filter(Journal.cost_center_id == CostCenter.cost_center_purchase())\
- .filter(Voucher.date < datetime.datetime.strptime(startDate, '%d-%b-%Y'))\
+ .filter(Voucher.date < datetime.datetime.strptime(start_date, '%d-%b-%Y'))\
.one()
- if quantity is None or quantity == 0:
- debitQuantity = ""
- debitAmount = ""
- creditQuantity = ""
- creditAmount = ""
- else:
- debitQuantity = "{0:.2f}".format(quantity) if quantity > 0 else ""
- debitAmount = "\u20B9 {0:.2f}".format(amount) if quantity > 0 else ""
- creditQuantity = "{0:.2f}".format(quantity) if quantity < 0 else ""
- creditAmount = "\u20B9 {0:.2f}".format(amount) if quantity < 0 else ""
+ if quantity and quantity > 0:
+ debitQuantity = "{0:.2f}".format(quantity)
+ debitAmount = "\u20B9 {0:.2f}".format(amount)
if quantity is None:
quantity = 0
amount = 0
- runningTotalQuantity = quantity
- runningTotalAmount = amount
- if quantity < 0:
- totalCreditQuantity = quantity * -1
- totalCreditAmount = amount * -1
- else:
- totalDebitQuantity = quantity
- totalDebitAmount = amount
- voucher_type = VoucherType.by_name('Opening Balance')
- return totalDebitQuantity, totalDebitAmount, totalCreditQuantity, totalCreditAmount, runningTotalQuantity,\
- runningTotalAmount,\
- '
| {0} | {1} | '\
- '{1} | | {2} | '\
- '{3} | {4} | '\
- '{5} | {6:.2f} | '\
- '\u20B9 {7:.2f} |
'\
- .format(startDate, voucher_type.name, debitQuantity, debitAmount,
- creditQuantity, creditAmount, runningTotalQuantity, runningTotalAmount)
\ No newline at end of file
+ return quantity, amount, {'Date': start_date, 'Name': 'Opening Balance', 'Type': 'Opening Balance', 'Narration': '',
+ 'DebitQ': debitQuantity, 'DebitA': debitAmount, 'RunningQ': quantity, 'RunningA': amount}
+
diff --git a/brewman/brewman/views/widgets.py b/brewman/brewman/views/widgets.py
deleted file mode 100644
index 7c16517d..00000000
--- a/brewman/brewman/views/widgets.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from pyramid.renderers import render
-
-def footer(request):
- return render('brewman:templates/widgets/footer.pt', {'request': request})
-
-def widget_gallery(request):
- return render('brewman:templates/widgets/gallery.pt', {'request': request})
-
-def tweets(request):
- return render('brewman:templates/widgets/tweets.pt', {'request': request})
-
-def contact_widget(request):
- return render('brewman:templates/widgets/contact.pt', {'request': request})
-
-def archive(request):
- return render('brewman:templates/widgets/archive.pt', {'request': request})
-
-def categories(request):
- return render('brewman:templates/widgets/categories.pt', {'request': request})
-
-def recent_posts(request):
- return render('brewman:templates/widgets/recent_posts.pt', {'request': request})
-
-def comments(request):
- return render('brewman:templates/widgets/comments.pt', {'request': request})
-
-def blog_roll(request):
- return render('brewman:templates/widgets/blog_roll.pt', {'request': request})
-
-def events(request):
- return render('brewman:templates/widgets/events.pt', {'request': request})