1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
This commit is contained in:
David Bomba 2023-03-29 07:53:46 +11:00
parent c46cf68d59
commit bd744b4ae0
6 changed files with 24 additions and 36 deletions

View File

@ -20,37 +20,6 @@ class BaseRule implements RuleInterface
{ {
/** EU TAXES */ /** EU TAXES */
public array $distance_selling_thresholds = [
"AT" => 35000,
"BE" => 35000,
"BG" => 35800,
"HR" => 35900,
"CY" => 0, // Cyprus does not have a distance selling threshold, so for cyprus buyers and sellers always use this rate
"CZ" => 44200,
"DK" => 37500,
"EE" => 35000,
"FI" => 35000,
"FR" => 35000,
"DE" => 100000,
"GR" => 35000,
"HU" => 25000,
"IE" => 35000,
"IT" => 35000,
"LV" => 35000,
"LT" => 35000,
"LU" => 100000,
"MT" => 35000,
"NL" => 100000,
"PL" => 36900,
"PT" => 35000,
"RO" => 24200,
"SK" => 35000,
"SI" => 35000,
"ES" => 35000,
"SE" => 31700
];
public float $vat_rate = 19; public float $vat_rate = 19;
public float $vat_threshold = 10000; public float $vat_threshold = 10000;
public float $vat_reduced_rate = 7; public float $vat_reduced_rate = 7;
@ -202,7 +171,7 @@ class BaseRule implements RuleInterface
} }
match ($product_tax_type) { match ($product_tax_type) {
Product::PRODUCT_TAX_EXEMPT => $this->taxExempt(), Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt(),
Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(), Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(),
Product::PRODUCT_TYPE_SERVICE => $this->taxService(), Product::PRODUCT_TYPE_SERVICE => $this->taxService(),
Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping(), Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping(),

View File

@ -96,7 +96,7 @@ class Rule extends BaseRule implements RuleInterface
return $this; return $this;
match($product_tax_type){ match($product_tax_type){
Product::PRODUCT_TAX_EXEMPT => $this->taxExempt(), Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt(),
Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(), Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(),
Product::PRODUCT_TYPE_SERVICE => $this->taxService(), Product::PRODUCT_TYPE_SERVICE => $this->taxService(),
Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping(), Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping(),

View File

@ -73,7 +73,7 @@ class Rule implements RuleInterface
} }
match($product_tax_type){ match($product_tax_type){
Product::PRODUCT_TAX_EXEMPT => $this->taxExempt(), Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt(),
Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(), Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(),
Product::PRODUCT_TYPE_SERVICE => $this->taxService(), Product::PRODUCT_TYPE_SERVICE => $this->taxService(),
Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping(), Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping(),

View File

@ -12,6 +12,7 @@
namespace App\Http\Requests\Invoice; namespace App\Http\Requests\Invoice;
use App\Http\Requests\Request; use App\Http\Requests\Request;
use Illuminate\Http\UploadedFile;
class UploadInvoiceRequest extends Request class UploadInvoiceRequest extends Request
{ {
@ -46,5 +47,24 @@ class UploadInvoiceRequest extends Request
public function prepareForValidation() public function prepareForValidation()
{ {
//tests to see if upload via binary data works.
// if(request()->getContent())
// {
// // $file = new UploadedFile(request()->getContent(), request()->header('filename'));
// $file = new UploadedFile(request()->getContent(), 'something.png');
// // request()->files->set('documents', $file);
// $this->files->add(['file' => $file]);
// // Merge it in request also (As I found this is not needed in every case)
// $this->merge(['file' => $file]);
// }
} }
} }

View File

@ -117,7 +117,7 @@ class Product extends BaseModel
public const PRODUCT_TYPE_SERVICE = 2; public const PRODUCT_TYPE_SERVICE = 2;
public const PRODUCT_TYPE_DIGITAL = 3; public const PRODUCT_TYPE_DIGITAL = 3;
public const PRODUCT_TYPE_SHIPPING = 4; public const PRODUCT_TYPE_SHIPPING = 4;
public const PRODUCT_TAX_EXEMPT = 5; public const PRODUCT_TYPE_EXEMPT = 5;
public const PRODUCT_TYPE_REDUCED_TAX = 6; public const PRODUCT_TYPE_REDUCED_TAX = 6;
protected $fillable = [ protected $fillable = [

View File

@ -374,7 +374,6 @@ class HtmlEngine
$data['$user_iban'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')]; $data['$user_iban'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
$data['$invoice.public_notes'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->public_notes ?: ''), $this->client) ?: '', 'label' => ctrans('texts.public_notes')]; $data['$invoice.public_notes'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->public_notes ?: ''), $this->client) ?: '', 'label' => ctrans('texts.public_notes')];
$data['$entity.public_notes'] = &$data['$invoice.public_notes']; $data['$entity.public_notes'] = &$data['$invoice.public_notes'];
$data['$public_notes'] = &$data['$invoice.public_notes']; $data['$public_notes'] = &$data['$invoice.public_notes'];