payment_term

package
v1.0.48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Migrate applies the necessary database migrations for the payment term model.

It ensures that the underlying database schema is up to date with the current version of the PaymentTermModel.

Types

type PaymentTermService

type PaymentTermService struct {
	// contains filtered or unexported fields
}

PaymentTermService handles operations related to payment terms.

It utilizes a GORM database instance and an ERP context to perform CRUD operations on payment terms, as well as other context-related functionalities.

func NewPaymentTermService

func NewPaymentTermService(db *gorm.DB, ctx *context.ERPContext) *PaymentTermService

NewPaymentTermService creates a new instance of PaymentTermService.

It initializes the service with the provided GORM database and ERP context. The database is used for performing operations on payment terms, while the context provides authentication and authorization capabilities.

func (*PaymentTermService) GetPaymentTerms

func (s *PaymentTermService) GetPaymentTerms() []models.PaymentTermModel

GetPaymentTerms retrieves all payment terms from the database.

It returns a slice of PaymentTermModel containing all the payment terms stored in the database.

func (*PaymentTermService) GroupPaymentTermsByCategory

func (s *PaymentTermService) GroupPaymentTermsByCategory() map[string][]models.PaymentTermModel

GroupPaymentTermsByCategory groups the payment terms by their category.

It returns a map where the keys are category names and the values are slices of PaymentTermModel corresponding to each category.

func (*PaymentTermService) InitPaymentTerms

func (s *PaymentTermService) InitPaymentTerms() error

InitPaymentTerms initializes the payment terms in the database.

This method populates the database with predefined payment terms if they do not already exist.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL