mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 23:05:44 +00:00
add sorting transaction, report keuangan
This commit is contained in:
@@ -1029,6 +1029,13 @@ func (s *repportService) GetProductionResult(ctx *fiber.Ctx, params *validation.
|
||||
}
|
||||
|
||||
func (s *repportService) GetCustomerPayment(ctx *fiber.Ctx, params *validation.CustomerPaymentQuery) ([]dto.CustomerPaymentReportItem, int64, error) {
|
||||
if params.SortBy == "" {
|
||||
params.SortBy = "customer"
|
||||
}
|
||||
if params.SortOrder == "" {
|
||||
params.SortOrder = "asc"
|
||||
}
|
||||
|
||||
if err := s.Validate.Struct(params); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
@@ -1083,7 +1090,7 @@ func (s *repportService) GetCustomerPayment(ctx *fiber.Ctx, params *validation.C
|
||||
offset := (page - 1) * limit
|
||||
|
||||
var err error
|
||||
customerIDs, totalCustomers, err = s.CustomerPaymentRepo.GetCustomerIDsWithTransactions(ctx.Context(), limit, offset, allowedCustomerIDs)
|
||||
customerIDs, totalCustomers, err = s.CustomerPaymentRepo.GetCustomerIDsWithTransactions(ctx.Context(), limit, offset, allowedCustomerIDs, params.SortBy, params.SortOrder)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
@@ -1755,6 +1762,12 @@ func (s *repportService) GetDebtSupplier(c *fiber.Ctx, params *validation.DebtSu
|
||||
if params.FilterBy == "" {
|
||||
params.FilterBy = "received_date"
|
||||
}
|
||||
if params.SortBy == "" {
|
||||
params.SortBy = "supplier"
|
||||
}
|
||||
if params.SortOrder == "" {
|
||||
params.SortOrder = "asc"
|
||||
}
|
||||
|
||||
if err := s.Validate.Struct(params); err != nil {
|
||||
return nil, 0, err
|
||||
|
||||
Reference in New Issue
Block a user