Documentation ¶
Index ¶
- Constants
- func CloseDb()
- func DB() *orm.DataContext
- func Delete(o orm.IModel) error
- func Find(o orm.IModel, filter *dbox.Filter, config toolkit.M) (dbox.ICursor, error)
- func Get(o orm.IModel, id interface{}) error
- func GetModelData(docname string) orm.IModel
- func Mapautotype(m toolkit.M)
- func Mapstructtype(m toolkit.M, omod orm.IModel)
- func Save(o orm.IModel) error
- func SetDb(conn dbox.IConnection) error
- func SummarizeLedgerSum(filter *dbox.Filter, columns []string, datapoints []string, ...) ([]toolkit.M, error)
- type AppliedModule
- type Branch
- type BranchTypeEnum
- type Brand
- type Channel
- type ChannelTypeEnum
- type CostCenter
- type CostCenterType
- type Customer
- type Date
- type DirectSalesPL
- type Entity
- type GDRJModel
- type HBrandCategory
- type HCostCenterGroup
- type HGeographi
- type HeadCount
- type IndirectSalesPL
- type InventoryLevel
- type LedgerAccount
- type LedgerSummary
- type LedgerTrx
- type Module
- type PLStructure
- type Product
- type ProfitCenter
- type PromotionPL
- type SGAPL
- type Sales
- type SalesMonthly
- type SalesResource
- type Truck
- type TruckAssignment
- type TruckCost
- type UploadData
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 GetModelData ¶
func GetModelData(docname string) orm.IModel
func Mapautotype ¶
func Mapstructtype ¶
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 BranchGetByID ¶
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 BrandGetByID ¶
type Channel ¶
type Channel struct { orm.ModelBase `json:"-" bson:"-"` ID string `json:"_id" bson:"_id"` //BrandID Channel string }
func ChannelGetByID ¶
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 ¶
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 EntityGetByID ¶
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 ¶
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 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
Source Files ¶
- allocation_module.go
- base.go
- branch.go
- brand.go
- channel.go
- costcenter.go
- costcentertype.go
- customer.go
- directsalespl.go
- entity.go
- hbrandcategory.go
- hcostcentergroup.go
- headcount.go
- hgeographi.go
- indirectsalespl.go
- inventorylevel.go
- ledgeraccount.go
- ledgersummary.go
- ledgertrx.go
- plstructure.go
- product.go
- profitcenter.go
- promotionpl.go
- sales.go
- salesmonthly.go
- salesresource.go
- sgapl.go
- truck.go
- truckassignment.go
- truckcost.go
- uploaddata.go
Click to show internal directories.
Click to hide internal directories.