gdrj

package
v0.0.0-...-9e67cea Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeBranch    BranchTypeEnum = 1
	OfficeBranch                 = 2
	FactoryBranch                = 3
)
View Source
const (
	ExportChannel              ChannelTypeEnum = 1
	GeneralTradeChannel                        = 2
	ModernTradeChannel                         = 3
	IndustrialTradeChannel                     = 4
	MotoristChannel                            = 5
	RegionalDistributorChannel                 = 6
)

Variables

This section is empty.

Functions

func CloseDb

func CloseDb()

func DB

func DB() *orm.DataContext

func Delete

func Delete(o orm.IModel) error

func Find

func Find(o orm.IModel, filter *dbox.Filter, config toolkit.M) (dbox.ICursor, error)

func Get

func Get(o orm.IModel, id interface{}) error

func GetModelData

func GetModelData(docname string) orm.IModel

func Mapautotype

func Mapautotype(m toolkit.M)

func Mapstructtype

func Mapstructtype(m toolkit.M, omod orm.IModel)

func Save

func Save(o orm.IModel) error

func SetDb

func SetDb(conn dbox.IConnection) error

func SummarizeLedgerSum

func SummarizeLedgerSum(
	filter *dbox.Filter,
	columns []string,
	datapoints []string,

	fnTransform func(m *toolkit.M) error) ([]toolkit.M, error)

[

{_id:{col1:"D1",col2:"D2",col3:"D3"},SalesAmount:10,Qty:5,Value:2},
{_id:{col1:"D1",col2:"D2",col3:"D4"},SalesAmount:10,Qty:3.2,Value:3},

]

row: _id.col1, _id.col2 col: _id.col3

Types

type AppliedModule

type AppliedModule struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Modules       []*Module
	LastExecution time.Time
}

func (*AppliedModule) RecordID

func (am *AppliedModule) RecordID() interface{}

func (*AppliedModule) TableName

func (am *AppliedModule) TableName() string

type Branch

type Branch struct {
	GDRJModel `json:"-" bson:"-"`
	ID        string `json:"_id" bson:"_id"` //BranchID
	Name      string
	Location  string
}

func BranchGetAll

func BranchGetAll() ([]*Branch, error)

func BranchGetByID

func BranchGetByID(id string) *Branch

func (*Branch) Delete

func (b *Branch) Delete() error

func (*Branch) RecordID

func (b *Branch) RecordID() interface{}

func (*Branch) Save

func (b *Branch) Save() error

func (*Branch) TableName

func (b *Branch) TableName() string

type BranchTypeEnum

type BranchTypeEnum int

func (BranchTypeEnum) String

func (b BranchTypeEnum) String() string

type Brand

type Brand struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //BrandID
	Name          string
}

func BrandGetAll

func BrandGetAll() ([]*Brand, error)

func BrandGetByID

func BrandGetByID(id string) *Brand

func (*Brand) Delete

func (b *Brand) Delete() error

func (*Brand) RecordID

func (b *Brand) RecordID() interface{}

func (*Brand) Save

func (b *Brand) Save() error

func (*Brand) TableName

func (b *Brand) TableName() string

type Channel

type Channel struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //BrandID
	Channel       string
}

func ChannelGetByID

func ChannelGetByID(id string) *Channel

func (*Channel) Delete

func (c *Channel) Delete() error

func (*Channel) RecordID

func (c *Channel) RecordID() interface{}

func (*Channel) Save

func (c *Channel) Save() error

func (*Channel) TableName

func (c *Channel) TableName() string

type ChannelTypeEnum

type ChannelTypeEnum int

func ToChannelEnum

func ToChannelEnum(d int) ChannelTypeEnum

func (ChannelTypeEnum) String

func (c ChannelTypeEnum) String() string

type CostCenter

type CostCenter struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //CCID
	EntityID      string
	Name          string
	CostGroup01   string
	CostGroup02   string
	CostGroup03   string
	BranchID      string
	BranchType    BranchTypeEnum
	CCTypeID      string
	HCCGroupID    string
}

func ProductGetByID

