Skip to content

Commit

Permalink
alphebeticOrderFunds (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
KZongker authored Nov 16, 2024
1 parent 76839b5 commit 410bcd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/helpers/StripeHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class StripeHelper {
}],
proration_behavior: 'none',
};
//billing_cycle_anchor: (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) ? billing_cycle_anchor / 1000 : "now",
// billing_cycle_anchor: (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) ? billing_cycle_anchor / 1000 : "now",
if (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) subscriptionData.billing_cycle_anchor = billing_cycle_anchor / 1000;
if (type === 'card') subscriptionData.default_payment_method = payment_method_id;
if (type === 'bank') subscriptionData.default_source = payment_method_id;
Expand Down
6 changes: 3 additions & 3 deletions src/repositories/FundRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { Fund } from "../models";
export class FundRepository {

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

if (data !== null) return this.convertToModel(churchId, data);
else {
const fund: Fund = { churchId, name: "General Fund" };
const fund: Fund = { churchId, name: "(General Fund)" };
await this.save(fund);
return fund;
}
Expand Down Expand Up @@ -44,7 +44,7 @@ export class FundRepository {
}

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

public convertToModel(churchId: string, data: any) {
Expand Down

0 comments on commit 410bcd3

Please sign in to comment.