Skip to content

Commit 410bcd3

Browse files
authored
alphebeticOrderFunds (#71)
1 parent 76839b5 commit 410bcd3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/helpers/StripeHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class StripeHelper {
3232
}],
3333
proration_behavior: 'none',
3434
};
35-
//billing_cycle_anchor: (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) ? billing_cycle_anchor / 1000 : "now",
35+
// billing_cycle_anchor: (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) ? billing_cycle_anchor / 1000 : "now",
3636
if (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) subscriptionData.billing_cycle_anchor = billing_cycle_anchor / 1000;
3737
if (type === 'card') subscriptionData.default_payment_method = payment_method_id;
3838
if (type === 'bank') subscriptionData.default_source = payment_method_id;

src/repositories/FundRepository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import { Fund } from "../models";
66
export class FundRepository {
77

88
public async getOrCreateGeneral(churchId: string) {
9-
const data = await DB.queryOne("SELECT * FROM funds WHERE churchId=? AND name='General Fund' AND removed=0;", [churchId]);
9+
const data = await DB.queryOne("SELECT * FROM funds WHERE churchId=? AND name='(General Fund)' AND removed=0;", [churchId]);
1010

1111
if (data !== null) return this.convertToModel(churchId, data);
1212
else {
13-
const fund: Fund = { churchId, name: "General Fund" };
13+
const fund: Fund = { churchId, name: "(General Fund)" };
1414
await this.save(fund);
1515
return fund;
1616
}
@@ -44,7 +44,7 @@ export class FundRepository {
4444
}
4545

4646
public loadAll(churchId: string) {
47-
return DB.query("SELECT * FROM funds WHERE churchId=? AND removed=0;", [churchId]);
47+
return DB.query("SELECT * FROM funds WHERE churchId=? AND removed=0 ORDER BY name;", [churchId]);
4848
}
4949

5050
public convertToModel(churchId: string, data: any) {

0 commit comments

Comments
 (0)