func ProductGetByID(id string) *CostCenter

func (*CostCenter) Delete

func (c *CostCenter) Delete() error

func (*CostCenter) RecordID

func (c *CostCenter) RecordID() interface{}

func (*CostCenter) Save

func (c *CostCenter) Save() error

func (*CostCenter) TableName

func (c *CostCenter) TableName() string

type CostCenterType

type CostCenterType struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //CCTypeID
	Name          string
}

func CostCenterTypeGetByID

func CostCenterTypeGetByID(id string) *CostCenterType

func (*CostCenterType) Delete

func (c *CostCenterType) Delete() error

func (*CostCenterType) RecordID

func (c *CostCenterType) RecordID() interface{}

func (*CostCenterType) Save

func (c *CostCenterType) Save() error

func (*CostCenterType) TableName

func (c *CostCenterType) TableName() string

type Customer

type Customer struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //OutletID
	CustomerID    string
	Plant         string
	Name          string
	KeyAccount    string
	Channel       ChannelTypeEnum
	Group         string
	National      string
	Zone          string
	Region        string
	Area          string
}

func CustomerGetByID

func CustomerGetByID(id string) *Customer

func (*Customer) Delete

func (c *Customer) Delete() error

func (*Customer) RecordID

func (c *Customer) RecordID() interface{}

func (*Customer) Save

func (c *Customer) Save() error

func (*Customer) TableName

func (c *Customer) TableName() string

type Date

type Date struct {
	ID      string
	Date    time.Time
	Month   time.Month
	Quarter int
	Year    int
}

type DirectSalesPL

type DirectSalesPL struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	OutletID      string
	SKUID         string
	PCID          string
	CCID          string
	PLItemID      string
	Amount        float64
}

func DirectSalesPLGetByID

func DirectSalesPLGetByID(id string) *DirectSalesPL

func (*DirectSalesPL) Delete

func (d *DirectSalesPL) Delete() error

func (*DirectSalesPL) RecordID

func (d *DirectSalesPL) RecordID() interface{}

func (*DirectSalesPL) Save

func (d *DirectSalesPL) Save() error

func (*DirectSalesPL) TableName

func (d *DirectSalesPL) TableName() string

type Entity

type Entity struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //EntityID
	Name          string
}

func EntityGetAll

func EntityGetAll() ([]*Entity, error)

func EntityGetByID

func EntityGetByID(id string) *Entity

func (*Entity) Delete

func (e *Entity) Delete() error

func (*Entity) RecordID

func (e *Entity) RecordID() interface{}

func (*Entity) Save

func (e *Entity) Save() error

func (*Entity) TableName

func (e *Entity) TableName() string

type GDRJModel

type GDRJModel struct {
	orm.ModelBase
	LastUpdate time.Time
}

type HBrandCategory

type HBrandCategory struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //BrandID
	BrandID       string
	Name          string
}

func HBrandCategoryGetByID

func HBrandCategoryGetByID(id string) *HBrandCategory

func (*HBrandCategory) Delete

func (h *HBrandCategory) Delete() error

func (*HBrandCategory) RecordID

func (h *HBrandCategory) RecordID() interface{}

func (*HBrandCategory) Save

func (h *HBrandCategory) Save() error

func (*HBrandCategory) TableName

func (h *HBrandCategory) TableName() string

type HCostCenterGroup

type HCostCenterGroup struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //HCCGroupID
	CCTypeID      string
	Name          string
}

func HCostCenterGroupGetAll

func HCostCenterGroupGetAll() ([]*HCostCenterGroup, error)

func HCostCenterGroupGetByID

func HCostCenterGroupGetByID(id string) *HCostCenterGroup

func (*HCostCenterGroup) Delete

func (h *HCostCenterGroup) Delete() error

func (*HCostCenterGroup) RecordID

func (h *HCostCenterGroup) RecordID() interface{}

func (*HCostCenterGroup) Save

func (h *HCostCenterGroup) Save() error

func (*HCostCenterGroup) TableName

func (h *HCostCenterGroup) TableName() string

type HGeographi

