Disable product price updating if currencies do not match
This commit is contained in:
parent
d293c28a55
commit
d9047b413a
2 changed files with 35 additions and 0 deletions
|
|
@ -55,6 +55,9 @@ class UpdateOrCreateProduct implements ShouldQueue
|
|||
{
|
||||
MultiDB::setDB($this->company->db);
|
||||
|
||||
if(strval($this->invoice->client->getSetting('currency_id')) != strval($this->company->settings->currency_id))
|
||||
return;
|
||||
|
||||
/*
|
||||
* If the invoice was generated from a Task or Expense then
|
||||
* we do NOT update the product details this short block we
|
||||
|
|
|
|||
|
|
@ -55,4 +55,36 @@ class CompanySettingsTest extends TestCase
|
|||
|
||||
$this->assertEquals(1, count($diff));
|
||||
}
|
||||
|
||||
public function testStringEquivalence()
|
||||
{
|
||||
|
||||
$value = (strval(4) != strval(3));
|
||||
|
||||
$this->assertTrue($value);
|
||||
|
||||
$value = (strval(4) != strval(4));
|
||||
|
||||
$this->assertFalse($value);
|
||||
|
||||
$value = (strval('4') != strval(4));
|
||||
$this->assertFalse($value);
|
||||
|
||||
$value = (strval('4') != strval('4'));
|
||||
|
||||
$this->assertFalse($value);
|
||||
|
||||
$value = (strval('4') != strval(3));
|
||||
|
||||
$this->assertTrue($value);
|
||||
|
||||
$value = (strval(4) != strval('3'));
|
||||
|
||||
$this->assertTrue($value);
|
||||
|
||||
$value = (strval('4') != strval('3'));
|
||||
|
||||
$this->assertTrue($value);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue