mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for adjust product inventory
This commit is contained in:
parent
4bbd4c9393
commit
8ed37fb2d7
@ -13,7 +13,7 @@ namespace App\DataMapper\Tax;
|
||||
|
||||
class TaxModel
|
||||
{
|
||||
public string $seller_region = 'US';
|
||||
// public string $seller_region = 'US';
|
||||
|
||||
public string $seller_subregion = 'CA';
|
||||
|
||||
@ -45,7 +45,7 @@ class TaxModel
|
||||
private function usRegion(): self
|
||||
{
|
||||
$this->regions->US->has_sales_above_threshold = false;
|
||||
$this->regions->US->tax_all = false;
|
||||
$this->regions->US->tax_all_subregions = false;
|
||||
$this->usSubRegions();
|
||||
|
||||
return $this;
|
||||
|
@ -115,9 +115,9 @@ class AdjustProductInventory implements ShouldQueue
|
||||
$p->in_stock_quantity -= $i->quantity;
|
||||
|
||||
$p->saveQuietly();
|
||||
nlog($p->stock_notification_threshold);
|
||||
nlog($p->in_stock_quantity);
|
||||
nlog($p->stock_notification_threshold);
|
||||
nlog("threshold ".$p->stock_notification_threshold);
|
||||
nlog("stock q".$p->in_stock_quantity);
|
||||
nlog("p stock not".$p->stock_notification_threshold);
|
||||
|
||||
if ($this->company->stock_notification && $p->stock_notification && $p->stock_notification_threshold && $p->in_stock_quantity <= $p->stock_notification_threshold) {
|
||||
$this->notifyStockLevels($p, 'product');
|
||||
@ -131,7 +131,7 @@ class AdjustProductInventory implements ShouldQueue
|
||||
private function existingInventoryAdjustment()
|
||||
{
|
||||
|
||||
collect($this->invoice->line_items)->filter(function ($item) {
|
||||
collect($this->old_invoice)->filter(function ($item) {
|
||||
return $item->type_id == '1';
|
||||
})->each(function ($i) {
|
||||
$p = Product::where('product_key', $i->product_key)->where('company_id', $this->company->id)->first();
|
||||
|
@ -114,7 +114,6 @@ class Product extends BaseModel
|
||||
use SoftDeletes;
|
||||
use Filterable;
|
||||
|
||||
|
||||
public const PRODUCT_TYPE_PHYSICAL = 1;
|
||||
public const PRODUCT_TYPE_SERVICE = 2;
|
||||
public const PRODUCT_TYPE_DIGITAL = 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user