CostBill class

From Catglobe Wiki
Jump to: navigation, search

CostBill



Cost object used to store costs bills for resources

Parent class

Inherits from object

Constructors

  • (int resourceId "Resource id of existing CostBill") - Get existing CostBill
  • (string name "Name of the CostBill", int parentResourceId "Resource id of the resource the CostBill is stored under") - Create new CostBill

Methods

  • Empty Save() - Save the CostBill and LedgerEntries
  • (From object) string ToString() - The string representation of the object.

Properties

  • number Amount { get; } - Sum of amount of ledgers
  • int AttentionToUserResourceId { get; set; } - Resource id of the user that is sent the CostBill
  • DateTime CreatedDate { get; } - Date of creation
  • int CurrencyId { get; } - Id of the currency used for costing
  • int CustomerGroupResourceId { get; set; } - Resource id of the group that is the supplier
  • DateTime DeletedDate { get; } - Deleted date if deleted
  • string EntryNumber { get; set; } - CostBill Id that the you can reference
  • int EntryType { get; set; } - 3 = Finance, 4 = Creditor
  • DateTime IncurredDay { get; set; } - Day the expense occured
  • int IncurredUserResourceId { get; set; } - Resource id of the user that is attributed the expense
  • CompatibilityArray LedgerEntries { get; } - List of ledgers
  • DateTime ModifiedDate { get; } - Date last modification
  • string Name { get; set; } - Name of the CostBill, same as EntryNumber
  • string Note { get; set; } - Note that the you can reference
  • string ObjectTypeName { get; } - The name of the type of object.
  • bool Paid { get; } - True if was paid
  • DateTime PaidDate { get; set; } - Date the CostBill was paid
  • int ParentResourceId { get; set; } - Resource id of the resource the CostBill is stored under
  • string Reference { get; set; } - CostBill Id that the supplier can reference
  • int ResourceId { get; } - Resource id of the CostBill
  • int ResourceTemplateResourceId { get; set; } - Resource id of the resource template used. 0 to use default
  • bool Submitted { get; set; } - Get/Set if CostBill is submitted yet or not
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.

Examples

Create new CostBill resource

string name = "test";
number parent = 123456;
CostBill c = new CostBill (name, parent);
//c.CustomerGroupResourceId = 1234567;
//c.AttentionToUserResourceId = 12345678;
//c.IncurredUserResourceId = 123456789;
//c.IncurredDay = new DateTime();
LedgerEntry entry = new LedgerEntry ("entryName", c);
entry.Description = "xxxx";
entry.NumberOfUnits = 1;
entry.UnitCost = 100;
c.LedgerEntries.Add(entry);
c.Save();

set Paid for existing CostBill and edit its ledgerEntry

CostBill c = new CostBill(123456);
c.PaidDate = new DateTime(); 
array  a = c.LedgerEntries;
for (i for 0; a.Count)
{
	LedgerEntry entry = a[i];
	entry.UnitCost = 100;
}
c.Save();