type HGeographi struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //Area
	Region        string
	Zone          string
	National      string
}

func HGeographiGetByID

func HGeographiGetByID(id string) *HGeographi

func (*HGeographi) Delete

func (h *HGeographi) Delete() error

func (*HGeographi) RecordID

func (h *HGeographi) RecordID() interface{}

func (*HGeographi) Save

func (h *HGeographi) Save() error

func (*HGeographi) TableName

func (h *HGeographi) TableName() string

type HeadCount

type HeadCount struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	PCID          string
	CCID          string
	BranchID      string
	Level         string
	Qty           int // Qty of employee in that level in month
}

func HeadCountGetByID

func HeadCountGetByID(id string) *HeadCount

func (*HeadCount) Delete

func (h *HeadCount) Delete() error

func (*HeadCount) RecordID

func (h *HeadCount) RecordID() interface{}

func (*HeadCount) Save

func (h *HeadCount) Save() error

func (*HeadCount) TableName

func (h *HeadCount) TableName() string

type IndirectSalesPL

type IndirectSalesPL struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	PCID          string
	CCID          string
	PLItemID      string
	Amount        float64
}

func IndirectSalesPLGetByID

func IndirectSalesPLGetByID(id string) *IndirectSalesPL

func (*IndirectSalesPL) Delete

func (i *IndirectSalesPL) Delete() error

func (*IndirectSalesPL) RecordID

func (i *IndirectSalesPL) RecordID() interface{}

func (*IndirectSalesPL) Save

func (i *IndirectSalesPL) Save() error

func (*IndirectSalesPL) TableName

func (i *IndirectSalesPL) TableName() string

type InventoryLevel

type InventoryLevel struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	BranchID      string
	SKUID         string
	QtyOpen       int
	QtyReceive    int
	QtySold       int
	QtyOther      int
	QtyBalance    int
}

func InventoryLevelGetByID

func InventoryLevelGetByID(id string) *InventoryLevel

func (*InventoryLevel) Delete

func (i *InventoryLevel) Delete() error

func (*InventoryLevel) RecordID

func (i *InventoryLevel) RecordID() interface{}

func (*InventoryLevel) Save

func (i *InventoryLevel) Save() error

func (*InventoryLevel) TableName

func (i *InventoryLevel) TableName() string

type LedgerAccount

type LedgerAccount struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //LedgerAccount
	Title         string
	G1            string
	G2            string
	G3            string
	G4            string
}

func FindLedgerAccountLikeId

func FindLedgerAccountLikeId(id string, take, skip int) (arla []*LedgerAccount)

func LedgerAccountGetByID

func LedgerAccountGetByID(id string) *LedgerAccount

func (*LedgerAccount) Delete

func (t *LedgerAccount) Delete() error

func (*LedgerAccount) RecordID

func (t *LedgerAccount) RecordID() interface{}

func (*LedgerAccount) Save

func (t *LedgerAccount) Save() error

func (*LedgerAccount) TableName

func (t *LedgerAccount) TableName() string

type LedgerSummary

type LedgerSummary struct {
	ID                     string
	PC                     *ProfitCenter
	CC                     *CostCenter
	CompanyCode            string
	LedgerAccount          string
	Customer               *Customer
	Product                *Product
	Date                   *Date
	Value1, Value2, Value3 float64
}

func (*LedgerSummary) RecordID

func (s *LedgerSummary) RecordID() interface{}

func (*LedgerSummary) TableName

func (s *LedgerSummary) TableName() string

type LedgerTrx

type LedgerTrx struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	Qtr           int
	Data          time.Time
	PeriodID      string
	CompanyCode   string
	PCID          string
	CCID          string
	LedgerAccount string
	Value         float64
}

func (*LedgerTrx) RecordID

func (t *LedgerTrx) RecordID() interface{}

func (*LedgerTrx) TableName

func (t *LedgerTrx) TableName() string

type Module

type Module struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Name          string
	Description   string
	ExePath       string
	LastCompiled  time.Time
}

func (*Module) IsCompiled

func (m *Module) IsCompiled() bool

func (*Module) RecordID

