Function __global->generate_invoicing_breakdown
Definitions
sources/ecommerce_tax.php
- Generate an invoicing breakdown.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $type_code | ID_TEXT | No | No | required parameter | N/A | N/A | The product codename |
| $item_name | SHORT_TEXT | No | No | required parameter | N/A | N/A | The human-readable product title |
| $purchase_id | ID_TEXT | No | No | required parameter | N/A | N/A | The purchase ID |
| $price | REAL | No | No | required parameter | N/A | N/A | Transaction price in money (excluding tax and shipping) |
| $tax | REAL | No | No | required parameter | N/A | N/A | Transaction tax in money (including shipping tax) |
| $shipping_cost | REAL | No | No | 0 | N/A | N/A | Transaction shipping cost in money |
| $shipping_tax | REAL | No | No | 0 | N/A | N/A | Transaction shipping tax in money |
Returns
- Invoicing breakdown
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Generate an invoicing breakdown.
*
* @param ID_TEXT $type_code The product codename
* @param SHORT_TEXT $item_name The human-readable product title
* @param ID_TEXT $purchase_id The purchase ID
* @param REAL $price Transaction price in money (excluding tax and shipping)
* @param REAL $tax Transaction tax in money (including shipping tax)
* @param REAL $shipping_cost Transaction shipping cost in money
* @param REAL $shipping_tax Transaction shipping tax in money
* @return array Invoicing breakdown
*/
function generate_invoicing_breakdown(string $type_code, string $item_name, string $purchase_id, float $price, float $tax, float $shipping_cost = 0, float $shipping_tax = 0) : array
* Generate an invoicing breakdown.
*
* @param ID_TEXT $type_code The product codename
* @param SHORT_TEXT $item_name The human-readable product title
* @param ID_TEXT $purchase_id The purchase ID
* @param REAL $price Transaction price in money (excluding tax and shipping)
* @param REAL $tax Transaction tax in money (including shipping tax)
* @param REAL $shipping_cost Transaction shipping cost in money
* @param REAL $shipping_tax Transaction shipping tax in money
* @return array Invoicing breakdown
*/
function generate_invoicing_breakdown(string $type_code, string $item_name, string $purchase_id, float $price, float $tax, float $shipping_cost = 0, float $shipping_tax = 0) : array

