Expense: Difference between revisions

From SemanticOrganization
Jump to: navigation, search
(Created page with "{{Semorg-generator |template-id=EX |form-unique-number=No |rows=date,description,amount-gross,amount-net |list-headers=expense-date,expense-description,expense-amount-gross,ex...")
 
No edit summary
Line 1: Line 1:
{{Semorg-generator
{{Semorg-generator
|template-id=EX
|template-id=EX
|form-add-button-text=Add expense
|form-unique-number=No
|form-unique-number=No
|rows=date,description,amount-gross,amount-net
|rows=date,description,amount-gross,amount-net

Revision as of 19:01, 19 April 2019


Messages

"semorg-expense-template": "semorg-expense",
"semorg-form-expense-add-button-text": "Add expense",

"semorg-form-expense-template": "expense",
"semorg-form-expense-rows": "date,description,amount-gross,amount-net",
"semorg-list-expense-headers": "expense-date,expense-description,expense-amount-gross,expense-amount-net",
"semorg-field-expense-account-name": "Account", 
"semorg-field-expense-account-parameters": "input type=combobox|values from category=semorg-account|mapping template=semorg-mapping-account",
"semorg-field-expense-amount-gross-name": "Amount gross", 
"semorg-field-expense-amount-gross-parameters": "size=5",
"semorg-field-expense-amount-net-name": "Amount net", 
"semorg-field-expense-amount-net-parameters": "size=5",
"semorg-field-expense-date-name": "Date", 
"semorg-field-expense-date-parameters": "input type=datepicker|size=10",
"semorg-field-expense-description-name": "Description", 
"semorg-field-expense-description-parameters": "input type=textarea|size=80|autogrow|rows=2",
"semorg-field-expense-expense-report-name": "Expense Report", 
"semorg-field-expense-expense-report-parameters": "",
"semorg-field-expense-project-name": "Project", 
"semorg-field-expense-project-parameters": "input type=combobox|values from category=Semorg-project|mapping-property=Semorg-project-title",
"semorg-field-expense-type-name": "Type", 
"semorg-field-expense-type-parameters": "",
"semorg-field-expense-vat-name": "VAT", 
"semorg-field-expense-vat-parameters": "size=5",

Form

Form:Semorg-expense

<noinclude>{{semorg-bundle}}</noinclude><includeonly>{{{info
   |create title={{int:semorg-form-expense-create-title}}
   |edit title={{int:semorg-form-expense-edit-title}}<span class="d-none">: <page name></span>
   |page name=
}}}

{{semorg-form-template|expense}}
 
{{semorg-form-standard-inputs}}
</includeonly>

as embedded:

Use this code, if this is not meant to be a standalone feature but rather a supplement that should be embedded in other forms. Add this line to a form definition that includes a field with the parameter holds template. The second parameter of the semorg-form-template-embed call should be the target field, specified with <feature>[<field>] (e.g. meeting-group[files] or {{int:semorg-meeting-group-template}}[files] to respect template customization).

{{semorg-form-template-embed|expense|}}

Category

Category:Semorg-expense

{{semorg-category}}

Template

Template:Semorg-expense

<noinclude>{{semorg-bundle}}</noinclude><includeonly>[[Category:{{int:semorg-expense-category}}]]{{#semorg-set:expense 
  |expense-report={{{expense-report|}}} 
  |type={{{type|}}} 
  |account={{{account|}}} 
  |vat={{{vat|}}} 
  |date={{{date|}}} 
  |description={{{description|}}} 
  |project={{{project|}}} 
  |amount-gross={{{amount-gross|}}} 
  |amount-net={{{amount-net|}}}
}}{{#semorg-detail:expense}}{{#semorg-table:expense 
  |expense-report={{{expense-report|}}} 
  |type={{{type|}}} 
  |account={{{account|}}} 
  |vat={{{vat|}}} 
  |date={{{date|}}} 
  |description={{{description|}}} 
  |project={{{project|}}} 
  |amount-gross={{{amount-gross|}}} 
  |amount-net={{{amount-net|}}}
}}</includeonly>

Row Template

Template:Semorg-expense-row

<noinclude>{{semorg-bundle}}</noinclude><includeonly><tr>
<td>[[{{{target|}}}]]</td> 
<td>{{{expense-report|}}}</td> 
<td>{{{type|}}}</td> 
<td>{{{account|}}}</td> 
<td>{{{vat|}}}</td> 
<td>{{{date|}}}</td> 
<td>{{{description|}}}</td> 
<td>{{{project|}}}</td> 
<td>{{{amount-gross|}}}</td> 
<td>{{{amount-net|}}}</td>
{{semorg-showedit
  |target={{{target|}}}
}}
</tr></includeonly>

Overview Page Template

Template:Semorg-expense-overview

<noinclude>{{semorg-bundle}}</noinclude><includeonly>{{#semorg-list:expense
  |heading={{int:semorg-expense-page-name}}
  |formlink={{#semorg-forminput:expense}}
  |links={{{links|}}}
  |query={{{query|}}}
  |sort={{{sort|}}}
  |order={{{order|}}}
  |limit={{{limit|}}}
  |filter links={{{filter links|}}}
  |filters={{{filters|}}}
  |category={{{category|}}}
  |headers={{{headers|}}}
  |row template={{{row template|}}}
  |tableclass={{{tableclass|}}}
  |title={{{title|}}}
  |sums={{{sums|}}}
  |csv={{{csv|}}}
  |default={{{default|}}}
  |returnto={{{returnto|}}}
  |help={{{help|}}}
}}</includeonly>

Overview Page

[[]]

{{semorg-expense-overview}}

Property Registration

Add the following line to LocalSettings.php:

$wgSemorgAdditionalProperties['expense'] = [ "id" => "EX","fields" => ["expense-report" => [ "id" => "ER","type" => "wpg" ],"type" => [ "id" => "TY","type" => "txt" ],"account" => [ "id" => "AC","type" => "wpg" ],"vat" => [ "id" => "VA","type" => "num" ],"date" => [ "id" => "DA","type" => "dat" ],"description" => [ "id" => "DE","type" => "txt" ],"project" => [ "id" => "PR","type" => "wpg" ],"amount-gross" => [ "id" => "AG","type" => "num" ],"amount-net" => [ "id" => "AN","type" => "num" ], ] ];