mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 21:34:35 -04:00
Expose product price in API
This commit is contained in:
parent
1778e63421
commit
e21d425093
@ -143,15 +143,14 @@ class MultiDB
|
|||||||
|
|
||||||
public static function findAndSetDbByDomain($domain) :bool
|
public static function findAndSetDbByDomain($domain) :bool
|
||||||
{
|
{
|
||||||
\Log::error("searching for {$domain}");
|
//\Log::error("searching for {$domain}");
|
||||||
|
|
||||||
foreach (self::$dbs as $db)
|
foreach (self::$dbs as $db)
|
||||||
{
|
{
|
||||||
$company = Company::on($db)->whereDomain($domain)->first();
|
|
||||||
\Log::error($company);
|
|
||||||
if($company = Company::on($db)->whereDomain($domain)->first())
|
if($company = Company::on($db)->whereDomain($domain)->first())
|
||||||
{
|
{
|
||||||
\Log::error("setting db");
|
|
||||||
self::setDb($company->db);
|
self::setDb($company->db);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ class ProductTransformer extends EntityTransformer
|
|||||||
'product_key' => $product->product_key,
|
'product_key' => $product->product_key,
|
||||||
'notes' => $product->notes,
|
'notes' => $product->notes,
|
||||||
'cost' => (float) $product->cost,
|
'cost' => (float) $product->cost,
|
||||||
|
'price' => (float) $product->price,
|
||||||
'quantity' => (float) ($product->quantity ?: 0.0),
|
'quantity' => (float) ($product->quantity ?: 0.0),
|
||||||
'tax_name1' => $product->tax_name1 ?: '',
|
'tax_name1' => $product->tax_name1 ?: '',
|
||||||
'tax_rate1' => (float) $product->tax_rate1,
|
'tax_rate1' => (float) $product->tax_rate1,
|
||||||
@ -72,8 +73,8 @@ class ProductTransformer extends EntityTransformer
|
|||||||
'archived_at' => $product->deleted_at,
|
'archived_at' => $product->deleted_at,
|
||||||
'custom_value1' => $product->custom_value1 ?: '',
|
'custom_value1' => $product->custom_value1 ?: '',
|
||||||
'custom_value2' => $product->custom_value2 ?: '',
|
'custom_value2' => $product->custom_value2 ?: '',
|
||||||
'custom_value3' => $product->custom_value2 ?: '',
|
'custom_value3' => $product->custom_value3 ?: '',
|
||||||
'custom_value4' => $product->custom_value2 ?: '',
|
'custom_value4' => $product->custom_value4 ?: '',
|
||||||
'is_deleted' => (bool) $product->is_deleted,
|
'is_deleted' => (bool) $product->is_deleted,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user