Fix: ProductLedger was crapping out because of ambiguous join in opening balace. (Probably triggered by upgrade in sqlalchemy)

Chore: Updated the dev dependencies as Angular 7 does not support Typescript 3.2 and further
This commit is contained in:
Amritanshu 2019-04-15 11:02:54 +05:30
parent 72e8801472
commit 403b9a207a
5 changed files with 8 additions and 9 deletions

View File

@ -38,7 +38,6 @@ def show_blank(request):
route_name="api_ledger_id", route_name="api_ledger_id",
renderer="json", renderer="json",
permission="Ledger", permission="Ledger",
trans=True,
) )
def show_data(request): def show_data(request):
account = ( account = (

View File

@ -46,7 +46,6 @@ def show_blank(request):
route_name="api_product_ledger_id", route_name="api_product_ledger_id",
renderer="json", renderer="json",
permission="Product Ledger", permission="Product Ledger",
trans=True,
) )
def show_data(request): def show_data(request):
id = to_uuid(request.matchdict["id"]) id = to_uuid(request.matchdict["id"])
@ -158,7 +157,8 @@ def opening_balance(product_id, start_date, dbsession):
func.sum(Inventory.quantity * Journal.debit), func.sum(Inventory.quantity * Journal.debit),
func.sum(Inventory.amount * Journal.debit), func.sum(Inventory.amount * Journal.debit),
) )
.join(Voucher) .join(Inventory.voucher)
.join(Voucher.journals)
.filter(Voucher.id == Inventory.voucher_id) .filter(Voucher.id == Inventory.voucher_id)
.filter(Voucher.id == Journal.voucher_id) .filter(Voucher.id == Journal.voucher_id)
.filter(Inventory.product_id == product_id) .filter(Inventory.product_id == product_id)

View File

@ -35,7 +35,7 @@
"zone.js": "^0.8.26" "zone.js": "^0.8.26"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.10.0", "@angular-devkit/build-angular": "~0.10.7",
"@angular/cli": "^7.0.6", "@angular/cli": "^7.0.6",
"@angular/compiler-cli": "^7.1.0", "@angular/compiler-cli": "^7.1.0",
"@angular/language-service": "^7.1.0", "@angular/language-service": "^7.1.0",
@ -54,6 +54,6 @@
"standard-version": "^4.4.0", "standard-version": "^4.4.0",
"ts-node": "^7.0.0", "ts-node": "^7.0.0",
"tslint": "^5.11.0", "tslint": "^5.11.0",
"typescript": "^3.1.6" "typescript": "3.1.6"
} }
} }

View File

@ -20,8 +20,8 @@ export class LedgerService {
constructor(private http: HttpClient, private log: ErrorLoggerService) { constructor(private http: HttpClient, private log: ErrorLoggerService) {
} }
list(date: string, startDate: string, finishDate): Observable<Ledger> { list(id: string, startDate: string, finishDate): Observable<Ledger> {
const listUrl = (date === null) ? url : `${url}/${date}`; const listUrl = (id === null) ? url : `${url}/${id}`;
const options = {params: new HttpParams()}; const options = {params: new HttpParams()};
if (startDate !== null) { if (startDate !== null) {
options.params = options.params.set('s', startDate); options.params = options.params.set('s', startDate);

View File

@ -20,8 +20,8 @@ export class ProductLedgerService {
constructor(private http: HttpClient, private log: ErrorLoggerService) { constructor(private http: HttpClient, private log: ErrorLoggerService) {
} }
list(date: string, startDate: string, finishDate): Observable<ProductLedger> { list(id: string, startDate: string, finishDate): Observable<ProductLedger> {
const listUrl = (date === null) ? url : `${url}/${date}`; const listUrl = (id === null) ? url : `${url}/${id}`;
const options = {params: new HttpParams()}; const options = {params: new HttpParams()};
if (startDate !== null) { if (startDate !== null) {
options.params = options.params.set('s', startDate); options.params = options.params.set('s', startDate);