mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
show timezone in transaction list page if the timezone of transaction does not equal with client current timezone
This commit is contained in:
@@ -603,13 +603,14 @@ func (a *TransactionsApi) createNewTransactionModel(uid int64, transactionCreate
|
||||
}
|
||||
|
||||
transaction := &models.Transaction{
|
||||
Uid: uid,
|
||||
Type: transactionDbType,
|
||||
CategoryId: transactionCreateReq.CategoryId,
|
||||
TransactionTime: utils.GetMinTransactionTimeFromUnixTime(transactionCreateReq.Time),
|
||||
AccountId: transactionCreateReq.SourceAccountId,
|
||||
Amount: transactionCreateReq.SourceAmount,
|
||||
Comment: transactionCreateReq.Comment,
|
||||
Uid: uid,
|
||||
Type: transactionDbType,
|
||||
CategoryId: transactionCreateReq.CategoryId,
|
||||
TransactionTime: utils.GetMinTransactionTimeFromUnixTime(transactionCreateReq.Time),
|
||||
TimezoneUtcOffset: transactionCreateReq.UtcOffset,
|
||||
AccountId: transactionCreateReq.SourceAccountId,
|
||||
Amount: transactionCreateReq.SourceAmount,
|
||||
Comment: transactionCreateReq.Comment,
|
||||
}
|
||||
|
||||
if transactionCreateReq.Type == models.TRANSACTION_TYPE_TRANSFER {
|
||||
|
||||
@@ -34,6 +34,7 @@ type Transaction struct {
|
||||
CategoryId int64 `xorm:"INDEX(IDX_transaction_uid_deleted_category_id_time) NOT NULL"`
|
||||
AccountId int64 `xorm:"INDEX(IDX_transaction_uid_deleted_account_id_time) NOT NULL"`
|
||||
TransactionTime int64 `xorm:"UNIQUE(UQE_transaction_uid_time) INDEX(IDX_transaction_uid_deleted_time) INDEX(IDX_transaction_uid_deleted_type_time) INDEX(IDX_transaction_uid_deleted_category_id_time) INDEX(IDX_transaction_uid_deleted_account_id_time) NOT NULL"`
|
||||
TimezoneUtcOffset int16 `xorm:"NOT NULL"`
|
||||
Amount int64 `xorm:"NOT NULL"`
|
||||
RelatedId int64 `xorm:"NOT NULL"`
|
||||
RelatedAccountId int64 `xorm:"NOT NULL"`
|
||||
@@ -119,6 +120,7 @@ type TransactionInfoResponse struct {
|
||||
Type TransactionType `json:"type"`
|
||||
CategoryId int64 `json:"categoryId,string"`
|
||||
Time int64 `json:"time"`
|
||||
UtcOffset int16 `json:"utcOffset"`
|
||||
SourceAccountId int64 `json:"sourceAccountId,string"`
|
||||
DestinationAccountId int64 `json:"destinationAccountId,string,omitempty"`
|
||||
SourceAmount int64 `json:"sourceAmount"`
|
||||
@@ -194,6 +196,7 @@ func (t *Transaction) ToTransactionInfoResponse(tagIds []int64, editable bool) *
|
||||
Type: transactionType,
|
||||
CategoryId: t.CategoryId,
|
||||
Time: utils.GetUnixTimeFromTransactionTime(t.TransactionTime),
|
||||
UtcOffset: t.TimezoneUtcOffset,
|
||||
SourceAccountId: sourceAccountId,
|
||||
DestinationAccountId: destinationAccountId,
|
||||
SourceAmount: sourceAmount,
|
||||
|
||||
@@ -1001,6 +1001,7 @@ func (s *TransactionService) GetRelatedTransferTransaction(originalTransaction *
|
||||
Type: relatedType,
|
||||
CategoryId: originalTransaction.CategoryId,
|
||||
TransactionTime: relatedTransactionTime,
|
||||
TimezoneUtcOffset: originalTransaction.TimezoneUtcOffset,
|
||||
AccountId: originalTransaction.RelatedAccountId,
|
||||
Amount: originalTransaction.RelatedAccountAmount,
|
||||
RelatedId: originalTransaction.TransactionId,
|
||||
|
||||
Reference in New Issue
Block a user