id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,400 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.setProperty | public function setProperty($property, $value)
{
if (property_exists($this, $property) && $property !== 'form') {
$this->$property = $value;
}
return $this;
} | php | public function setProperty($property, $value)
{
if (property_exists($this, $property) && $property !== 'form') {
$this->$property = $value;
}
return $this;
} | [
"public",
"function",
"setProperty",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"property",
")",
"&&",
"$",
"property",
"!==",
"'form'",
")",
"{",
"$",
"this",
"->",
"$",
"property",
"... | Sets the value of a property of this object.
The property must exist as property
@param string $property
@param mixed $value
@return $this | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"of",
"this",
"object",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L171-L177 |
30,401 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderFields | protected function renderFields(array $fields)
{
$output = '';
foreach ($fields as $id => $field) {
// Add defaults.
$field += array(
'id' => $id,
'name' => $id,
'label' => '',
'value' => '',
'des... | php | protected function renderFields(array $fields)
{
$output = '';
foreach ($fields as $id => $field) {
// Add defaults.
$field += array(
'id' => $id,
'name' => $id,
'label' => '',
'value' => '',
'des... | [
"protected",
"function",
"renderFields",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"id",
"=>",
"$",
"field",
")",
"{",
"// Add defaults.",
"$",
"field",
"+=",
"array",
"(",
"'id'",
... | Renders a set of field definitions.
@param array[] $fields
@return string | [
"Renders",
"a",
"set",
"of",
"field",
"definitions",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L204-L221 |
30,402 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderFieldset | protected function renderFieldset(array $field)
{
$output = '';
$output .= $this->fieldsetBegin($field);
$output .= $this->renderFields($field['fields']);
$output .= $this->fieldsetEnd($field);
return $output;
} | php | protected function renderFieldset(array $field)
{
$output = '';
$output .= $this->fieldsetBegin($field);
$output .= $this->renderFields($field['fields']);
$output .= $this->fieldsetEnd($field);
return $output;
} | [
"protected",
"function",
"renderFieldset",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"fieldsetBegin",
"(",
"$",
"field",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"renderFields"... | Renders a fieldset or details form element.
@param array $field
@return string
The rendered fieldset or details form element. | [
"Renders",
"a",
"fieldset",
"or",
"details",
"form",
"element",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L248-L255 |
30,403 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.fieldsetBegin | protected function fieldsetBegin(array $field)
{
$output = '';
$output .= $this->getWrapper($field['type'], $field['attributes']);
$titleTag = $field['type'] === 'fieldset' ? 'legend' : 'summary';
if (!empty($field[$titleTag])) {
$output .= $this->getWrapper($titleTag, $f... | php | protected function fieldsetBegin(array $field)
{
$output = '';
$output .= $this->getWrapper($field['type'], $field['attributes']);
$titleTag = $field['type'] === 'fieldset' ? 'legend' : 'summary';
if (!empty($field[$titleTag])) {
$output .= $this->getWrapper($titleTag, $f... | [
"protected",
"function",
"fieldsetBegin",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"getWrapper",
"(",
"$",
"field",
"[",
"'type'",
"]",
",",
"$",
"field",
"[",
"'attributes'",
"]",
"... | Outputs the beginning of a fieldset.
@param array $field
@return string | [
"Outputs",
"the",
"beginning",
"of",
"a",
"fieldset",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L264-L279 |
30,404 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.fieldsetEnd | protected function fieldsetEnd(array $field)
{
$output = '';
$output .= $this->getWrapperEnd('fieldsetContent');
$output .= $this->getWrapperEnd($field['type']);
return $output;
} | php | protected function fieldsetEnd(array $field)
{
$output = '';
$output .= $this->getWrapperEnd('fieldsetContent');
$output .= $this->getWrapperEnd($field['type']);
return $output;
} | [
"protected",
"function",
"fieldsetEnd",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"getWrapperEnd",
"(",
"'fieldsetContent'",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"getWrapperE... | Outputs the end of a fieldset.
@param array $field
@return string | [
"Outputs",
"the",
"end",
"of",
"a",
"fieldset",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L288-L294 |
30,405 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderSimpleField | protected function renderSimpleField(array $field)
{
if (!empty($field['ajax'])) {
$field = $this->addAjax($field);
}
$output = '';
// Split attributes over label and element.
$attributes = $field['attributes'];
$labelAttributes = array();
if (!e... | php | protected function renderSimpleField(array $field)
{
if (!empty($field['ajax'])) {
$field = $this->addAjax($field);
}
$output = '';
// Split attributes over label and element.
$attributes = $field['attributes'];
$labelAttributes = array();
if (!e... | [
"protected",
"function",
"renderSimpleField",
"(",
"array",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"field",
"[",
"'ajax'",
"]",
")",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"addAjax",
"(",
"$",
"field",
")",
";",
"}",
... | Renders a form field including its label and description.
@param array $field
@return string
Html for this form field. | [
"Renders",
"a",
"form",
"field",
"including",
"its",
"label",
"and",
"description",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L304-L339 |
30,406 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderElement | protected function renderElement($field)
{
$type = $field['type'];
switch ($type) {
case 'textarea':
case 'markup':
case 'select':
case 'radio':
case 'checkbox':
return $this->$type($field);
default:
... | php | protected function renderElement($field)
{
$type = $field['type'];
switch ($type) {
case 'textarea':
case 'markup':
case 'select':
case 'radio':
case 'checkbox':
return $this->$type($field);
default:
... | [
"protected",
"function",
"renderElement",
"(",
"$",
"field",
")",
"{",
"$",
"type",
"=",
"$",
"field",
"[",
"'type'",
"]",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'textarea'",
":",
"case",
"'markup'",
":",
"case",
"'select'",
":",
"case",
... | Renders a form field itself, ie without label and description.
@param $field
@return string
The html for the form element. | [
"Renders",
"a",
"form",
"field",
"itself",
"ie",
"without",
"label",
"and",
"description",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L349-L362 |
30,407 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderDescription | protected function renderDescription($text, $isFieldset = false)
{
$output = '';
// Help text.
if (!empty($text)) {
// Allow for links in the help text, so no filtering anymore.
$wrapperType = $isFieldset ? 'fieldsetDescription' : 'description';
$output .... | php | protected function renderDescription($text, $isFieldset = false)
{
$output = '';
// Help text.
if (!empty($text)) {
// Allow for links in the help text, so no filtering anymore.
$wrapperType = $isFieldset ? 'fieldsetDescription' : 'description';
$output .... | [
"protected",
"function",
"renderDescription",
"(",
"$",
"text",
",",
"$",
"isFieldset",
"=",
"false",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Help text.",
"if",
"(",
"!",
"empty",
"(",
"$",
"text",
")",
")",
"{",
"// Allow for links in the help text, so... | Renders a descriptive help text.
@param string $text
@param bool $isFieldset
@return string
The rendered description. | [
"Renders",
"a",
"descriptive",
"help",
"text",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L373-L387 |
30,408 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderLabel | protected function renderLabel($text, $id, array $attributes, $wrapLabel, $prefix = '', $postfix = '')
{
$output = '';
// Split attributes over label and wrapper.
$wrapperAttributes = array();
if (!empty($attributes['wrapper'])) {
$wrapperAttributes = $attributes['wrappe... | php | protected function renderLabel($text, $id, array $attributes, $wrapLabel, $prefix = '', $postfix = '')
{
$output = '';
// Split attributes over label and wrapper.
$wrapperAttributes = array();
if (!empty($attributes['wrapper'])) {
$wrapperAttributes = $attributes['wrappe... | [
"protected",
"function",
"renderLabel",
"(",
"$",
"text",
",",
"$",
"id",
",",
"array",
"$",
"attributes",
",",
"$",
"wrapLabel",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"postfix",
"=",
"''",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Split attrib... | Renders a label.
@param string $text
The label text.
@param string $id
The value of the for attribute. If the empty string, not a label tag
but a span with a class="label" will be rendered.
@param array $attributes
Any additional attributes to render for the label. The array is a keyed
array, the keys being the attrib... | [
"Renders",
"a",
"label",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L414-L446 |
30,409 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.input | protected function input(array $field)
{
$output = '';
// Tag around input element.
$output .= $this->getWrapper('input');
$attributes = $field['attributes'];
$attributes = $this->addAttribute($attributes, 'type', $field['type']);
$attributes = $this->addAttribute($... | php | protected function input(array $field)
{
$output = '';
// Tag around input element.
$output .= $this->getWrapper('input');
$attributes = $field['attributes'];
$attributes = $this->addAttribute($attributes, 'type', $field['type']);
$attributes = $this->addAttribute($... | [
"protected",
"function",
"input",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Tag around input element.",
"$",
"output",
".=",
"$",
"this",
"->",
"getWrapper",
"(",
"'input'",
")",
";",
"$",
"attributes",
"=",
"$",
"field",
"... | Renders an input field.
@param array $field
@return string
The rendered input field. | [
"Renders",
"an",
"input",
"field",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L456-L474 |
30,410 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.textarea | protected function textarea(array $field)
{
$output = '';
// Tag around input element.
$output .= $this->getWrapper('input');
$attributes = $field['attributes'];
$attributes = $this->addAttribute($attributes, 'id', $field['id']);
$attributes = $this->addAttribute($at... | php | protected function textarea(array $field)
{
$output = '';
// Tag around input element.
$output .= $this->getWrapper('input');
$attributes = $field['attributes'];
$attributes = $this->addAttribute($attributes, 'id', $field['id']);
$attributes = $this->addAttribute($at... | [
"protected",
"function",
"textarea",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Tag around input element.",
"$",
"output",
".=",
"$",
"this",
"->",
"getWrapper",
"(",
"'input'",
")",
";",
"$",
"attributes",
"=",
"$",
"field",
... | Renders a textarea field.
@param $field
@return string
The rendered textarea field. | [
"Renders",
"a",
"textarea",
"field",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L484-L501 |
30,411 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.select | protected function select(array $field)
{
$output = '';
// Tag around select element: same as for an input element.
$output .= $this->getWrapper('input');
// Select tag.
$attributes = $field['attributes'];
$attributes = $this->addAttribute($attributes, 'id', $field[... | php | protected function select(array $field)
{
$output = '';
// Tag around select element: same as for an input element.
$output .= $this->getWrapper('input');
// Select tag.
$attributes = $field['attributes'];
$attributes = $this->addAttribute($attributes, 'id', $field[... | [
"protected",
"function",
"select",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Tag around select element: same as for an input element.",
"$",
"output",
".=",
"$",
"this",
"->",
"getWrapper",
"(",
"'input'",
")",
";",
"// Select tag.",... | Renders a select element.
@param array $field
@return string
The rendered select element. | [
"Renders",
"a",
"select",
"element",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L531-L561 |
30,412 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.checkbox | protected function checkbox(array $field)
{
$output = '';
// Div tag.
$attributes = $field['attributes'];
//? unset($attributes['required']);
$output .= $this->getWrapper('input', $attributes);
$output .= $this->getWrapper('checkbox', $attributes);
// Checkb... | php | protected function checkbox(array $field)
{
$output = '';
// Div tag.
$attributes = $field['attributes'];
//? unset($attributes['required']);
$output .= $this->getWrapper('input', $attributes);
$output .= $this->getWrapper('checkbox', $attributes);
// Checkb... | [
"protected",
"function",
"checkbox",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Div tag.",
"$",
"attributes",
"=",
"$",
"field",
"[",
"'attributes'",
"]",
";",
"//? unset($attributes['required']);",
"$",
"output",
".=",
"$"... | Renders a list of checkboxes.
@param array $field
@return string
The rendered checkboxes. | [
"Renders",
"a",
"list",
"of",
"checkboxes",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L619-L652 |
30,413 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.getWrapper | protected function getWrapper($type, array $attributes = array())
{
$tag = "{$type}WrapperTag";
$class = "{$type}WrapperClass";
$output = '';
if (!empty($this->$tag)) {
if (!empty($this->$class)) {
$attributes = $this->addAttribute($attributes, 'class', $t... | php | protected function getWrapper($type, array $attributes = array())
{
$tag = "{$type}WrapperTag";
$class = "{$type}WrapperClass";
$output = '';
if (!empty($this->$tag)) {
if (!empty($this->$class)) {
$attributes = $this->addAttribute($attributes, 'class', $t... | [
"protected",
"function",
"getWrapper",
"(",
"$",
"type",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"tag",
"=",
"\"{$type}WrapperTag\"",
";",
"$",
"class",
"=",
"\"{$type}WrapperClass\"",
";",
"$",
"output",
"=",
"''",
";",
"... | Returns the open tag for a wrapper element.
@param string $type
@param array $attributes
@return string | [
"Returns",
"the",
"open",
"tag",
"for",
"a",
"wrapper",
"element",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L662-L674 |
30,414 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.getWrapperEnd | protected function getWrapperEnd($type)
{
$tag = "{$type}WrapperTag";
$output = '';
if (!empty($this->$tag)) {
$output .= $this->getCloseTag($this->$tag);
}
return $output;
} | php | protected function getWrapperEnd($type)
{
$tag = "{$type}WrapperTag";
$output = '';
if (!empty($this->$tag)) {
$output .= $this->getCloseTag($this->$tag);
}
return $output;
} | [
"protected",
"function",
"getWrapperEnd",
"(",
"$",
"type",
")",
"{",
"$",
"tag",
"=",
"\"{$type}WrapperTag\"",
";",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"$",
"tag",
")",
")",
"{",
"$",
"output",
".=",
"$"... | Returns the closing tag for a wrapper element.
@param string $type
@return string | [
"Returns",
"the",
"closing",
"tag",
"for",
"a",
"wrapper",
"element",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L683-L691 |
30,415 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.getOpenTag | protected function getOpenTag($tag, array $attributes = array(), $selfClosing = false)
{
return '<' . htmlspecialchars($tag, ENT_QUOTES, 'ISO-8859-1') . $this->renderAttributes($attributes) . ($selfClosing && !$this->html5 ? '/' : '') . '>';
} | php | protected function getOpenTag($tag, array $attributes = array(), $selfClosing = false)
{
return '<' . htmlspecialchars($tag, ENT_QUOTES, 'ISO-8859-1') . $this->renderAttributes($attributes) . ($selfClosing && !$this->html5 ? '/' : '') . '>';
} | [
"protected",
"function",
"getOpenTag",
"(",
"$",
"tag",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"selfClosing",
"=",
"false",
")",
"{",
"return",
"'<'",
".",
"htmlspecialchars",
"(",
"$",
"tag",
",",
"ENT_QUOTES",
",",
"'ISO-885... | Returns a secured html open tag string.
@param string $tag
The html tag.
@param array $attributes
The attributes to render.
@param bool $selfClosing
Whether the tag is self closing. Only in html4 this will add a /
character before the closing > character.
@return string
The rendered open tag. | [
"Returns",
"a",
"secured",
"html",
"open",
"tag",
"string",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L707-L710 |
30,416 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.renderAttributes | protected function renderAttributes(array $attributes)
{
$attributeString = '';
foreach ($attributes as $key => $value) {
if (is_array($value)) {
$value = implode(' ', $value);
}
// Skip attributes that are not to be set (required, disabled, ...).
... | php | protected function renderAttributes(array $attributes)
{
$attributeString = '';
foreach ($attributes as $key => $value) {
if (is_array($value)) {
$value = implode(' ', $value);
}
// Skip attributes that are not to be set (required, disabled, ...).
... | [
"protected",
"function",
"renderAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"attributeString",
"=",
"''",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
... | Renders a list of attributes.
@param array $attributes
@return string
html string with the rendered attributes and 1 space in front of it. | [
"Renders",
"a",
"list",
"of",
"attributes",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L734-L755 |
30,417 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.addLabelAttributes | protected function addLabelAttributes(array $attributes, $id)
{
$attributes = $this->addAttribute($attributes, 'for', $id);
if (empty($id)) {
$attributes = $this->addAttribute($attributes, 'class', $this->multiLabelClass);
}
return $attributes;
} | php | protected function addLabelAttributes(array $attributes, $id)
{
$attributes = $this->addAttribute($attributes, 'for', $id);
if (empty($id)) {
$attributes = $this->addAttribute($attributes, 'class', $this->multiLabelClass);
}
return $attributes;
} | [
"protected",
"function",
"addLabelAttributes",
"(",
"array",
"$",
"attributes",
",",
"$",
"id",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"addAttribute",
"(",
"$",
"attributes",
",",
"'for'",
",",
"$",
"id",
")",
";",
"if",
"(",
"empty",
"("... | Adds a set of attributes specific for a label.
@param array $attributes
@param string $id
@return array | [
"Adds",
"a",
"set",
"of",
"attributes",
"specific",
"for",
"a",
"label",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L812-L819 |
30,418 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.isOptionSelected | protected function isOptionSelected($selectedValues, $option)
{
return is_array($selectedValues) ? in_array((string) $option, $selectedValues,false) : (string) $option === (string) $selectedValues;
} | php | protected function isOptionSelected($selectedValues, $option)
{
return is_array($selectedValues) ? in_array((string) $option, $selectedValues,false) : (string) $option === (string) $selectedValues;
} | [
"protected",
"function",
"isOptionSelected",
"(",
"$",
"selectedValues",
",",
"$",
"option",
")",
"{",
"return",
"is_array",
"(",
"$",
"selectedValues",
")",
"?",
"in_array",
"(",
"(",
"string",
")",
"$",
"option",
",",
"$",
"selectedValues",
",",
"false",
... | Returns whether an option is part of a set of selected values.
@param string|int|array $selectedValues
The set of selected values, may be just 1 scalar value.
@param string|int $option
The option to search for in the set of selected values.
@return bool
If this option is part of the selected values. | [
"Returns",
"whether",
"an",
"option",
"is",
"part",
"of",
"a",
"set",
"of",
"selected",
"values",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L872-L875 |
30,419 | SIELOnline/libAcumulus | src/Helpers/FormRenderer.php | FormRenderer.addAjax | protected function addAjax(array $field)
{
// We add a class so this element can be recognised by js as having an
// ajax action.
$field['attributes'] = $this->addAttribute($field['attributes'], 'class', 'acumulus-ajax');
// Add the data`-* attributes.
if (!empty($field['aja... | php | protected function addAjax(array $field)
{
// We add a class so this element can be recognised by js as having an
// ajax action.
$field['attributes'] = $this->addAttribute($field['attributes'], 'class', 'acumulus-ajax');
// Add the data`-* attributes.
if (!empty($field['aja... | [
"protected",
"function",
"addAjax",
"(",
"array",
"$",
"field",
")",
"{",
"// We add a class so this element can be recognised by js as having an",
"// ajax action.",
"$",
"field",
"[",
"'attributes'",
"]",
"=",
"$",
"this",
"->",
"addAttribute",
"(",
"$",
"field",
"[... | Processes the ajax setting on a field.
The ajax setting is typically an array with data values to be added as
data-* attributes tot he fom element.
@param array $field
The field for which an ajax action is to be enabled.
@return array
The field with ajax settings mapped to additional attributes. | [
"Processes",
"the",
"ajax",
"setting",
"on",
"a",
"field",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/FormRenderer.php#L889-L903 |
30,420 | SIELOnline/libAcumulus | src/Invoice/CompletorStrategy/ApplySameVatRate.php | ApplySameVatRate.tryVatRate | protected function tryVatRate($vatRate)
{
$this->description = "ApplySameVatRate($vatRate)";
$this->replacingLines = array();
$vatAmount = 0.0;
foreach ($this->lines2Complete as $line2Complete) {
$vatAmount += $this->completeLine($line2Complete, $vatRate);
}
... | php | protected function tryVatRate($vatRate)
{
$this->description = "ApplySameVatRate($vatRate)";
$this->replacingLines = array();
$vatAmount = 0.0;
foreach ($this->lines2Complete as $line2Complete) {
$vatAmount += $this->completeLine($line2Complete, $vatRate);
}
... | [
"protected",
"function",
"tryVatRate",
"(",
"$",
"vatRate",
")",
"{",
"$",
"this",
"->",
"description",
"=",
"\"ApplySameVatRate($vatRate)\"",
";",
"$",
"this",
"->",
"replacingLines",
"=",
"array",
"(",
")",
";",
"$",
"vatAmount",
"=",
"0.0",
";",
"foreach"... | Tries 1 of the possible vat rates.
@param float $vatRate
@return bool | [
"Tries",
"1",
"of",
"the",
"possible",
"vat",
"rates",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorStrategy/ApplySameVatRate.php#L58-L71 |
30,421 | SIELOnline/libAcumulus | src/WooCommerce/Helpers/Token.php | Token.getDataValue | protected function getDataValue(array $data, $property)
{
$value = null;
if (array_key_exists($property, $data)) {
// Found: return the value.
$value = $data[$property];
} else {
// Not found: check in meta data or descend recursively.
if (isse... | php | protected function getDataValue(array $data, $property)
{
$value = null;
if (array_key_exists($property, $data)) {
// Found: return the value.
$value = $data[$property];
} else {
// Not found: check in meta data or descend recursively.
if (isse... | [
"protected",
"function",
"getDataValue",
"(",
"array",
"$",
"data",
",",
"$",
"property",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"property",
",",
"$",
"data",
")",
")",
"{",
"// Found: return the value.",
"$",
... | Extracts a value from a WooCommerce data object data array.
A WooCommerce data array (array with key value pairs returned from the
WC_Data::get_data() method may contain recursive data sets, e.g.
'billing' for the billing address, and a separate meta_data set.
This method recursively searches for the property by stri... | [
"Extracts",
"a",
"value",
"from",
"a",
"WooCommerce",
"data",
"object",
"data",
"array",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Helpers/Token.php#L58-L78 |
30,422 | SIELOnline/libAcumulus | src/WooCommerce/Helpers/Token.php | Token.getMetaDataValue | protected function getMetaDataValue(array $metaData, $property)
{
$property = ltrim($property, '_');
$value = null;
foreach ($metaData as $metaItem) {
$key = ltrim($metaItem->key, '_');
if ($property === $key) {
$value = $metaItem->value;
bre... | php | protected function getMetaDataValue(array $metaData, $property)
{
$property = ltrim($property, '_');
$value = null;
foreach ($metaData as $metaItem) {
$key = ltrim($metaItem->key, '_');
if ($property === $key) {
$value = $metaItem->value;
bre... | [
"protected",
"function",
"getMetaDataValue",
"(",
"array",
"$",
"metaData",
",",
"$",
"property",
")",
"{",
"$",
"property",
"=",
"ltrim",
"(",
"$",
"property",
",",
"'_'",
")",
";",
"$",
"value",
"=",
"null",
";",
"foreach",
"(",
"$",
"metaData",
"as"... | Extracts a value from a set of WooCommerce meta data objects.
WooCommerce meta data is stored in objects having twice the set of
properties id, key, and value, once in the property current_value and
once in the property data. If 1 of the properties id, key or value is
retrieved, its value from the current_value set is... | [
"Extracts",
"a",
"value",
"from",
"a",
"set",
"of",
"WooCommerce",
"meta",
"data",
"objects",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Helpers/Token.php#L100-L112 |
30,423 | SIELOnline/libAcumulus | src/Shop/AcumulusEntry.php | AcumulusEntry.getEntryId | public function getEntryId()
{
$entryId = $this->get(static::$keyEntryId);
if (!empty($entryId)) {
$entryId = (int) $entryId;
}
return $entryId;
} | php | public function getEntryId()
{
$entryId = $this->get(static::$keyEntryId);
if (!empty($entryId)) {
$entryId = (int) $entryId;
}
return $entryId;
} | [
"public",
"function",
"getEntryId",
"(",
")",
"{",
"$",
"entryId",
"=",
"$",
"this",
"->",
"get",
"(",
"static",
"::",
"$",
"keyEntryId",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"entryId",
")",
")",
"{",
"$",
"entryId",
"=",
"(",
"int",
")",... | Returns the entry id for this Acumulus entry.
@return int|null
The entry id of this Acumulus entry or null if it was stored as a
concept. | [
"Returns",
"the",
"entry",
"id",
"for",
"this",
"Acumulus",
"entry",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntry.php#L76-L83 |
30,424 | SIELOnline/libAcumulus | src/Shop/AcumulusEntry.php | AcumulusEntry.getCreated | public function getCreated($raw = false)
{
$result = $this->get(static::$keyCreated);
if (!$raw) {
$result = $this->toDateTime($result);
}
return $result;
} | php | public function getCreated($raw = false)
{
$result = $this->get(static::$keyCreated);
if (!$raw) {
$result = $this->toDateTime($result);
}
return $result;
} | [
"public",
"function",
"getCreated",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"get",
"(",
"static",
"::",
"$",
"keyCreated",
")",
";",
"if",
"(",
"!",
"$",
"raw",
")",
"{",
"$",
"result",
"=",
"$",
"this",
... | Returns the time when this record was created.
@param bool $raw
Whether to return the raw value as stored in the database, or a
Datetime object. The raw value will differ per webshop.
@return string|int|\DateTime
The timestamp when this record was created. | [
"Returns",
"the",
"time",
"when",
"this",
"record",
"was",
"created",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntry.php#L129-L136 |
30,425 | SIELOnline/libAcumulus | src/Shop/AcumulusEntry.php | AcumulusEntry.getUpdated | public function getUpdated($raw = false)
{
$result = $this->get(static::$keyUpdated);
if (!$raw) {
$result = $this->toDateTime($result);
}
return $result;
} | php | public function getUpdated($raw = false)
{
$result = $this->get(static::$keyUpdated);
if (!$raw) {
$result = $this->toDateTime($result);
}
return $result;
} | [
"public",
"function",
"getUpdated",
"(",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"get",
"(",
"static",
"::",
"$",
"keyUpdated",
")",
";",
"if",
"(",
"!",
"$",
"raw",
")",
"{",
"$",
"result",
"=",
"$",
"this",
... | Returns the time when this record was last updated.
@param bool $raw
Whether to return the raw value as stored in the database, or a
Datetime object. The raw value will differ per webshop.
@return string|int|\DateTime
The timestamp when this record was last updated. | [
"Returns",
"the",
"time",
"when",
"this",
"record",
"was",
"last",
"updated",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntry.php#L148-L155 |
30,426 | SIELOnline/libAcumulus | src/Shop/AcumulusEntry.php | AcumulusEntry.get | protected function get($field)
{
$value = null;
if (is_array($this->record)) {
// Value may be null: use array_key_exists(), not isset().
if (array_key_exists($field, $this->record)) {
$value = $this->record[$field];
}
} elseif (is_object($... | php | protected function get($field)
{
$value = null;
if (is_array($this->record)) {
// Value may be null: use array_key_exists(), not isset().
if (array_key_exists($field, $this->record)) {
$value = $this->record[$field];
}
} elseif (is_object($... | [
"protected",
"function",
"get",
"(",
"$",
"field",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"record",
")",
")",
"{",
"// Value may be null: use array_key_exists(), not isset().",
"if",
"(",
"array_key_exists",
"(... | Returns the value of the given field in the given acumulus entry record.
As different webshops may use different field and property names in their
tables and models, we abstracted accessing a field of a record into this
method.
@param string $field
The field to search for.
@return mixed|null
The value of the given f... | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"field",
"in",
"the",
"given",
"acumulus",
"entry",
"record",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntry.php#L204-L227 |
30,427 | SIELOnline/libAcumulus | SielAcumulusAutoloader.php | SielAcumulusAutoloader.register | public static function register()
{
// In some shops (OpenCart1) there's not one central entry point and
// we may risk registering twice.
static $hasBeenRegistered = false;
if (!$hasBeenRegistered) {
$dir = __DIR__ . '/src/';
$ourNamespace = 'Siel\\Acumulus\... | php | public static function register()
{
// In some shops (OpenCart1) there's not one central entry point and
// we may risk registering twice.
static $hasBeenRegistered = false;
if (!$hasBeenRegistered) {
$dir = __DIR__ . '/src/';
$ourNamespace = 'Siel\\Acumulus\... | [
"public",
"static",
"function",
"register",
"(",
")",
"{",
"// In some shops (OpenCart1) there's not one central entry point and",
"// we may risk registering twice.",
"static",
"$",
"hasBeenRegistered",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"hasBeenRegistered",
")",
"{",... | Registers an autoloader for the Siel\Acumulus namespace.
As not all web shops support auto-loading based on namespaces or have
other glitches, eg. expecting lower cased file names, we define our own
autoloader. If the module cannot use the autoloader of the web shop, this
method should be called during bootstrapping o... | [
"Registers",
"an",
"autoloader",
"for",
"the",
"Siel",
"\\",
"Acumulus",
"namespace",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/SielAcumulusAutoloader.php#L20-L44 |
30,428 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.setStatus | private function setStatus($status, $message = '')
{
if ($status > $this->status) {
$this->status = $status;
// Save the message belonging to this worse state.
if (!empty($message)) {
$this->statusMessage = $message;
}
}
} | php | private function setStatus($status, $message = '')
{
if ($status > $this->status) {
$this->status = $status;
// Save the message belonging to this worse state.
if (!empty($message)) {
$this->statusMessage = $message;
}
}
} | [
"private",
"function",
"setStatus",
"(",
"$",
"status",
",",
"$",
"message",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"status",
">",
"$",
"this",
"->",
"status",
")",
"{",
"$",
"this",
"->",
"status",
"=",
"$",
"status",
";",
"// Save the message belonging... | Sets the status, but only if it is "worse" than the current status.
@param int $status
The status to set.
@param string $message
Optionally, a message indicating what is wrong may be given. | [
"Sets",
"the",
"status",
"but",
"only",
"if",
"it",
"is",
"worse",
"than",
"the",
"current",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L142-L151 |
30,429 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getStatusClass | public function getStatusClass($status)
{
switch ($status) {
case static::Status_Success:
$result = 'success';
break;
case static::Status_Info:
$result = 'info';
break;
case static::Status_Warning:
... | php | public function getStatusClass($status)
{
switch ($status) {
case static::Status_Success:
$result = 'success';
break;
case static::Status_Info:
$result = 'info';
break;
case static::Status_Warning:
... | [
"public",
"function",
"getStatusClass",
"(",
"$",
"status",
")",
"{",
"switch",
"(",
"$",
"status",
")",
"{",
"case",
"static",
"::",
"Status_Success",
":",
"$",
"result",
"=",
"'success'",
";",
"break",
";",
"case",
"static",
"::",
"Status_Info",
":",
"... | Returns a string to use as css class for the current status.
@param int $status
@return string | [
"Returns",
"a",
"string",
"to",
"use",
"as",
"css",
"class",
"for",
"the",
"current",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L169-L187 |
30,430 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getStatusIcon | private function getStatusIcon($status)
{
switch ($status) {
case static::Status_Success:
$result = json_decode('"\u2714"');
break;
case static::Status_Info:
case static::Status_Warning:
$result = '!';
break;... | php | private function getStatusIcon($status)
{
switch ($status) {
case static::Status_Success:
$result = json_decode('"\u2714"');
break;
case static::Status_Info:
case static::Status_Warning:
$result = '!';
break;... | [
"private",
"function",
"getStatusIcon",
"(",
"$",
"status",
")",
"{",
"switch",
"(",
"$",
"status",
")",
"{",
"case",
"static",
"::",
"Status_Success",
":",
"$",
"result",
"=",
"json_decode",
"(",
"'\"\\u2714\"'",
")",
";",
"break",
";",
"case",
"static",
... | Returns an icon character that represents the current status.
@param int $status
@return string
An icon character that represents the status. | [
"Returns",
"an",
"icon",
"character",
"that",
"represents",
"the",
"current",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L197-L213 |
30,431 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getStatusLabelAttributes | private function getStatusLabelAttributes($status, $statusMessage)
{
$statusClass = $this->getStatusClass($status);
$attributes = array(
'class' => array('notice', 'notice-' . $statusClass),
'wrapper' => array(
'class' => array('notice', 'notice-' . $statusCla... | php | private function getStatusLabelAttributes($status, $statusMessage)
{
$statusClass = $this->getStatusClass($status);
$attributes = array(
'class' => array('notice', 'notice-' . $statusClass),
'wrapper' => array(
'class' => array('notice', 'notice-' . $statusCla... | [
"private",
"function",
"getStatusLabelAttributes",
"(",
"$",
"status",
",",
"$",
"statusMessage",
")",
"{",
"$",
"statusClass",
"=",
"$",
"this",
"->",
"getStatusClass",
"(",
"$",
"status",
")",
";",
"$",
"attributes",
"=",
"array",
"(",
"'class'",
"=>",
"... | Returns a set of label attributes for the current status.
@param int $status
@param string $statusMessage
@return array
A set of attributes to add to the label. | [
"Returns",
"a",
"set",
"of",
"label",
"attributes",
"for",
"the",
"current",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L224-L237 |
30,432 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getAmountStatusTitle | private function getAmountStatusTitle($status)
{
$result = '';
if ($status > static::Status_Success) {
$result = $this->t('amount_status_' . $status);
}
return $result;
} | php | private function getAmountStatusTitle($status)
{
$result = '';
if ($status > static::Status_Success) {
$result = $this->t('amount_status_' . $status);
}
return $result;
} | [
"private",
"function",
"getAmountStatusTitle",
"(",
"$",
"status",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"$",
"status",
">",
"static",
"::",
"Status_Success",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"t",
"(",
"'amount_status_'",
... | Returns a description of the amount status.
@param int $status
@return string
A description of the amount status. | [
"Returns",
"a",
"description",
"of",
"the",
"amount",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L247-L254 |
30,433 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.setSubmittedSource | private function setSubmittedSource()
{
// Get actual source ($this->source may be the parent, not the source to
// execute on). Do so without trusting the input.
$sourceType = $this->getSubmittedValue('type') === Source::Order ? Source::Order : Source::CreditNote;
$sourceId = (int) ... | php | private function setSubmittedSource()
{
// Get actual source ($this->source may be the parent, not the source to
// execute on). Do so without trusting the input.
$sourceType = $this->getSubmittedValue('type') === Source::Order ? Source::Order : Source::CreditNote;
$sourceId = (int) ... | [
"private",
"function",
"setSubmittedSource",
"(",
")",
"{",
"// Get actual source ($this->source may be the parent, not the source to",
"// execute on). Do so without trusting the input.",
"$",
"sourceType",
"=",
"$",
"this",
"->",
"getSubmittedValue",
"(",
"'type'",
")",
"===",
... | Extracts the source on which the submitted action is targeted. | [
"Extracts",
"the",
"source",
"on",
"which",
"the",
"submitted",
"action",
"is",
"targeted",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L275-L292 |
30,434 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getFields1Source | private function getFields1Source(Source $source, $localEntryInfo)
{
$this->resetStatus();
// Get invoice status field and other invoice status related info.
$statusInfo = $this->getInvoiceStatusInfo($localEntryInfo);
$this->setStatus($statusInfo['severity'], $statusInfo['severity-m... | php | private function getFields1Source(Source $source, $localEntryInfo)
{
$this->resetStatus();
// Get invoice status field and other invoice status related info.
$statusInfo = $this->getInvoiceStatusInfo($localEntryInfo);
$this->setStatus($statusInfo['severity'], $statusInfo['severity-m... | [
"private",
"function",
"getFields1Source",
"(",
"Source",
"$",
"source",
",",
"$",
"localEntryInfo",
")",
"{",
"$",
"this",
"->",
"resetStatus",
"(",
")",
";",
"// Get invoice status field and other invoice status related info.",
"$",
"statusInfo",
"=",
"$",
"this",
... | Returns the overview for 1 source.
@param \Siel\Acumulus\Invoice\Source $source
@param \Siel\Acumulus\Shop\AcumulusEntry|null $localEntryInfo
@return array[]
The fields that describe the status for 1 source. | [
"Returns",
"the",
"overview",
"for",
"1",
"source",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L414-L478 |
30,435 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getInvoiceStatusInfo | private function getInvoiceStatusInfo($localEntryInfo)
{
$result = null;
$entry = null;
$arg1 = null;
$arg2 = null;
$description = '';
$statusMessage = null;
if ($localEntryInfo === null) {
$invoiceStatus = static::Invoice_NotSent;
$sta... | php | private function getInvoiceStatusInfo($localEntryInfo)
{
$result = null;
$entry = null;
$arg1 = null;
$arg2 = null;
$description = '';
$statusMessage = null;
if ($localEntryInfo === null) {
$invoiceStatus = static::Invoice_NotSent;
$sta... | [
"private",
"function",
"getInvoiceStatusInfo",
"(",
"$",
"localEntryInfo",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"entry",
"=",
"null",
";",
"$",
"arg1",
"=",
"null",
";",
"$",
"arg2",
"=",
"null",
";",
"$",
"description",
"=",
"''",
";",
"$... | Returns status related information.
@param \Siel\Acumulus\Shop\AcumulusEntry|null $localEntryInfo
@return array
Keyed array with keys:
- status (string): 1 of the ShopOrderOverviewForm::Status_ constants.
- send-status (string): 1 of the ShopOrderOverviewForm::Invoice_ constants.
- result (\Siel\Acumulus\Web\Result?)... | [
"Returns",
"status",
"related",
"information",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L493-L545 |
30,436 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getNotSentFields | private function getNotSentFields(Source $source)
{
$fields = array();
$fields += array(
'send' => array(
'type' => 'button',
'ajax' => array(
'service' => 'invoice_add',
'parent_type' => $this->source->getType(),
... | php | private function getNotSentFields(Source $source)
{
$fields = array();
$fields += array(
'send' => array(
'type' => 'button',
'ajax' => array(
'service' => 'invoice_add',
'parent_type' => $this->source->getType(),
... | [
"private",
"function",
"getNotSentFields",
"(",
"Source",
"$",
"source",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"fields",
"+=",
"array",
"(",
"'send'",
"=>",
"array",
"(",
"'type'",
"=>",
"'button'",
",",
"'ajax'",
"=>",
"array",
"(... | Returns additional form fields to show when the invoice has not yet been
sent.
@param \Siel\Acumulus\Invoice\Source $source
The Source for which the invoice has not yet been sent.
@return array[]
Array of form fields. | [
"Returns",
"additional",
"form",
"fields",
"to",
"show",
"when",
"the",
"invoice",
"has",
"not",
"yet",
"been",
"sent",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L557-L576 |
30,437 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getConceptFields | private function getConceptFields(Source $source)
{
$fields = array();
$fields += array(
'send' => array(
'type' => 'button',
'value' => $this->t('send_again'),
'ajax' => array(
'service' => 'invoice_add',
... | php | private function getConceptFields(Source $source)
{
$fields = array();
$fields += array(
'send' => array(
'type' => 'button',
'value' => $this->t('send_again'),
'ajax' => array(
'service' => 'invoice_add',
... | [
"private",
"function",
"getConceptFields",
"(",
"Source",
"$",
"source",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"fields",
"+=",
"array",
"(",
"'send'",
"=>",
"array",
"(",
"'type'",
"=>",
"'button'",
",",
"'value'",
"=>",
"$",
"this... | Returns additional form fields to show when the invoice has been sent as
concept.
@param \Siel\Acumulus\Invoice\Source $source
The Source for which the invoice was sent as concept.
@return array[]
Array of form fields. | [
"Returns",
"additional",
"form",
"fields",
"to",
"show",
"when",
"the",
"invoice",
"has",
"been",
"sent",
"as",
"concept",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L588-L606 |
30,438 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getCommunicationErrorFields | private function getCommunicationErrorFields(Result $result)
{
$fields = array();
$fields += array(
'messages' => array(
'type' => 'markup',
'label' => $this->t('messages'),
'value' => $result->getMessages(Result::Format_FormattedText),
... | php | private function getCommunicationErrorFields(Result $result)
{
$fields = array();
$fields += array(
'messages' => array(
'type' => 'markup',
'label' => $this->t('messages'),
'value' => $result->getMessages(Result::Format_FormattedText),
... | [
"private",
"function",
"getCommunicationErrorFields",
"(",
"Result",
"$",
"result",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"fields",
"+=",
"array",
"(",
"'messages'",
"=>",
"array",
"(",
"'type'",
"=>",
"'markup'",
",",
"'label'",
"=>",... | Returns additional form fields to show when the invoice has been sent but
a communication error occurred in retrieving the entry.
@param \Siel\Acumulus\Web\Result $result
The result that details the error.
@return array[]
Array of form fields. | [
"Returns",
"additional",
"form",
"fields",
"to",
"show",
"when",
"the",
"invoice",
"has",
"been",
"sent",
"but",
"a",
"communication",
"error",
"occurred",
"in",
"retrieving",
"the",
"entry",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L618-L629 |
30,439 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getNonExistingFields | private function getNonExistingFields(Source $source)
{
$fields = array();
$fields += array(
'send' => array(
'type' => 'button',
'value' => $this->t('send_again'),
'ajax' => array(
'service' => 'invoice_add',
... | php | private function getNonExistingFields(Source $source)
{
$fields = array();
$fields += array(
'send' => array(
'type' => 'button',
'value' => $this->t('send_again'),
'ajax' => array(
'service' => 'invoice_add',
... | [
"private",
"function",
"getNonExistingFields",
"(",
"Source",
"$",
"source",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"fields",
"+=",
"array",
"(",
"'send'",
"=>",
"array",
"(",
"'type'",
"=>",
"'button'",
",",
"'value'",
"=>",
"$",
"... | Returns additional form fields to show when the invoice has been sent but
does no longer exist.
@param \Siel\Acumulus\Invoice\Source $source
The Source for which the invoice does no longer exist.
@return array[]
Array of form fields. | [
"Returns",
"additional",
"form",
"fields",
"to",
"show",
"when",
"the",
"invoice",
"has",
"been",
"sent",
"but",
"does",
"no",
"longer",
"exist",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L641-L659 |
30,440 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getDeletedFields | private function getDeletedFields(Source $source)
{
$fields = array();
$fields += array(
'undelete' => array(
'type' => 'button',
'value' => $this->t('undelete'),
'ajax' => array(
'service' => 'entry_deletestatus_set',
... | php | private function getDeletedFields(Source $source)
{
$fields = array();
$fields += array(
'undelete' => array(
'type' => 'button',
'value' => $this->t('undelete'),
'ajax' => array(
'service' => 'entry_deletestatus_set',
... | [
"private",
"function",
"getDeletedFields",
"(",
"Source",
"$",
"source",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"fields",
"+=",
"array",
"(",
"'undelete'",
"=>",
"array",
"(",
"'type'",
"=>",
"'button'",
",",
"'value'",
"=>",
"$",
"... | Returns additional form fields to show when the invoice has been sent but
subsequently has been deleted in Acumulus.
@param \Siel\Acumulus\Invoice\Source $source
The Source for which the invoice has been deleted.
@return array[]
Array of form fields. | [
"Returns",
"additional",
"form",
"fields",
"to",
"show",
"when",
"the",
"invoice",
"has",
"been",
"sent",
"but",
"subsequently",
"has",
"been",
"deleted",
"in",
"Acumulus",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L671-L701 |
30,441 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getEntryFields | private function getEntryFields(Source $source, BaseAcumulusEntry $localEntryInfo, array $entry)
{
/* keys in $entry array:
* - entryid
* * entrydate: yy-mm-dd
* - entrytype
* - entrydescription
* - entrynote
* - fiscaltype
* * vat... | php | private function getEntryFields(Source $source, BaseAcumulusEntry $localEntryInfo, array $entry)
{
/* keys in $entry array:
* - entryid
* * entrydate: yy-mm-dd
* - entrytype
* - entrydescription
* - entrynote
* - fiscaltype
* * vat... | [
"private",
"function",
"getEntryFields",
"(",
"Source",
"$",
"source",
",",
"BaseAcumulusEntry",
"$",
"localEntryInfo",
",",
"array",
"$",
"entry",
")",
"{",
"/* keys in $entry array:\n * - entryid\n * * entrydate: yy-mm-dd\n * - entrytype\n * ... | Returns additional form fields to show when the invoice is still there.
@param \Siel\Acumulus\Invoice\Source $source
@param \Siel\Acumulus\Shop\AcumulusEntry $localEntryInfo
@param array $entry
@return array[]
Array of form fields. | [
"Returns",
"additional",
"form",
"fields",
"to",
"show",
"when",
"the",
"invoice",
"is",
"still",
"there",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L713-L748 |
30,442 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getVatTypeField | private function getVatTypeField(array $entry)
{
if (!empty($entry['vatreversecharge'])) {
if (!empty($entry['foreigneu'])) {
$vatType = API::VatType_EuReversed;
} else {
$vatType = API::VatType_NationalReversed;
}
} elseif (!empty(... | php | private function getVatTypeField(array $entry)
{
if (!empty($entry['vatreversecharge'])) {
if (!empty($entry['foreigneu'])) {
$vatType = API::VatType_EuReversed;
} else {
$vatType = API::VatType_NationalReversed;
}
} elseif (!empty(... | [
"private",
"function",
"getVatTypeField",
"(",
"array",
"$",
"entry",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"entry",
"[",
"'vatreversecharge'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"entry",
"[",
"'foreigneu'",
"]",
")",
")",
... | Returns the vat type field.
@param array $entry
@return array
The vattype field. | [
"Returns",
"the",
"vat",
"type",
"field",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L758-L782 |
30,443 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getAmountFields | private function getAmountFields(Source $source, array $entry)
{
$fields = array();
if (!empty($entry['totalvalue']) && !empty($entry['totalvalueexclvat'])) {
// Get Acumulus amounts.
$amountExAcumulus = $entry['totalvalueexclvat'];
$amountIncAcumulus = $entry['to... | php | private function getAmountFields(Source $source, array $entry)
{
$fields = array();
if (!empty($entry['totalvalue']) && !empty($entry['totalvalueexclvat'])) {
// Get Acumulus amounts.
$amountExAcumulus = $entry['totalvalueexclvat'];
$amountIncAcumulus = $entry['to... | [
"private",
"function",
"getAmountFields",
"(",
"Source",
"$",
"source",
",",
"array",
"$",
"entry",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"entry",
"[",
"'totalvalue'",
"]",
")",
"&&",
"!",
"empty",
... | Returns the amounts of this invoice.
@param \Siel\Acumulus\Invoice\Source $source
@param array $entry
@return array[]
Array with form fields with the payment status and date (if paid) of
the invoice. | [
"Returns",
"the",
"amounts",
"of",
"this",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L881-L909 |
30,444 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getAmountStatus | private function getAmountStatus($amount, $amountLocal)
{
if (Number::floatsAreEqual($amount, $amountLocal)) {
$status = static::Status_Success;
} elseif (Number::floatsAreEqual($amount, $amountLocal, 0.02)) {
$status = static::Status_Info;
} elseif (Number::floatsAre... | php | private function getAmountStatus($amount, $amountLocal)
{
if (Number::floatsAreEqual($amount, $amountLocal)) {
$status = static::Status_Success;
} elseif (Number::floatsAreEqual($amount, $amountLocal, 0.02)) {
$status = static::Status_Info;
} elseif (Number::floatsAre... | [
"private",
"function",
"getAmountStatus",
"(",
"$",
"amount",
",",
"$",
"amountLocal",
")",
"{",
"if",
"(",
"Number",
"::",
"floatsAreEqual",
"(",
"$",
"amount",
",",
"$",
"amountLocal",
")",
")",
"{",
"$",
"status",
"=",
"static",
"::",
"Status_Success",
... | Returns the status of an amount by comparing it with its local value.
If the amounts differ:
- < 0.5 cent, they are considered equal and 'success' will be returned.
- < 2 cents, it is considered a mere rounding error and 'info' will be returned.
- < 5 cents, it is considered a probable error and 'warning' will be retu... | [
"Returns",
"the",
"status",
"of",
"an",
"amount",
"by",
"comparing",
"it",
"with",
"its",
"local",
"value",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L926-L938 |
30,445 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.getLinksField | private function getLinksField($token)
{
$uri = $this->service->getInvoicePdfUri($token);
$text = ucfirst($this->t('invoice'));
$title = sprintf($this->t('open_as_pdf'), $text);
/** @noinspection HtmlUnknownTarget */
$invoiceLink = sprintf('<a class="%4$s" href="%1$s" title="... | php | private function getLinksField($token)
{
$uri = $this->service->getInvoicePdfUri($token);
$text = ucfirst($this->t('invoice'));
$title = sprintf($this->t('open_as_pdf'), $text);
/** @noinspection HtmlUnknownTarget */
$invoiceLink = sprintf('<a class="%4$s" href="%1$s" title="... | [
"private",
"function",
"getLinksField",
"(",
"$",
"token",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"service",
"->",
"getInvoicePdfUri",
"(",
"$",
"token",
")",
";",
"$",
"text",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"t",
"(",
"'invoice'",
")"... | Returns links to the invoice and packing slip documents.
@param string $token
@return array[]
Array with form field that contains links to documents related to this
invoice. | [
"Returns",
"links",
"to",
"the",
"invoice",
"and",
"packing",
"slip",
"documents",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L982-L1004 |
30,446 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.sanitizeEntry | private function sanitizeEntry($entry)
{
if (!empty($entry)) {
/* @todo: keys in $entry array that are not yet used and not yet sanitized:
* - entrytype
* - entrydescription
* - entrynote
* - fiscaltype
* - contactid
... | php | private function sanitizeEntry($entry)
{
if (!empty($entry)) {
/* @todo: keys in $entry array that are not yet used and not yet sanitized:
* - entrytype
* - entrydescription
* - entrynote
* - fiscaltype
* - contactid
... | [
"private",
"function",
"sanitizeEntry",
"(",
"$",
"entry",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"entry",
")",
")",
"{",
"/* @todo: keys in $entry array that are not yet used and not yet sanitized:\n * - entrytype\n * - entrydescription\n ... | Sanitizes an entry struct received via an getEntry API call.
The info received from an external API call must not be trusted, so it
should be sanitized. As most info from this API call is placed in markup
fields we cannot rely on the FormRenderer or the webshop's form API
(which do not sanitize markup fields).
So we ... | [
"Sanitizes",
"an",
"entry",
"struct",
"received",
"via",
"an",
"getEntry",
"API",
"call",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L1079-L1114 |
30,447 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.sanitizeEntryStringValue | private function sanitizeEntryStringValue(array $entry, $key)
{
return !empty($entry[$key]) ? htmlspecialchars($entry[$key], ENT_NOQUOTES) : '';
} | php | private function sanitizeEntryStringValue(array $entry, $key)
{
return !empty($entry[$key]) ? htmlspecialchars($entry[$key], ENT_NOQUOTES) : '';
} | [
"private",
"function",
"sanitizeEntryStringValue",
"(",
"array",
"$",
"entry",
",",
"$",
"key",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"entry",
"[",
"$",
"key",
"]",
")",
"?",
"htmlspecialchars",
"(",
"$",
"entry",
"[",
"$",
"key",
"]",
",",
"EN... | Returns a html safe version of a string in an entry record.
@param array $entry
@param string $key
@return string
The html safe version of the value under this key or the empty string
if not set. | [
"Returns",
"a",
"html",
"safe",
"version",
"of",
"a",
"string",
"in",
"an",
"entry",
"record",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L1126-L1129 |
30,448 | SIELOnline/libAcumulus | src/WooCommerce/Shop/InvoiceStatusOverviewForm.php | InvoiceStatusOverviewForm.sanitizeEntryDateValue | private function sanitizeEntryDateValue(array $entry, $key)
{
$date = '';
if (!empty($entry[$key])) {
$date = DateTime::createFromFormat(API::DateFormat_Iso, $entry[$key]);
if ($date instanceof DateTime) {
$date = $date->format(Api::DateFormat_Iso);
... | php | private function sanitizeEntryDateValue(array $entry, $key)
{
$date = '';
if (!empty($entry[$key])) {
$date = DateTime::createFromFormat(API::DateFormat_Iso, $entry[$key]);
if ($date instanceof DateTime) {
$date = $date->format(Api::DateFormat_Iso);
... | [
"private",
"function",
"sanitizeEntryDateValue",
"(",
"array",
"$",
"entry",
",",
"$",
"key",
")",
"{",
"$",
"date",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"entry",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"date",
"=",
"DateTime",
":... | Returns a sanitized date value of an entry record.
@param array $entry
@param string $key
@return string
The date value (yyyy-mm-dd) of the value under this key or the empty
string, if the string is not in the valid date format (yyyy-mm-dd). | [
"Returns",
"a",
"sanitized",
"date",
"value",
"of",
"an",
"entry",
"record",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Shop/InvoiceStatusOverviewForm.php#L1185-L1197 |
30,449 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.initPossibleVatTypes | protected function initPossibleVatTypes()
{
$possibleVatTypes = array();
$shopSettings = $this->config->getShopSettings();
$nature = $shopSettings['nature_shop'];
$margin = $shopSettings['marginProducts'];
$foreignVat = $shopSettings['foreignVat'];
if (!empty($this->... | php | protected function initPossibleVatTypes()
{
$possibleVatTypes = array();
$shopSettings = $this->config->getShopSettings();
$nature = $shopSettings['nature_shop'];
$margin = $shopSettings['marginProducts'];
$foreignVat = $shopSettings['foreignVat'];
if (!empty($this->... | [
"protected",
"function",
"initPossibleVatTypes",
"(",
")",
"{",
"$",
"possibleVatTypes",
"=",
"array",
"(",
")",
";",
"$",
"shopSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getShopSettings",
"(",
")",
";",
"$",
"nature",
"=",
"$",
"shopSettings",
"[... | Initializes the list of possible vat types for this invoice.
The list of possible vat types depends on:
- Whether the vat type already has been set.
- Whether there is at least 1 line with a costprice.
- The country of the client.
- Whether the client is a company.
- The shop settings (selling foreign vat or vat free ... | [
"Initializes",
"the",
"list",
"of",
"possible",
"vat",
"types",
"for",
"this",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L263-L319 |
30,450 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.initPossibleVatRates | protected function initPossibleVatRates()
{
$possibleVatRates = array();
$shopSettings = $this->config->getShopSettings();
$nature = $shopSettings['nature_shop'];
$vatFreeProducts = $shopSettings['vatFreeProducts'];
foreach ($this->possibleVatTypes as $vatType) {
... | php | protected function initPossibleVatRates()
{
$possibleVatRates = array();
$shopSettings = $this->config->getShopSettings();
$nature = $shopSettings['nature_shop'];
$vatFreeProducts = $shopSettings['vatFreeProducts'];
foreach ($this->possibleVatTypes as $vatType) {
... | [
"protected",
"function",
"initPossibleVatRates",
"(",
")",
"{",
"$",
"possibleVatRates",
"=",
"array",
"(",
")",
";",
"$",
"shopSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getShopSettings",
"(",
")",
";",
"$",
"nature",
"=",
"$",
"shopSettings",
"[... | Initializes the list of possible vat rates.
The possible vat rates depend on:
- the possible vat types.
- optionally, the date of the invoice.
- optionally, the country of the client.
- optionally, the nature of the articles sold.
On finishing, $this->possibleVatRates will contain an array with possible
vat rates. A ... | [
"Initializes",
"the",
"list",
"of",
"possible",
"vat",
"rates",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L335-L377 |
30,451 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.fictitiousClient | protected function fictitiousClient()
{
$customerSettings = $this->config->getCustomerSettings();
if (!$customerSettings['sendCustomer'] && !$this->isCompany()) {
$keysToKeep = array(Tag::CountryCode, Tag::Invoice);
foreach ($this->invoice[Tag::Customer] as $key => $value) {
... | php | protected function fictitiousClient()
{
$customerSettings = $this->config->getCustomerSettings();
if (!$customerSettings['sendCustomer'] && !$this->isCompany()) {
$keysToKeep = array(Tag::CountryCode, Tag::Invoice);
foreach ($this->invoice[Tag::Customer] as $key => $value) {
... | [
"protected",
"function",
"fictitiousClient",
"(",
")",
"{",
"$",
"customerSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getCustomerSettings",
"(",
")",
";",
"if",
"(",
"!",
"$",
"customerSettings",
"[",
"'sendCustomer'",
"]",
"&&",
"!",
"$",
"this",
... | Anonymize customer if set so.
- We don't do this for business clients, only consumers.
- We keep the country code as it is needed to determine the vat type. | [
"Anonymize",
"customer",
"if",
"set",
"so",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L385-L399 |
30,452 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.validateEmail | protected function validateEmail()
{
// Check email address.
if (empty($this->invoice[Tag::Customer][Tag::Email])) {
$customerSettings = $this->config->getCustomerSettings();
$this->invoice[Tag::Customer][Tag::Email] = $customerSettings['emailIfAbsent'];
$this->re... | php | protected function validateEmail()
{
// Check email address.
if (empty($this->invoice[Tag::Customer][Tag::Email])) {
$customerSettings = $this->config->getCustomerSettings();
$this->invoice[Tag::Customer][Tag::Email] = $customerSettings['emailIfAbsent'];
$this->re... | [
"protected",
"function",
"validateEmail",
"(",
")",
"{",
"// Check email address.",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Email",
"]",
")",
")",
"{",
"$",
"customerSettings",
"=",
"$"... | Validates the email address of the invoice.
Validations performed:
- Multiple, comma separated, email addresses are not allowed.
- Display names (My Name <my.name@example.com>) are not allowed.
- The email address may not be empty but may be left out though in which
case a new relation will be created. To prevent both... | [
"Validates",
"the",
"email",
"address",
"of",
"the",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L411-L438 |
30,453 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.invoiceTemplate | protected function invoiceTemplate()
{
$invoiceSettings = $this->config->getInvoiceSettings();
// Acumulus invoice template to use.
$settingToUse = isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::PaymentStatus])
&& $this->invoice[Tag::Customer][Tag::Invoice][T... | php | protected function invoiceTemplate()
{
$invoiceSettings = $this->config->getInvoiceSettings();
// Acumulus invoice template to use.
$settingToUse = isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::PaymentStatus])
&& $this->invoice[Tag::Customer][Tag::Invoice][T... | [
"protected",
"function",
"invoiceTemplate",
"(",
")",
"{",
"$",
"invoiceSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getInvoiceSettings",
"(",
")",
";",
"// Acumulus invoice template to use.",
"$",
"settingToUse",
"=",
"isset",
"(",
"$",
"this",
"->",
"in... | Fills the invoice template to use when sending an invoice from Acumulus.
As getting the payment status right is notoriously hard, we fill this
value only here in the completor phase to give users the chance to change
the payment status in the acumulus invoice created event. | [
"Fills",
"the",
"invoice",
"template",
"to",
"use",
"when",
"sending",
"an",
"invoice",
"from",
"Acumulus",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L447-L459 |
30,454 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.checkMissingAmount | protected function checkMissingAmount()
{
// Check if we are missing an amount and, if so, add a line for it.
$this->completeLineTotals();
$areTotalsEqual = $this->areTotalsEqual();
if ($areTotalsEqual === false) {
$this->addMissingAmountLine();
}
} | php | protected function checkMissingAmount()
{
// Check if we are missing an amount and, if so, add a line for it.
$this->completeLineTotals();
$areTotalsEqual = $this->areTotalsEqual();
if ($areTotalsEqual === false) {
$this->addMissingAmountLine();
}
} | [
"protected",
"function",
"checkMissingAmount",
"(",
")",
"{",
"// Check if we are missing an amount and, if so, add a line for it.",
"$",
"this",
"->",
"completeLineTotals",
"(",
")",
";",
"$",
"areTotalsEqual",
"=",
"$",
"this",
"->",
"areTotalsEqual",
"(",
")",
";",
... | Checks for a missing amount and handles it. | [
"Checks",
"for",
"a",
"missing",
"amount",
"and",
"handles",
"it",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L486-L494 |
30,455 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.completeLineTotals | protected function completeLineTotals()
{
$linesAmount = 0.0;
$linesAmountInc = 0.0;
$linesVatAmount = 0.0;
$this->lineTotalsStates = array(
'incomplete' => array(),
'equal' => array(),
'differ' => array(),
);
$invoiceLines = $this... | php | protected function completeLineTotals()
{
$linesAmount = 0.0;
$linesAmountInc = 0.0;
$linesVatAmount = 0.0;
$this->lineTotalsStates = array(
'incomplete' => array(),
'equal' => array(),
'differ' => array(),
);
$invoiceLines = $this... | [
"protected",
"function",
"completeLineTotals",
"(",
")",
"{",
"$",
"linesAmount",
"=",
"0.0",
";",
"$",
"linesAmountInc",
"=",
"0.0",
";",
"$",
"linesVatAmount",
"=",
"0.0",
";",
"$",
"this",
"->",
"lineTotalsStates",
"=",
"array",
"(",
"'incomplete'",
"=>",... | Calculates the total amount and vat amount for the invoice lines and adds
these to the fields meta-lines-amount and meta-lines-vatamount. | [
"Calculates",
"the",
"total",
"amount",
"and",
"vat",
"amount",
"for",
"the",
"invoice",
"lines",
"and",
"adds",
"these",
"to",
"the",
"fields",
"meta",
"-",
"lines",
"-",
"amount",
"and",
"meta",
"-",
"lines",
"-",
"vatamount",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L500-L545 |
30,456 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.areTotalsEqual | protected function areTotalsEqual()
{
$invoice = $this->invoice[Tag::Customer][Tag::Invoice];
if (!in_array(Meta::LinesAmount, $this->lineTotalsStates['incomplete'])) {
if (Number::floatsAreEqual($invoice[Meta::InvoiceAmount], $invoice[Meta::LinesAmount], 0.05)) {
$this->... | php | protected function areTotalsEqual()
{
$invoice = $this->invoice[Tag::Customer][Tag::Invoice];
if (!in_array(Meta::LinesAmount, $this->lineTotalsStates['incomplete'])) {
if (Number::floatsAreEqual($invoice[Meta::InvoiceAmount], $invoice[Meta::LinesAmount], 0.05)) {
$this->... | [
"protected",
"function",
"areTotalsEqual",
"(",
")",
"{",
"$",
"invoice",
"=",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
";",
"if",
"(",
"!",
"in_array",
"(",
"Meta",
"::",
"LinesAmount",
",",
... | Compares the invoice totals metadata with the line totals metadata.
If any of the 3 values are equal we do consider the totals to be equal
(except for a 0 VAT amount (for reversed VAT invoices)). This because in
many cases 1 or 2 of the 3 values are either incomplete or incorrect.
@return bool|null
True if the totals... | [
"Compares",
"the",
"invoice",
"totals",
"metadata",
"with",
"the",
"line",
"totals",
"metadata",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L558-L600 |
30,457 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.completeVatType | protected function completeVatType()
{
// If shop specific code or an event handler has already set the vat
// type, we don't change it.
if (empty($this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType])) {
// @todo: if we only have one possible vattype, should we use that, or
... | php | protected function completeVatType()
{
// If shop specific code or an event handler has already set the vat
// type, we don't change it.
if (empty($this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType])) {
// @todo: if we only have one possible vattype, should we use that, or
... | [
"protected",
"function",
"completeVatType",
"(",
")",
"{",
"// If shop specific code or an event handler has already set the vat",
"// type, we don't change it.",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",... | Determines the vattype of the invoice.
This method (and class) is aware of:
- The setting foreignVat.
- The country of the client.
- Whether the client is a company.
- The actual VAT rates on the day of the order.
- Whether there are margin products in the order.
So to start with, any list of (possible) vat types is ... | [
"Determines",
"the",
"vattype",
"of",
"the",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L724-L832 |
30,458 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.correctMarginInvoice | protected function correctMarginInvoice()
{
if (isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType]) && $this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType] === Api::VatType_MarginScheme) {
foreach ($this->invoice[Tag::Customer][Tag::Invoice][Tag::Line] as &$line) {
... | php | protected function correctMarginInvoice()
{
if (isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType]) && $this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType] === Api::VatType_MarginScheme) {
foreach ($this->invoice[Tag::Customer][Tag::Invoice][Tag::Line] as &$line) {
... | [
"protected",
"function",
"correctMarginInvoice",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
"[",
"Tag",
"::",
"VatType",
"]",
")",
"&&",
"$",
"this",
"->"... | Corrects an invoice if it is a margin scheme invoice.
If an invoice is of the margin scheme type, all lines have to follow the
margin scheme rules. These rules are:
- Each line must have a costprice, but that cost price may be 0.
- The unitprice should now contain the price including VAT (requirement
of the web servic... | [
"Corrects",
"an",
"invoice",
"if",
"it",
"is",
"a",
"margin",
"scheme",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L957-L987 |
30,459 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.correct0VatToVatFree | protected function correct0VatToVatFree()
{
if (isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType])) {
$vatType = $this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType];
if (in_array($vatType, static::$vatTypesAllowingVatFree)) {
foreach ($this->invoic... | php | protected function correct0VatToVatFree()
{
if (isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType])) {
$vatType = $this->invoice[Tag::Customer][Tag::Invoice][Tag::VatType];
if (in_array($vatType, static::$vatTypesAllowingVatFree)) {
foreach ($this->invoic... | [
"protected",
"function",
"correct0VatToVatFree",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
"[",
"Tag",
"::",
"VatType",
"]",
")",
")",
"{",
"$",
"vatType... | Change 0% vat rates to vat free.
Acumulus distinguishes between 0% vat (vatrate = 0) and vat free
(vatrate = -1).
0% vat should be used with:
- Reversed vat invoices, EU or national (vat type = 2 or 3).
- Products invoiced outside the EU (vat type = 4).
Vat free should be used for:
- Vat free products and services, e.... | [
"Change",
"0%",
"vat",
"rates",
"to",
"vat",
"free",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1013-L1025 |
30,460 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.processMetaData | protected function processMetaData()
{
foreach ($this->invoice[Tag::Customer][Tag::Invoice][Tag::Line] as &$line) {
if (isset($line[Meta::VatRateLookup]) && is_array($line[Meta::VatRateLookup])) {
$line[Meta::VatRateLookup] = json_encode($line[Meta::VatRateLookup]);
}... | php | protected function processMetaData()
{
foreach ($this->invoice[Tag::Customer][Tag::Invoice][Tag::Line] as &$line) {
if (isset($line[Meta::VatRateLookup]) && is_array($line[Meta::VatRateLookup])) {
$line[Meta::VatRateLookup] = json_encode($line[Meta::VatRateLookup]);
}... | [
"protected",
"function",
"processMetaData",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
"[",
"Tag",
"::",
"Line",
"]",
"as",
"&",
"$",
"line",
")",
"{",
"if",
"("... | Processes meta data before sending the invoice.
Currently the following processing is done:
- Meta::VatRateLookup, Meta::VatRateLookupLabel, Meta::FieldsCalculated,
Meta::VatRateLookupMatches, and Meta::VatRateRangeMatches are converted
a json string if they are an array. | [
"Processes",
"meta",
"data",
"before",
"sending",
"the",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1049-L1068 |
30,461 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.lineHas0VatRate | protected function lineHas0VatRate(array $line)
{
$result = false;
if ($this->is0VatRate($line)) {
$result = true;
}
return $result;
} | php | protected function lineHas0VatRate(array $line)
{
$result = false;
if ($this->is0VatRate($line)) {
$result = true;
}
return $result;
} | [
"protected",
"function",
"lineHas0VatRate",
"(",
"array",
"$",
"line",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"is0VatRate",
"(",
"$",
"line",
")",
")",
"{",
"$",
"result",
"=",
"true",
";",
"}",
"return",
"$",
"re... | Returns whether the given line has a 0% or vat free vat rate.
@param array $line
The invoice line.
@return bool
True if the given line has a 0% or vat free vat rate, false otherwise. | [
"Returns",
"whether",
"the",
"given",
"line",
"has",
"a",
"0%",
"or",
"vat",
"free",
"vat",
"rate",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1079-L1086 |
30,462 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.is0VatRate | protected function is0VatRate($vatRate)
{
if (is_array($vatRate) && isset($vatRate)) {
$vatRate = isset($vatRate[Tag::VatRate]) ? $vatRate[Tag::VatRate] : null;
}
return isset($vatRate) && (Number::isZero($vatRate) || Number::floatsAreEqual($vatRate, -1.0));
} | php | protected function is0VatRate($vatRate)
{
if (is_array($vatRate) && isset($vatRate)) {
$vatRate = isset($vatRate[Tag::VatRate]) ? $vatRate[Tag::VatRate] : null;
}
return isset($vatRate) && (Number::isZero($vatRate) || Number::floatsAreEqual($vatRate, -1.0));
} | [
"protected",
"function",
"is0VatRate",
"(",
"$",
"vatRate",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"vatRate",
")",
"&&",
"isset",
"(",
"$",
"vatRate",
")",
")",
"{",
"$",
"vatRate",
"=",
"isset",
"(",
"$",
"vatRate",
"[",
"Tag",
"::",
"VatRate",
... | Returns whether the vat rate is a 0 vat rate.
@param int|array $vatRate
An integer (or numeric string), an array possibly containing an entry
with key Tag::VatRate entry
@return bool
True if the vat rate is a 0 vat rate, false otherwise. | [
"Returns",
"whether",
"the",
"vat",
"rate",
"is",
"a",
"0",
"vat",
"rate",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1117-L1123 |
30,463 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.getVatRatesByCountryAndDate | protected function getVatRatesByCountryAndDate($countryCode, $date = null)
{
if (empty($date)) {
$date = $this->getInvoiceDate();
}
$result = $this->service->getVatInfo($countryCode, $date);
if ($result->hasMessages()) {
$this->result->mergeMessages($result);
... | php | protected function getVatRatesByCountryAndDate($countryCode, $date = null)
{
if (empty($date)) {
$date = $this->getInvoiceDate();
}
$result = $this->service->getVatInfo($countryCode, $date);
if ($result->hasMessages()) {
$this->result->mergeMessages($result);
... | [
"protected",
"function",
"getVatRatesByCountryAndDate",
"(",
"$",
"countryCode",
",",
"$",
"date",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"$",
"date",
"=",
"$",
"this",
"->",
"getInvoiceDate",
"(",
")",
";",
"}",
... | Helper method to get the vat rates for the current invoice.
- This method contacts the Acumulus server.
- The vat rates returned reflect those as they were at the invoice date.
- No zero vat rates are returned.
@param string $countryCode
The country to fetch the vat rates for.
@param string|null $date
The date (yyyy-... | [
"Helper",
"method",
"to",
"get",
"the",
"vat",
"rates",
"for",
"the",
"current",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1142-L1157 |
30,464 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.getInvoiceDate | protected function getInvoiceDate()
{
$date = !empty($this->invoice[Tag::Customer][Tag::Invoice][Tag::IssueDate]) ? $this->invoice[Tag::Customer][Tag::Invoice][Tag::IssueDate] : date(API::DateFormat_Iso);
return $date;
} | php | protected function getInvoiceDate()
{
$date = !empty($this->invoice[Tag::Customer][Tag::Invoice][Tag::IssueDate]) ? $this->invoice[Tag::Customer][Tag::Invoice][Tag::IssueDate] : date(API::DateFormat_Iso);
return $date;
} | [
"protected",
"function",
"getInvoiceDate",
"(",
")",
"{",
"$",
"date",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
"[",
"Tag",
"::",
"IssueDate",
"]",
")",
"?",
"$",
"th... | Returns the invoice date in the iso yyyy-mm-dd format.
@return string
The invoice dae in the iso yyyy-mm-dd format. | [
"Returns",
"the",
"invoice",
"date",
"in",
"the",
"iso",
"yyyy",
"-",
"mm",
"-",
"dd",
"format",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1165-L1169 |
30,465 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.isCompany | protected function isCompany()
{
// Note: companies outside EU must also fill in their vat number!? Even
// if there's no way to check it with a webservice like VIES.
return !empty($this->invoice[Tag::Customer][Tag::CompanyName1]) && !empty($this->invoice[Tag::Customer][Tag::VatNumber]);
... | php | protected function isCompany()
{
// Note: companies outside EU must also fill in their vat number!? Even
// if there's no way to check it with a webservice like VIES.
return !empty($this->invoice[Tag::Customer][Tag::CompanyName1]) && !empty($this->invoice[Tag::Customer][Tag::VatNumber]);
... | [
"protected",
"function",
"isCompany",
"(",
")",
"{",
"// Note: companies outside EU must also fill in their vat number!? Even",
"// if there's no way to check it with a webservice like VIES.",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Custome... | Returns whether the client is a company with a vat number.
@return bool | [
"Returns",
"whether",
"the",
"client",
"is",
"a",
"company",
"with",
"a",
"vat",
"number",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1206-L1211 |
30,466 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.shouldConvertCurrency | public function shouldConvertCurrency(array &$invoice)
{
$invoicePart = &$invoice[Tag::Customer][Tag::Invoice];
$shouldConvert = isset($invoicePart[Meta::Currency]) && isset($invoicePart[Meta::CurrencyRate]) && isset($invoicePart[Meta::CurrencyDoConvert]);
$shouldConvert = $shouldConvert && ... | php | public function shouldConvertCurrency(array &$invoice)
{
$invoicePart = &$invoice[Tag::Customer][Tag::Invoice];
$shouldConvert = isset($invoicePart[Meta::Currency]) && isset($invoicePart[Meta::CurrencyRate]) && isset($invoicePart[Meta::CurrencyDoConvert]);
$shouldConvert = $shouldConvert && ... | [
"public",
"function",
"shouldConvertCurrency",
"(",
"array",
"&",
"$",
"invoice",
")",
"{",
"$",
"invoicePart",
"=",
"&",
"$",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
";",
"$",
"shouldConvert",
"=",
"isset",
"(",
... | Returns whether the amounts in the invoice are in another currency.
The amounts in te invoice are to be converted if:
- All currency meta tags are set.
- The "currency rate" does not equal 1.0, otherwise converting would
result in the same amounts.
- The meta tag "do convert" equals "currency !== 'EUR'.
@param array ... | [
"Returns",
"whether",
"the",
"amounts",
"in",
"the",
"invoice",
"are",
"in",
"another",
"currency",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1228-L1254 |
30,467 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.convertAmount | public function convertAmount(array &$array, $key, $conversionRate)
{
if (!empty($array[$key]) && !empty($conversionRate)) {
$array[$key] = (float) $array[$key] / (float) $conversionRate;
return true;
}
return false;
} | php | public function convertAmount(array &$array, $key, $conversionRate)
{
if (!empty($array[$key]) && !empty($conversionRate)) {
$array[$key] = (float) $array[$key] / (float) $conversionRate;
return true;
}
return false;
} | [
"public",
"function",
"convertAmount",
"(",
"array",
"&",
"$",
"array",
",",
"$",
"key",
",",
"$",
"conversionRate",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"array",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"conversionRate",
")... | Helper method to convert an amount field to euros.
@param array $array
@param string $key
@param float $conversionRate
@return bool
Whether the amount was converted. | [
"Helper",
"method",
"to",
"convert",
"an",
"amount",
"field",
"to",
"euros",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1266-L1273 |
30,468 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.isForeignVatClass | public function isForeignVatClass($vatClassId)
{
$shopSettings = $this->config->getShopSettings();
$foreignVat = $shopSettings['foreignVat'];
$foreignVatClasses = $shopSettings['foreignVatClasses'];
return $foreignVat !== PluginConfig::ForeignVat_No && in_array($vatClassId, $foreignV... | php | public function isForeignVatClass($vatClassId)
{
$shopSettings = $this->config->getShopSettings();
$foreignVat = $shopSettings['foreignVat'];
$foreignVatClasses = $shopSettings['foreignVatClasses'];
return $foreignVat !== PluginConfig::ForeignVat_No && in_array($vatClassId, $foreignV... | [
"public",
"function",
"isForeignVatClass",
"(",
"$",
"vatClassId",
")",
"{",
"$",
"shopSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getShopSettings",
"(",
")",
";",
"$",
"foreignVat",
"=",
"$",
"shopSettings",
"[",
"'foreignVat'",
"]",
";",
"$",
"fo... | Returns whether the vat class id denotes foreign vat.
@param int|string $vatClassId
The vat class to check.
@return bool
True if the shop might sell foreign vat articles and the vat class id
denotes a foreign vat class, false otherwise. | [
"Returns",
"whether",
"the",
"vat",
"class",
"id",
"denotes",
"foreign",
"vat",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1301-L1307 |
30,469 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.changeInvoiceToConcept | public function changeInvoiceToConcept($messageKey, $code)
{
$pdfMessage = '';
$invoiceSettings = $this->config->getInvoiceSettings();
$concept = $invoiceSettings['concept'];
if ($concept == PluginConfig::Concept_Plugin) {
$this->invoice[Tag::Customer][Tag::Invoice][Tag::... | php | public function changeInvoiceToConcept($messageKey, $code)
{
$pdfMessage = '';
$invoiceSettings = $this->config->getInvoiceSettings();
$concept = $invoiceSettings['concept'];
if ($concept == PluginConfig::Concept_Plugin) {
$this->invoice[Tag::Customer][Tag::Invoice][Tag::... | [
"public",
"function",
"changeInvoiceToConcept",
"(",
"$",
"messageKey",
",",
"$",
"code",
")",
"{",
"$",
"pdfMessage",
"=",
"''",
";",
"$",
"invoiceSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getInvoiceSettings",
"(",
")",
";",
"$",
"concept",
"=",... | Makes the invoice a concept invoice and optionally adds a warning.
@param string $messageKey
The key of the message to add as warning, or the empty string if no
warning has to be added.
@param int $code
The code for this message.
@param string ...
Additional arguments to format the message. | [
"Makes",
"the",
"invoice",
"a",
"concept",
"invoice",
"and",
"optionally",
"adds",
"a",
"warning",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1320-L1341 |
30,470 | SIELOnline/libAcumulus | src/Invoice/Completor.php | Completor.addDefault | protected function addDefault(array &$array, $key, $value)
{
if (empty($array[$key]) && !empty($value)) {
$array[$key] = $value;
return true;
}
return false;
} | php | protected function addDefault(array &$array, $key, $value)
{
if (empty($array[$key]) && !empty($value)) {
$array[$key] = $value;
return true;
}
return false;
} | [
"protected",
"function",
"addDefault",
"(",
"array",
"&",
"$",
"array",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"array",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
... | Helper method to add a default non-empty value to an array.
This method will not overwrite existing values.
@param array $array
@param string $key
@param mixed $value
@return bool
Whether the default was added. | [
"Helper",
"method",
"to",
"add",
"a",
"default",
"non",
"-",
"empty",
"value",
"to",
"an",
"array",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Completor.php#L1355-L1362 |
30,471 | SIELOnline/libAcumulus | src/Web/Service.php | Service.getVatInfo | public function getVatInfo($countryCode, $date = '')
{
if (empty($date)) {
$date = date(API::DateFormat_Iso);
}
$message = array(
'vatdate' => $date,
'vatcountry' => $countryCode,
);
return $this->communicator->callApiFunction('lookups/look... | php | public function getVatInfo($countryCode, $date = '')
{
if (empty($date)) {
$date = date(API::DateFormat_Iso);
}
$message = array(
'vatdate' => $date,
'vatcountry' => $countryCode,
);
return $this->communicator->callApiFunction('lookups/look... | [
"public",
"function",
"getVatInfo",
"(",
"$",
"countryCode",
",",
"$",
"date",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"$",
"date",
"=",
"date",
"(",
"API",
"::",
"DateFormat_Iso",
")",
";",
"}",
"$",
"message",
... | Retrieves a list of VAT rates for the given country at the given date.
@param string $countryCode
Country code of the country to retrieve the VAT info for.
@param string $date
ISO date string (yyyy-mm-dd) for the date to retrieve the VAT info for.
@return \Siel\Acumulus\Web\Result
The result of the webservice call. T... | [
"Retrieves",
"a",
"list",
"of",
"VAT",
"rates",
"for",
"the",
"given",
"country",
"at",
"the",
"given",
"date",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L241-L251 |
30,472 | SIELOnline/libAcumulus | src/Web/Service.php | Service.invoiceAdd | public function invoiceAdd(array $invoice, Result $result = null)
{
return $this->communicator->callApiFunction('invoices/invoice_add', $invoice, $result)->setMainResponseKey('invoice');
} | php | public function invoiceAdd(array $invoice, Result $result = null)
{
return $this->communicator->callApiFunction('invoices/invoice_add', $invoice, $result)->setMainResponseKey('invoice');
} | [
"public",
"function",
"invoiceAdd",
"(",
"array",
"$",
"invoice",
",",
"Result",
"$",
"result",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"communicator",
"->",
"callApiFunction",
"(",
"'invoices/invoice_add'",
",",
"$",
"invoice",
",",
"$",
"result... | Sends an invoice to Acumulus.
@param array $invoice
The invoice to send.
@param \Siel\Acumulus\Web\Result|null $result
It is possible to already create a Result object before calling the Web
Service to store local messages. By passing this Result object these
local messages will be merged with any remote messages in t... | [
"Sends",
"an",
"invoice",
"to",
"Acumulus",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L275-L278 |
30,473 | SIELOnline/libAcumulus | src/Web/Service.php | Service.setDeleteStatus | public function setDeleteStatus($entryId, $deleteStatus)
{
$message = array(
'entryid' => (int) $entryId,
'entrydeletestatus' => (int) $deleteStatus,
);
// @todo: clean up on receiving P2XFELO12?
return $this->communicator->callApiFunction('entry/entry_deletes... | php | public function setDeleteStatus($entryId, $deleteStatus)
{
$message = array(
'entryid' => (int) $entryId,
'entrydeletestatus' => (int) $deleteStatus,
);
// @todo: clean up on receiving P2XFELO12?
return $this->communicator->callApiFunction('entry/entry_deletes... | [
"public",
"function",
"setDeleteStatus",
"(",
"$",
"entryId",
",",
"$",
"deleteStatus",
")",
"{",
"$",
"message",
"=",
"array",
"(",
"'entryid'",
"=>",
"(",
"int",
")",
"$",
"entryId",
",",
"'entrydeletestatus'",
"=>",
"(",
"int",
")",
"$",
"deleteStatus",... | Moves the entry into or out of the trashbin.
@param int $entryId
The id of the entry.
@param int $deleteStatus
The delete action to perform: one of the API::Entry_Delete or
API::Entry_UnDelete constants. API::Entry_UnDelete does not work for
now.
@return \Siel\Acumulus\Web\Result
The result of the webservice call. Th... | [
"Moves",
"the",
"entry",
"into",
"or",
"out",
"of",
"the",
"trashbin",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L353-L361 |
30,474 | SIELOnline/libAcumulus | src/Web/Service.php | Service.getPaymentStatus | public function getPaymentStatus($token)
{
$message = array(
'token' => (string) $token,
);
return $this->communicator->callApiFunction('invoices/invoice_paymentstatus_get', $message)->setMainResponseKey('invoice');
} | php | public function getPaymentStatus($token)
{
$message = array(
'token' => (string) $token,
);
return $this->communicator->callApiFunction('invoices/invoice_paymentstatus_get', $message)->setMainResponseKey('invoice');
} | [
"public",
"function",
"getPaymentStatus",
"(",
"$",
"token",
")",
"{",
"$",
"message",
"=",
"array",
"(",
"'token'",
"=>",
"(",
"string",
")",
"$",
"token",
",",
")",
";",
"return",
"$",
"this",
"->",
"communicator",
"->",
"callApiFunction",
"(",
"'invoi... | Retrieves the payment status for an invoice.
@param string $token
The token for the invoice.
@return \Siel\Acumulus\Web\Result
The result of the webservice call. The structured response will contain
1 "invoice" array, being a keyed array with keys:
- entryid
- token
- paymentstatus
- paymentdate
Possible errors:
- "X... | [
"Retrieves",
"the",
"payment",
"status",
"for",
"an",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L382-L388 |
30,475 | SIELOnline/libAcumulus | src/Web/Service.php | Service.setPaymentStatus | public function setPaymentStatus($token, $paymentStatus, $paymentDate = '')
{
if (empty($paymentDate)) {
$paymentDate = date(API::DateFormat_Iso);
}
$message = array(
'token' => (string) $token,
'paymentstatus' => (int) $paymentStatus,
'payment... | php | public function setPaymentStatus($token, $paymentStatus, $paymentDate = '')
{
if (empty($paymentDate)) {
$paymentDate = date(API::DateFormat_Iso);
}
$message = array(
'token' => (string) $token,
'paymentstatus' => (int) $paymentStatus,
'payment... | [
"public",
"function",
"setPaymentStatus",
"(",
"$",
"token",
",",
"$",
"paymentStatus",
",",
"$",
"paymentDate",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"paymentDate",
")",
")",
"{",
"$",
"paymentDate",
"=",
"date",
"(",
"API",
"::",
"DateFo... | Sets the payment status for an invoice.
@param string $token
The token for the invoice.
@param int $paymentStatus
The new payment status, 1 of the API::PaymentStatus_Paid or
API::PaymentStatus_Due constants.
@param string $paymentDate
ISO date string (yyyy-mm-dd) for the date to set as payment date, may
be empty for t... | [
"Sets",
"the",
"payment",
"status",
"for",
"an",
"invoice",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L417-L428 |
30,476 | SIELOnline/libAcumulus | src/Web/Service.php | Service.emailInvoiceAsPdf | public function emailInvoiceAsPdf($token, $invoiceType, array $emailAsPdf, $invoiceNotes = '')
{
$message = array(
'token' => (string) $token,
'invoicetype' => (int) $invoiceType,
'emailaspdf' => $emailAsPdf,
);
if (!empty($invoiceNotes)) {
$me... | php | public function emailInvoiceAsPdf($token, $invoiceType, array $emailAsPdf, $invoiceNotes = '')
{
$message = array(
'token' => (string) $token,
'invoicetype' => (int) $invoiceType,
'emailaspdf' => $emailAsPdf,
);
if (!empty($invoiceNotes)) {
$me... | [
"public",
"function",
"emailInvoiceAsPdf",
"(",
"$",
"token",
",",
"$",
"invoiceType",
",",
"array",
"$",
"emailAsPdf",
",",
"$",
"invoiceNotes",
"=",
"''",
")",
"{",
"$",
"message",
"=",
"array",
"(",
"'token'",
"=>",
"(",
"string",
")",
"$",
"token",
... | Sends out an invoice or reminder as PDF.
@param string $token
The token for the invoice.
@param int $invoiceType
One of the constants API::Email_Normal or API::Email_Reminder.
@param array $emailAsPdf
An array with the fields:
- emailto
- emailbcc
- emailfrom
- subject
- message
- confirmreading
@param string $invoice... | [
"Sends",
"out",
"an",
"invoice",
"or",
"reminder",
"as",
"PDF",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L464-L475 |
30,477 | SIELOnline/libAcumulus | src/Web/Service.php | Service.getInvoicePdfUri | public function getInvoicePdfUri($token, $applyGraphics = true)
{
$uri = $this->communicator->getUri('invoices/invoice_get_pdf');
$uri .= "?token=$token";
if (!$applyGraphics) {
$uri .= '&gfx=0';
}
return $uri;
} | php | public function getInvoicePdfUri($token, $applyGraphics = true)
{
$uri = $this->communicator->getUri('invoices/invoice_get_pdf');
$uri .= "?token=$token";
if (!$applyGraphics) {
$uri .= '&gfx=0';
}
return $uri;
} | [
"public",
"function",
"getInvoicePdfUri",
"(",
"$",
"token",
",",
"$",
"applyGraphics",
"=",
"true",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"communicator",
"->",
"getUri",
"(",
"'invoices/invoice_get_pdf'",
")",
";",
"$",
"uri",
".=",
"\"?token=$token... | Returns the uri to download the invoice PDF.
@param string $token
The token for the invoice.
@param bool $applyGraphics
False to prevent any embedded graphics from being applied to the
document, true otherwise.
@return string
The uri to download the invoice PDF.
Possible errors (in download, not in return value):
- "... | [
"Returns",
"the",
"uri",
"to",
"download",
"the",
"invoice",
"PDF",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Service.php#L494-L502 |
30,478 | SIELOnline/libAcumulus | src/OpenCart/Invoice/Creator.php | Creator.getItemLine | protected function getItemLine(array $item)
{
$result = array();
// $product can be empty if the product has been deleted.
$product = $this->getRegistry()->model_catalog_product->getProduct($item['product_id']);
if (!empty($product)) {
$this->addPropertySource('product',... | php | protected function getItemLine(array $item)
{
$result = array();
// $product can be empty if the product has been deleted.
$product = $this->getRegistry()->model_catalog_product->getProduct($item['product_id']);
if (!empty($product)) {
$this->addPropertySource('product',... | [
"protected",
"function",
"getItemLine",
"(",
"array",
"$",
"item",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// $product can be empty if the product has been deleted.",
"$",
"product",
"=",
"$",
"this",
"->",
"getRegistry",
"(",
")",
"->",
"model_ca... | Returns the item line for 1 product line.
This method may return child lines if there are options/variants.
These lines will be informative, their price will be 0.
@param array $item
@return array
@throws \Exception | [
"Returns",
"the",
"item",
"line",
"for",
"1",
"product",
"line",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/OpenCart/Invoice/Creator.php#L101-L157 |
30,479 | SIELOnline/libAcumulus | src/OpenCart/Invoice/Creator.php | Creator.getVatRateLookupMetadata | protected function getVatRateLookupMetadata($taxClassId)
{
$result = array();
$taxClass = $this->getTaxClass($taxClassId);
if ($taxClass) {
$result += array(
Meta::VatClassId => $taxClass['tax_class_id'],
Meta::VatClassName => $taxClass['title'],
... | php | protected function getVatRateLookupMetadata($taxClassId)
{
$result = array();
$taxClass = $this->getTaxClass($taxClassId);
if ($taxClass) {
$result += array(
Meta::VatClassId => $taxClass['tax_class_id'],
Meta::VatClassName => $taxClass['title'],
... | [
"protected",
"function",
"getVatRateLookupMetadata",
"(",
"$",
"taxClassId",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"taxClass",
"=",
"$",
"this",
"->",
"getTaxClass",
"(",
"$",
"taxClassId",
")",
";",
"if",
"(",
"$",
"taxClass",
")",
... | Looks up and returns vat class and vat rate metadata.
@param int $taxClassId
The tax class to look up.
@return array
An empty array or an array with keys:
- Meta::VatClassId: int
- Meta::VatClassName: string
- Meta::VatRateLookup: float[]
- Meta::VatRateLookupLabel: string[]
@throws \Exception | [
"Looks",
"up",
"and",
"returns",
"vat",
"class",
"and",
"vat",
"rate",
"metadata",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/OpenCart/Invoice/Creator.php#L174-L199 |
30,480 | SIELOnline/libAcumulus | src/OpenCart/Invoice/Creator.php | Creator.getTotalLine | protected function getTotalLine(array $line, $exVat)
{
$result = array(
Tag::Product => $line['title'],
Tag::Quantity => 1,
);
if ($exVat) {
$result[Tag::UnitPrice] = $line['value'];
} else {
$result[Meta::UnitPriceInc] = $line['value']... | php | protected function getTotalLine(array $line, $exVat)
{
$result = array(
Tag::Product => $line['title'],
Tag::Quantity => 1,
);
if ($exVat) {
$result[Tag::UnitPrice] = $line['value'];
} else {
$result[Meta::UnitPriceInc] = $line['value']... | [
"protected",
"function",
"getTotalLine",
"(",
"array",
"$",
"line",
",",
"$",
"exVat",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"Tag",
"::",
"Product",
"=>",
"$",
"line",
"[",
"'title'",
"]",
",",
"Tag",
"::",
"Quantity",
"=>",
"1",
",",
")",
";... | Returns a line based on a "order total line".
@param array $line
The total line.
@param bool $exVat
Whether the value in this line is ex (true) or inc (false) vat.
@return array
An Acumulus invoice line.
@throws \Exception | [
"Returns",
"a",
"line",
"based",
"on",
"a",
"order",
"total",
"line",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/OpenCart/Invoice/Creator.php#L276-L315 |
30,481 | SIELOnline/libAcumulus | src/OpenCart/Invoice/Creator.php | Creator.getVatRateLookupByTotalLineType | protected function getVatRateLookupByTotalLineType($code)
{
$result = array();
$query = $this->getTotalLineTaxClassLookupQuery($code);
$queryResult = $this->getRegistry()->db->query($query);
if (!empty($queryResult->row)) {
$taxClassId = reset($queryResult->row);
... | php | protected function getVatRateLookupByTotalLineType($code)
{
$result = array();
$query = $this->getTotalLineTaxClassLookupQuery($code);
$queryResult = $this->getRegistry()->db->query($query);
if (!empty($queryResult->row)) {
$taxClassId = reset($queryResult->row);
... | [
"protected",
"function",
"getVatRateLookupByTotalLineType",
"(",
"$",
"code",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"getTotalLineTaxClassLookupQuery",
"(",
"$",
"code",
")",
";",
"$",
"queryResult",
"=",
... | Tries to lookup and return vat rate meta data for the given line type.
This is quite hard. The total line (table order_total) contains a code
(= line type) and title field, the latter being a translated and possibly
formatted descriptive string of the shipping or handling method applied,
e.g. Europa (Weight: 3.00kg).... | [
"Tries",
"to",
"lookup",
"and",
"return",
"vat",
"rate",
"meta",
"data",
"for",
"the",
"given",
"line",
"type",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/OpenCart/Invoice/Creator.php#L338-L348 |
30,482 | SIELOnline/libAcumulus | src/OpenCart/Invoice/Creator.php | Creator.isAddressInGeoZone | protected function isAddressInGeoZone(array $order, $addressType, $geoZoneId)
{
$fallbackAddressType = $addressType === 'payment' ? 'shipping' : 'payment';
if (!empty($order["{$addressType}_country_id"])) {
$countryId = $order["{$addressType}_country_id"];
$zoneId = !empty($o... | php | protected function isAddressInGeoZone(array $order, $addressType, $geoZoneId)
{
$fallbackAddressType = $addressType === 'payment' ? 'shipping' : 'payment';
if (!empty($order["{$addressType}_country_id"])) {
$countryId = $order["{$addressType}_country_id"];
$zoneId = !empty($o... | [
"protected",
"function",
"isAddressInGeoZone",
"(",
"array",
"$",
"order",
",",
"$",
"addressType",
",",
"$",
"geoZoneId",
")",
"{",
"$",
"fallbackAddressType",
"=",
"$",
"addressType",
"===",
"'payment'",
"?",
"'shipping'",
":",
"'payment'",
";",
"if",
"(",
... | Returns whether the address of the order lies within the geo zone.
@param array $order
The order.
@param string $addressType
'payment' or 'shipping'.
@param int $geoZoneId
The id of the geo zone.
@return bool
True if the address of the order lies within the geo zone, false
otherwise.
@throws \Exception | [
"Returns",
"whether",
"the",
"address",
"of",
"the",
"order",
"lies",
"within",
"the",
"geo",
"zone",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/OpenCart/Invoice/Creator.php#L366-L392 |
30,483 | SIELOnline/libAcumulus | src/MyWebShop/Helpers/Log.php | Log.getMyWebShopSeverity | protected function getMyWebShopSeverity($severity)
{
switch ($severity) {
case Log::Error:
return AbstractLogger::ERROR;
case Log::Warning:
return AbstractLogger::WARNING;
case Log::Notice:
case Log::Info:
return... | php | protected function getMyWebShopSeverity($severity)
{
switch ($severity) {
case Log::Error:
return AbstractLogger::ERROR;
case Log::Warning:
return AbstractLogger::WARNING;
case Log::Notice:
case Log::Info:
return... | [
"protected",
"function",
"getMyWebShopSeverity",
"(",
"$",
"severity",
")",
"{",
"switch",
"(",
"$",
"severity",
")",
"{",
"case",
"Log",
"::",
"Error",
":",
"return",
"AbstractLogger",
"::",
"ERROR",
";",
"case",
"Log",
"::",
"Warning",
":",
"return",
"Ab... | Returns the MyWebShop equivalent of the severity.
@param int $severity
One of the constants of the base Log class.
@return int
The MyWebShop equivalent of the severity. | [
"Returns",
"the",
"MyWebShop",
"equivalent",
"of",
"the",
"severity",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/MyWebShop/Helpers/Log.php#L38-L52 |
30,484 | SIELOnline/libAcumulus | src/MyWebShop/Helpers/Log.php | Log.getLogger | protected function getLogger()
{
if ($this->logger === null) {
// @todo: Instantiate a webshop specific log object that logs to a separate Acumulus log file.
$this->logger = new FileLogger(AbstractLogger::DEBUG);
$this->logger->setFilename(_ROOT_DIR_ . '/'. $logDirectory ... | php | protected function getLogger()
{
if ($this->logger === null) {
// @todo: Instantiate a webshop specific log object that logs to a separate Acumulus log file.
$this->logger = new FileLogger(AbstractLogger::DEBUG);
$this->logger->setFilename(_ROOT_DIR_ . '/'. $logDirectory ... | [
"protected",
"function",
"getLogger",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logger",
"===",
"null",
")",
"{",
"// @todo: Instantiate a webshop specific log object that logs to a separate Acumulus log file.",
"$",
"this",
"->",
"logger",
"=",
"new",
"FileLogger",... | Returns the MyWebShop specific logger.
@return \AbstractLogger | [
"Returns",
"the",
"MyWebShop",
"specific",
"logger",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/MyWebShop/Helpers/Log.php#L60-L68 |
30,485 | SIELOnline/libAcumulus | src/Joomla/Shop/InvoiceManager.php | InvoiceManager.toSql | protected function toSql($date)
{
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));
$date = new JDate($date);
$date->setTimezone($tz);
return $date->toSql(true);
} | php | protected function toSql($date)
{
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));
$date = new JDate($date);
$date->setTimezone($tz);
return $date->toSql(true);
} | [
"protected",
"function",
"toSql",
"(",
"$",
"date",
")",
"{",
"$",
"tz",
"=",
"new",
"DateTimeZone",
"(",
"JFactory",
"::",
"getApplication",
"(",
")",
"->",
"get",
"(",
"'offset'",
")",
")",
";",
"$",
"date",
"=",
"new",
"JDate",
"(",
"$",
"date",
... | Helper method that returns a date in the correct and escaped sql format.
@param string $date
Date in yyyy-mm-dd format.
@return string
@throws \Exception | [
"Helper",
"method",
"that",
"returns",
"a",
"date",
"in",
"the",
"correct",
"and",
"escaped",
"sql",
"format",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Joomla/Shop/InvoiceManager.php#L71-L77 |
30,486 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.setInvoiceSource | protected function setInvoiceSource($invoiceSource)
{
$this->invoiceSource = $invoiceSource;
if (!in_array($invoiceSource->getType(), array(Source::Order, Source::CreditNote))) {
$this->log->error('Creator::setSource(): unknown source type %s', $this->invoiceSource->getType());
}... | php | protected function setInvoiceSource($invoiceSource)
{
$this->invoiceSource = $invoiceSource;
if (!in_array($invoiceSource->getType(), array(Source::Order, Source::CreditNote))) {
$this->log->error('Creator::setSource(): unknown source type %s', $this->invoiceSource->getType());
}... | [
"protected",
"function",
"setInvoiceSource",
"(",
"$",
"invoiceSource",
")",
"{",
"$",
"this",
"->",
"invoiceSource",
"=",
"$",
"invoiceSource",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"invoiceSource",
"->",
"getType",
"(",
")",
",",
"array",
"(",
"Sour... | Sets the source to create the invoice for.
@param Source $invoiceSource | [
"Sets",
"the",
"source",
"to",
"create",
"the",
"invoice",
"for",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L179-L185 |
30,487 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.setPropertySources | protected function setPropertySources()
{
$this->propertySources = array();
$this->propertySources['invoiceSource'] = $this->invoiceSource;
if (array_key_exists(Source::CreditNote, $this->shopCapabilities->getSupportedInvoiceSourceTypes())) {
$this->propertySources['originalInvoi... | php | protected function setPropertySources()
{
$this->propertySources = array();
$this->propertySources['invoiceSource'] = $this->invoiceSource;
if (array_key_exists(Source::CreditNote, $this->shopCapabilities->getSupportedInvoiceSourceTypes())) {
$this->propertySources['originalInvoi... | [
"protected",
"function",
"setPropertySources",
"(",
")",
"{",
"$",
"this",
"->",
"propertySources",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"propertySources",
"[",
"'invoiceSource'",
"]",
"=",
"$",
"this",
"->",
"invoiceSource",
";",
"if",
"(",
"ar... | Sets the list of sources to search for a property when expanding tokens. | [
"Sets",
"the",
"list",
"of",
"sources",
"to",
"search",
"for",
"a",
"property",
"when",
"expanding",
"tokens",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L190-L208 |
30,488 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.create | public function create($source)
{
$this->setInvoiceSource($source);
$this->setPropertySources();
$this->invoice = array();
$this->invoice[Tag::Customer] = $this->getCustomer();
$this->invoice[Tag::Customer][Tag::Invoice] = $this->getInvoice();
$this->invoice[Tag::Cust... | php | public function create($source)
{
$this->setInvoiceSource($source);
$this->setPropertySources();
$this->invoice = array();
$this->invoice[Tag::Customer] = $this->getCustomer();
$this->invoice[Tag::Customer][Tag::Invoice] = $this->getInvoice();
$this->invoice[Tag::Cust... | [
"public",
"function",
"create",
"(",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"setInvoiceSource",
"(",
"$",
"source",
")",
";",
"$",
"this",
"->",
"setPropertySources",
"(",
")",
";",
"$",
"this",
"->",
"invoice",
"=",
"array",
"(",
")",
";",
"$",... | Creates an Acumulus invoice from an order or credit note.
@param Source $source
The web shop order.
@return array
The acumulus invoice for this order. | [
"Creates",
"an",
"Acumulus",
"invoice",
"from",
"an",
"order",
"or",
"credit",
"note",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L246-L259 |
30,489 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.getCustomer | protected function getCustomer()
{
$customer = array();
$customerSettings = $this->config->getCustomerSettings();
$this->addDefault($customer, Tag::Type, $customerSettings['defaultCustomerType']);
$this->addTokenDefault($customer, Tag::ContactYourId, $customerSettings['contactYourId'... | php | protected function getCustomer()
{
$customer = array();
$customerSettings = $this->config->getCustomerSettings();
$this->addDefault($customer, Tag::Type, $customerSettings['defaultCustomerType']);
$this->addTokenDefault($customer, Tag::ContactYourId, $customerSettings['contactYourId'... | [
"protected",
"function",
"getCustomer",
"(",
")",
"{",
"$",
"customer",
"=",
"array",
"(",
")",
";",
"$",
"customerSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getCustomerSettings",
"(",
")",
";",
"$",
"this",
"->",
"addDefault",
"(",
"$",
"custom... | Returns the 'customer' part of the invoice add structure.
The following keys are allowed/expected by the API:
- type
- contactid: will not be set. Acumulus id for this customer, in the
absence of this value, the API uses the email address as identifying
value.
- contactyourid: webshop customer id.
- contactstatus
- co... | [
"Returns",
"the",
"customer",
"part",
"of",
"the",
"invoice",
"add",
"structure",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L303-L331 |
30,490 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.getInvoiceNumber | protected function getInvoiceNumber($invoiceNumberSource)
{
$result = $invoiceNumberSource === PluginConfig::InvoiceNrSource_ShopInvoice ? $this->invoiceSource->getInvoiceReference() : null;
if (empty($result)) {
$result = $this->invoiceSource->getReference();
}
return $r... | php | protected function getInvoiceNumber($invoiceNumberSource)
{
$result = $invoiceNumberSource === PluginConfig::InvoiceNrSource_ShopInvoice ? $this->invoiceSource->getInvoiceReference() : null;
if (empty($result)) {
$result = $this->invoiceSource->getReference();
}
return $r... | [
"protected",
"function",
"getInvoiceNumber",
"(",
"$",
"invoiceNumberSource",
")",
"{",
"$",
"result",
"=",
"$",
"invoiceNumberSource",
"===",
"PluginConfig",
"::",
"InvoiceNrSource_ShopInvoice",
"?",
"$",
"this",
"->",
"invoiceSource",
"->",
"getInvoiceReference",
"(... | Returns the number to use as invoice number.
@param int $invoiceNumberSource
\Siel\Acumulus\PluginConfig::InvoiceNrSource_ShopInvoice or
\Siel\Acumulus\PluginConfig::InvoiceNrSource_ShopOrder.
@return int
The number to use as invoice "number" on the Acumulus invoice. Note
that Acumulus expects a number and does not a... | [
"Returns",
"the",
"number",
"to",
"use",
"as",
"invoice",
"number",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L462-L469 |
30,491 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.getInvoiceDate | protected function getInvoiceDate($dateToUse)
{
$result = $this->invoiceSource->getInvoiceDate();
if ($dateToUse != PluginConfig::InvoiceDate_OrderCreate || empty($result)) {
$result = $this->invoiceSource->getDate();
}
return $result;
} | php | protected function getInvoiceDate($dateToUse)
{
$result = $this->invoiceSource->getInvoiceDate();
if ($dateToUse != PluginConfig::InvoiceDate_OrderCreate || empty($result)) {
$result = $this->invoiceSource->getDate();
}
return $result;
} | [
"protected",
"function",
"getInvoiceDate",
"(",
"$",
"dateToUse",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"invoiceSource",
"->",
"getInvoiceDate",
"(",
")",
";",
"if",
"(",
"$",
"dateToUse",
"!=",
"PluginConfig",
"::",
"InvoiceDate_OrderCreate",
"||",... | Returns the date to use as invoice date.
@param int $dateToUse
\Siel\Acumulus\PluginConfig::InvoiceDate_InvoiceCreate or
\Siel\Acumulus\PluginConfig::InvoiceDate_OrderCreate
@return string
Date to use as invoice date on the Acumulus invoice: yyyy-mm-dd. | [
"Returns",
"the",
"date",
"to",
"use",
"as",
"invoice",
"date",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L481-L488 |
30,492 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.getInvoiceLines | protected function getInvoiceLines()
{
$itemLines = $this->getItemLines();
$itemLines = $this->addLineType($itemLines, static::LineType_OrderItem);
$feeLines = $this->getFeeLines();
$discountLines = $this->getDiscountLines();
$discountLines = $this->addLineType($discountLin... | php | protected function getInvoiceLines()
{
$itemLines = $this->getItemLines();
$itemLines = $this->addLineType($itemLines, static::LineType_OrderItem);
$feeLines = $this->getFeeLines();
$discountLines = $this->getDiscountLines();
$discountLines = $this->addLineType($discountLin... | [
"protected",
"function",
"getInvoiceLines",
"(",
")",
"{",
"$",
"itemLines",
"=",
"$",
"this",
"->",
"getItemLines",
"(",
")",
";",
"$",
"itemLines",
"=",
"$",
"this",
"->",
"addLineType",
"(",
"$",
"itemLines",
",",
"static",
"::",
"LineType_OrderItem",
"... | Returns the 'invoice''line' parts of the invoice add structure.
Each invoice line is a keyed array.
The following keys are allowed or expected (*) by the API:
- itemnumber
- product
- nature
* unitprice
* vatrate
* quantity
- costprice: optional, this triggers margin invoices.
Meta data (not recognised by the API but... | [
"Returns",
"the",
"invoice",
"line",
"parts",
"of",
"the",
"invoice",
"add",
"structure",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L570-L585 |
30,493 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.addProductInfo | protected function addProductInfo(array &$line)
{
$invoiceSettings = $this->config->getInvoiceSettings();
$this->addTokenDefault($line, Tag::ItemNumber, $invoiceSettings['itemNumber']);
$this->addTokenDefault($line, Tag::Product, $invoiceSettings['productName']);
$this->addNature($li... | php | protected function addProductInfo(array &$line)
{
$invoiceSettings = $this->config->getInvoiceSettings();
$this->addTokenDefault($line, Tag::ItemNumber, $invoiceSettings['itemNumber']);
$this->addTokenDefault($line, Tag::Product, $invoiceSettings['productName']);
$this->addNature($li... | [
"protected",
"function",
"addProductInfo",
"(",
"array",
"&",
"$",
"line",
")",
"{",
"$",
"invoiceSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getInvoiceSettings",
"(",
")",
";",
"$",
"this",
"->",
"addTokenDefault",
"(",
"$",
"line",
",",
"Tag",
... | Adds the product based tags to a line.
The product based tags are:
- item number
- product name
- nature
- cost price
@param array $line | [
"Adds",
"the",
"product",
"based",
"tags",
"to",
"a",
"line",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L612-L626 |
30,494 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.addNature | protected function addNature(array &$line)
{
if (empty($line[Tag::Nature])) {
$shopSettings = $this->config->getShopSettings();
switch ($shopSettings['nature_shop']) {
case PluginConfig::Nature_Products:
$line[Tag::Nature] = Api::Nature_Product;
... | php | protected function addNature(array &$line)
{
if (empty($line[Tag::Nature])) {
$shopSettings = $this->config->getShopSettings();
switch ($shopSettings['nature_shop']) {
case PluginConfig::Nature_Products:
$line[Tag::Nature] = Api::Nature_Product;
... | [
"protected",
"function",
"addNature",
"(",
"array",
"&",
"$",
"line",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"line",
"[",
"Tag",
"::",
"Nature",
"]",
")",
")",
"{",
"$",
"shopSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getShopSettings",
"(",... | Adds the nature tag to the line.
The nature tag indicates the nature of the article for which the line is
being constructed. It can be Product or Service.
The nature can come from the:
- Shop settings: the nature_shop setting.
- Invoice settings: The nature field reference.
@param array $line | [
"Adds",
"the",
"nature",
"tag",
"to",
"the",
"line",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L640-L657 |
30,495 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.getFeeLines | protected function getFeeLines()
{
$result = array();
$shippingLines = $this->getShippingLines();
if ($shippingLines) {
$shippingLines = $this->addLineType($shippingLines, static::LineType_Shipping, Api::Nature_Service);
$result = array_merge($result, $shippingLines)... | php | protected function getFeeLines()
{
$result = array();
$shippingLines = $this->getShippingLines();
if ($shippingLines) {
$shippingLines = $this->addLineType($shippingLines, static::LineType_Shipping, Api::Nature_Service);
$result = array_merge($result, $shippingLines)... | [
"protected",
"function",
"getFeeLines",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"shippingLines",
"=",
"$",
"this",
"->",
"getShippingLines",
"(",
")",
";",
"if",
"(",
"$",
"shippingLines",
")",
"{",
"$",
"shippingLines",
"=",
"$... | Returns all the fee lines for the order.
Override this method if it is easier to return all fee lines at once.
If you do so, you are responsible for adding the line Meta::LineType meta
data. Otherwise, override the methods getShippingLines() (or
getShippingLine()), getPaymentFeeLine() (if applicable), and
getGiftWrapp... | [
"Returns",
"all",
"the",
"fee",
"lines",
"for",
"the",
"order",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L671-L694 |
30,496 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.addTokenDefault | protected function addTokenDefault(array &$array, $key, $token)
{
if (empty($array[$key]) && !empty($token)) {
$value = $this->getTokenizedValue($token);
if (!empty($value)) {
$array[$key] = $value;
return true;
}
}
return f... | php | protected function addTokenDefault(array &$array, $key, $token)
{
if (empty($array[$key]) && !empty($token)) {
$value = $this->getTokenizedValue($token);
if (!empty($value)) {
$array[$key] = $value;
return true;
}
}
return f... | [
"protected",
"function",
"addTokenDefault",
"(",
"array",
"&",
"$",
"array",
",",
"$",
"key",
",",
"$",
"token",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"array",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"token",
")",
")",
"{",
"... | Helper method to add a non-empty possibly tokenized value to an array.
This method will not overwrite existing values.
@param array $array
@param string $key
@param string $token
String value that may contain token definitions.
@return bool
Whether the default was added. | [
"Helper",
"method",
"to",
"add",
"a",
"non",
"-",
"empty",
"possibly",
"tokenized",
"value",
"to",
"an",
"array",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L866-L876 |
30,497 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.addIfSetAndNotEmpty | protected function addIfSetAndNotEmpty(array &$targetArray, $targetKey, $source, $sourceKey)
{
if (is_array($source)) {
if (!empty($source[$sourceKey])) {
$targetArray[$targetKey] = $source[$sourceKey];
return true;
}
} else {
if (!... | php | protected function addIfSetAndNotEmpty(array &$targetArray, $targetKey, $source, $sourceKey)
{
if (is_array($source)) {
if (!empty($source[$sourceKey])) {
$targetArray[$targetKey] = $source[$sourceKey];
return true;
}
} else {
if (!... | [
"protected",
"function",
"addIfSetAndNotEmpty",
"(",
"array",
"&",
"$",
"targetArray",
",",
"$",
"targetKey",
",",
"$",
"source",
",",
"$",
"sourceKey",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"source",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
... | Helper method to add a value from an array or object only if it is set
and not empty.
@param array $targetArray
@param string $targetKey
@param array|object $source
@param string $sourceKey
@return bool
Whether the array value or object property is set and not empty and
thus has been added. | [
"Helper",
"method",
"to",
"add",
"a",
"value",
"from",
"an",
"array",
"or",
"object",
"only",
"if",
"it",
"is",
"set",
"and",
"not",
"empty",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L904-L918 |
30,498 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.addEmpty | protected function addEmpty(array &$array, $key, $value, $default = '')
{
if (!empty($value)) {
$array[$key] = $value;
return true;
} else {
$array[$key] = $default;
return false;
}
} | php | protected function addEmpty(array &$array, $key, $value, $default = '')
{
if (!empty($value)) {
$array[$key] = $value;
return true;
} else {
$array[$key] = $default;
return false;
}
} | [
"protected",
"function",
"addEmpty",
"(",
"array",
"&",
"$",
"array",
",",
"$",
"key",
",",
"$",
"value",
",",
"$",
"default",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"array",
"[",
"$",
"key",
"]",
... | Helper method to add a value to an array even if it is empty.
@param array $array
@param string $key
@param mixed $value
@param mixed $default
@return bool
True if the value was not empty and thus has been added, false if the
default has been added. | [
"Helper",
"method",
"to",
"add",
"a",
"value",
"to",
"an",
"array",
"even",
"if",
"it",
"is",
"empty",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L952-L961 |
30,499 | SIELOnline/libAcumulus | src/Invoice/Creator.php | Creator.getVatRangeTags | public static function getVatRangeTags($numerator, $denominator, $numeratorPrecision = 0.01, $denominatorPrecision = 0.01)
{
if (Number::isZero($denominator, 0.0001)) {
$result = array(
Tag::VatRate => null,
Meta::VatAmount => $numerator,
Meta::Vat... | php | public static function getVatRangeTags($numerator, $denominator, $numeratorPrecision = 0.01, $denominatorPrecision = 0.01)
{
if (Number::isZero($denominator, 0.0001)) {
$result = array(
Tag::VatRate => null,
Meta::VatAmount => $numerator,
Meta::Vat... | [
"public",
"static",
"function",
"getVatRangeTags",
"(",
"$",
"numerator",
",",
"$",
"denominator",
",",
"$",
"numeratorPrecision",
"=",
"0.01",
",",
"$",
"denominatorPrecision",
"=",
"0.01",
")",
"{",
"if",
"(",
"Number",
"::",
"isZero",
"(",
"$",
"denominat... | Returns the range in which the vat rate will lie.
If a webshop does not store the vat rates used in the order, we must
calculate them using a (product) price and the vat on it. But as web
shops often store these numbers rounded to cents, the vat rate
calculation becomes imprecise. Therefore we compute the range in whi... | [
"Returns",
"the",
"range",
"in",
"which",
"the",
"vat",
"rate",
"will",
"lie",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Creator.php#L1085-L1112 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.