func (m *Module) RecordID() interface{}

func (*Module) TableName

func (m *Module) TableName() string

type PLStructure

type PLStructure struct {
	orm.ModelBase `json:"-" bson:"-"`
	PLItemID      string `json:"_id" bson:"_id"`
	PLGroup       string
	PLSubGroup    string
	Name          string
	Notes         string
}

func PLStructureGetByID

func PLStructureGetByID(id string) *PLStructure

func (*PLStructure) Delete

func (p *PLStructure) Delete() error

func (*PLStructure) RecordID

func (p *PLStructure) RecordID() interface{}

func (*PLStructure) Save

func (p *PLStructure) Save() error

func (*PLStructure) TableName

func (p *PLStructure) TableName() string

type Product

type Product struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `bson:"_id" json:"_id"` //SKUID
	Name          string
	Config        string
	Brand         string
	LongName      string
}

func ProductGetBySKUID

func ProductGetBySKUID(id string) *Product

func (*Product) Delete

func (p *Product) Delete() error

func (*Product) RecordID

func (p *Product) RecordID() interface{}

func (*Product) Save

func (p *Product) Save() error

func (*Product) TableName

func (p *Product) TableName() string

type ProfitCenter

type ProfitCenter struct {
	orm.ModelBase   `json:"-" bson:"-"`
	ID              string `json:"_id" bson:"_id"` //PCID
	EntityID        string
	Name            string
	BrandID         string
	BrandCategoryID string
	BranchID        string
	BranchType      BranchTypeEnum
}

func ProfitCenterGetByID

func ProfitCenterGetByID(id string) *ProfitCenter

func (*ProfitCenter) Delete

func (p *ProfitCenter) Delete() error

func (*ProfitCenter) RecordID

func (p *ProfitCenter) RecordID() interface{}

func (*ProfitCenter) Save

func (p *ProfitCenter) Save() error

func (*ProfitCenter) TableName

func (p *ProfitCenter) TableName() string

type PromotionPL

type PromotionPL struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	OutletID      string
	SKUID         string
	PCID          string
	CCID          string
	PLItemID      string
	Amount        float64
}

func PromotionPLGetByID

func PromotionPLGetByID(id string) *PromotionPL

func (*PromotionPL) Delete

func (p *PromotionPL) Delete() error

func (*PromotionPL) RecordID

func (p *PromotionPL) RecordID() interface{}

func (*PromotionPL) Save

func (p *PromotionPL) Save() error

func (*PromotionPL) TableName

func (p *PromotionPL) TableName() string

type SGAPL

type SGAPL struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Year          int
	Month         time.Month
	PCID          string
	CCID          string
	PLItemID      string
	Amount        float64
}

func SGAPLGetByID

func SGAPLGetByID(id string) *SGAPL

func (*SGAPL) Delete

func (s *SGAPL) Delete() error

func (*SGAPL) RecordID

func (s *SGAPL) RecordID() interface{}

func (*SGAPL) Save

func (s *SGAPL) Save() error

func (*SGAPL) TableName

func (s *SGAPL) TableName() string

type Sales

type Sales struct {
	orm.ModelBase       `json:"-" bson:"-"`
	ID                  string `json:"_id" bson:"_id"`
	Date                time.Time
	OutletID            string
	SKUID               string
	SalesQty            int
	SalesGrossAmount    float64
	SalesTaxAmount      float64
	SalesDiscountAmount float64
	SalesNetAmount      float64
}

func SalesGetByID

func SalesGetByID(id string) *Sales

func (*Sales) Delete

func (s *Sales) Delete() error

func (*Sales) RecordID

func (s *Sales) RecordID() interface{}

func (*Sales) Save

func (s *Sales) Save() error

func (*Sales) TableName

func (s *Sales) TableName() string

type SalesMonthly

type SalesMonthly struct {
	orm.ModelBase       `json:"-" bson:"-"`
	ID                  string `json:"_id" bson:"_id"`
	Year                int
	Month               time.Month
	OutletID            string
	SKUID               string
	SalesQty            int
	SalesGrossAmount    float64 //will be use for allocation formula
	SalesTaxAmount      float64
	SalesDiscountAmount float64
	SalesNetAmount      float64
}

