mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Quickbooks sync
This commit is contained in:
parent
80f34caccf
commit
28775c087e
@ -28,5 +28,12 @@ class QuickbooksSyncMap
|
||||
public bool $update_record = true;
|
||||
|
||||
public SyncDirection $direction = SyncDirection::BIDIRECTIONAL;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
$this->sync = $attributes['sync'] ?? true;
|
||||
$this->update_record = $attributes['update_record'] ?? true;
|
||||
$this->direction = $attributes['direction'] ?? SyncDirection::BIDIRECTIONAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ class BankTransactionFilters extends QueryFilters
|
||||
*/
|
||||
public function client_status(string $value = ''): Builder
|
||||
{
|
||||
if (strlen($value ?? '') == 0) {
|
||||
if (strlen($value) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,7 @@ class ZugferdEDocument extends AbstractService
|
||||
$vendor->postal_code = $postcode;
|
||||
|
||||
$country = app('countries')->first(function ($c) use ($country) {
|
||||
/** @var \App\Models\Country $c */
|
||||
return $c->iso_3166_2 == $country || $c->iso_3166_3 == $country;
|
||||
});
|
||||
if ($country)
|
||||
|
@ -84,7 +84,7 @@ class QbProduct implements SyncInterface
|
||||
{
|
||||
$qb_record = $this->find($id);
|
||||
|
||||
if($ninja_record = $this->findProduct($id))
|
||||
if($this->service->updateGate('product') && $ninja_record = $this->findProduct($id))
|
||||
{
|
||||
|
||||
if(Carbon::parse($last_updated) > Carbon::parse($ninja_record->updated_at))
|
||||
@ -99,4 +99,4 @@ class QbProduct implements SyncInterface
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -138,7 +138,7 @@ class QuickbooksService
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether to update a record based on the sync settings.
|
||||
* Updates the gate for a given entity
|
||||
*
|
||||
* @param string $entity
|
||||
* @return bool
|
||||
|
@ -91,7 +91,7 @@ class PaymentTransformer extends BaseTransformer
|
||||
if(!$credit_line)
|
||||
return $payment;
|
||||
|
||||
$credit = \App\Factory\CreditFactory::create($this->company->id, $this->company->owner()->id, $payment->client_id);
|
||||
$credit = \App\Factory\CreditFactory::create($this->company->id, $this->company->owner()->id);
|
||||
$credit->client_id = $payment->client_id;
|
||||
|
||||
$line = new \App\DataMapper\InvoiceItem();
|
||||
|
Loading…
x
Reference in New Issue
Block a user