mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add hash to products
This commit is contained in:
parent
98326f1315
commit
7bd02ab097
@ -108,7 +108,7 @@ class QuickbooksService
|
|||||||
|
|
||||||
$records = $this->sdk()->fetchRecords($entity);
|
$records = $this->sdk()->fetchRecords($entity);
|
||||||
|
|
||||||
nlog(json_encode($records));
|
// nlog(json_encode($records));
|
||||||
|
|
||||||
$this->processEntitySync($key, $records);
|
$this->processEntitySync($key, $records);
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ class QuickbooksService
|
|||||||
foreach($records as $record)
|
foreach($records as $record)
|
||||||
{
|
{
|
||||||
$ninja_data = $product_transformer->qbToNinja($record);
|
$ninja_data = $product_transformer->qbToNinja($record);
|
||||||
nlog($ninja_data);
|
// nlog($ninja_data);
|
||||||
|
|
||||||
if($product = $this->findProduct($ninja_data['hash']))
|
if($product = $this->findProduct($ninja_data['hash']))
|
||||||
{
|
{
|
||||||
@ -315,7 +315,8 @@ nlog($ninja_data);
|
|||||||
if($search->count() == 0) {
|
if($search->count() == 0) {
|
||||||
//new product
|
//new product
|
||||||
$product = ProductFactory::create($this->company->id, $this->company->owner()->id);
|
$product = ProductFactory::create($this->company->id, $this->company->owner()->id);
|
||||||
|
$product->hash = $key;
|
||||||
|
|
||||||
return $product;
|
return $product;
|
||||||
} elseif($search->count() == 1) {
|
} elseif($search->count() == 1) {
|
||||||
return $this->settings['product']['update_record'] ? $search->first() : null;
|
return $this->settings['product']['update_record'] ? $search->first() : null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user