You've already forked openaccounting-server
mirror of
https://github.com/openaccounting/oa-server.git
synced 2025-12-09 00:50:59 +13:00
format code
This commit is contained in:
@@ -77,17 +77,17 @@ func (db *DB) InsertAndReplaceBudget(budget *types.Budget) (err error) {
|
||||
}
|
||||
}()
|
||||
|
||||
// delete previous budget
|
||||
query1 := "DELETE FROM budgetitem WHERE orgId = UNHEX(?)"
|
||||
// delete previous budget
|
||||
query1 := "DELETE FROM budgetitem WHERE orgId = UNHEX(?)"
|
||||
|
||||
_, err = dbTx.Exec(
|
||||
query1,
|
||||
budget.OrgId,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = dbTx.Exec(
|
||||
query1,
|
||||
budget.OrgId,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// save items
|
||||
for _, item := range budget.Items {
|
||||
@@ -114,4 +114,4 @@ func (db *DB) DeleteBudget(orgId string) error {
|
||||
_, err := db.Exec(query, orgId)
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
)
|
||||
|
||||
type Budget struct {
|
||||
OrgId string `json:"orgId"`
|
||||
Inserted time.Time `json:"inserted"`
|
||||
Items []*BudgetItem `json:"items"`
|
||||
OrgId string `json:"orgId"`
|
||||
Inserted time.Time `json:"inserted"`
|
||||
Items []*BudgetItem `json:"items"`
|
||||
}
|
||||
|
||||
type BudgetItem struct {
|
||||
OrgId string `json:"-"`
|
||||
AccountId string `json:"accountId"`
|
||||
Amount int64 `json:"amount"`
|
||||
OrgId string `json:"-"`
|
||||
AccountId string `json:"accountId"`
|
||||
Amount int64 `json:"amount"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user