func SalesMonthlyGetByID

func SalesMonthlyGetByID(id string) *SalesMonthly

func (*SalesMonthly) Delete

func (s *SalesMonthly) Delete() error

func (*SalesMonthly) RecordID

func (s *SalesMonthly) RecordID() interface{}

func (*SalesMonthly) Save

func (s *SalesMonthly) Save() error

func (*SalesMonthly) TableName

func (s *SalesMonthly) TableName() string

type SalesResource

type SalesResource struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	BranchID      string
	Year          int
	Month         time.Month
	Truck         int
	Driver        int
	SalesPerson   int
	OfficeStaff   int
}

func SalesResourceGetByID

func SalesResourceGetByID(id string) *SalesResource

func (*SalesResource) Delete

func (s *SalesResource) Delete() error

func (*SalesResource) RecordID

func (s *SalesResource) RecordID() interface{}

Year Month Truck Driver SalesPerson OfficeStaff

func (*SalesResource) Save

func (s *SalesResource) Save() error

func (*SalesResource) TableName

func (s *SalesResource) TableName() string

type Truck

type Truck struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"` //TruckID
	BranchID      string
	PlateNo       string
	Year          int
}

func TruckGetByID

func TruckGetByID(id string) *Truck

func (*Truck) Delete

func (t *Truck) Delete() error

func (*Truck) RecordID

func (t *Truck) RecordID() interface{}

func (*Truck) Save

func (t *Truck) Save() error

func (*Truck) TableName

func (t *Truck) TableName() string

type TruckAssignment

type TruckAssignment struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Date          time.Time
	Driver        []string //name, not mandatory
	BranchID      string
	OutletID      string
}

func TruckAssignmentGetByID

func TruckAssignmentGetByID(id string) *TruckAssignment

func (*TruckAssignment) Delete

func (t *TruckAssignment) Delete() error

func (*TruckAssignment) RecordID

func (t *TruckAssignment) RecordID() interface{}

func (*TruckAssignment) Save

func (t *TruckAssignment) Save() error

func (*TruckAssignment) TableName

func (t *TruckAssignment) TableName() string

type TruckCost

type TruckCost struct {
	orm.ModelBase `json:"-" bson:"-"`
	ID            string `json:"_id" bson:"_id"`
	Date          string
	TruckID       string
	BranchID      string
	Mileage       int
	Gasoline      float64
	Parking       float64
	Driver        float64
	Maintenance   float64
	Other         float64
}

func TruckCostGetByID

func TruckCostGetByID(id string) *TruckCost

func (*TruckCost) Delete

func (t *TruckCost) Delete() error

func (*TruckCost) RecordID

func (t *TruckCost) RecordID() interface{}

func (*TruckCost) Save

func (t *TruckCost) Save() error

func (*TruckCost) TableName

func (t *TruckCost) TableName() string

type UploadData

type UploadData struct {
	orm.ModelBase `bson:"-" json:"-"`
	ID            string `json:"_id" bson:"_id"`
	Filename      string
	PhysicalName  string
	Desc          string
	DataType      string
	FieldId       string
	DocName       string
	Date          time.Time
	Account       []string
	Datacount     float64
	Process       float64 // 0
	Status        string  // ready, done, failed, onprocess, rollback
	Note          string
	Pid           string
	Other         string
}

func UploadDataGetByID

func UploadDataGetByID(id string) *UploadData

func (*UploadData) Delete

func (u *UploadData) Delete() error

func (*UploadData) PostSave

func (u *UploadData) PostSave() error

func (*UploadData) PreSave

func (u *UploadData) PreSave() error

func (*UploadData) ProcessData

func (u *UploadData) ProcessData(loc string) (err error)

Location will be fullpath

func (*UploadData) RecordID

func (u *UploadData) RecordID() interface{}

func (*UploadData) Save

func (u *UploadData) Save() error

func (*UploadData) TableName

func (u *UploadData) TableName() string

Jump to

Keyboard shortcuts

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