mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #4968 from turbo124/v5-develop
Fixes for fillable properties + other minor fixes"
This commit is contained in:
commit
ffd9c10ef6
@ -136,7 +136,7 @@ class CompanySettings extends BaseSettings
|
|||||||
public $tax_name3 = ''; //@TODO where do we use this?
|
public $tax_name3 = ''; //@TODO where do we use this?
|
||||||
public $tax_rate3 = 0; //@TODO where do we use this?
|
public $tax_rate3 = 0; //@TODO where do we use this?
|
||||||
public $payment_type_id = '0'; //@TODO where do we use this?
|
public $payment_type_id = '0'; //@TODO where do we use this?
|
||||||
public $invoice_fields = ''; //@TODO is this redundant, we store this in the custom_fields on the company?
|
// public $invoice_fields = ''; //@TODO is this redundant, we store this in the custom_fields on the company?
|
||||||
|
|
||||||
public $show_accept_invoice_terms = false; //@TODO ben to confirm
|
public $show_accept_invoice_terms = false; //@TODO ben to confirm
|
||||||
public $show_accept_quote_terms = false; //@TODO ben to confirm
|
public $show_accept_quote_terms = false; //@TODO ben to confirm
|
||||||
@ -392,7 +392,7 @@ class CompanySettings extends BaseSettings
|
|||||||
'invoice_number_pattern' => 'string',
|
'invoice_number_pattern' => 'string',
|
||||||
'invoice_number_counter' => 'integer',
|
'invoice_number_counter' => 'integer',
|
||||||
'invoice_design_id' => 'string',
|
'invoice_design_id' => 'string',
|
||||||
'invoice_fields' => 'string',
|
// 'invoice_fields' => 'string',
|
||||||
'invoice_taxes' => 'int',
|
'invoice_taxes' => 'int',
|
||||||
//'enabled_item_tax_rates' => 'int',
|
//'enabled_item_tax_rates' => 'int',
|
||||||
'invoice_footer' => 'string',
|
'invoice_footer' => 'string',
|
||||||
|
@ -78,7 +78,6 @@
|
|||||||
* @OA\Property(property="tax_name3", type="string", example="GST", description="The tax name"),
|
* @OA\Property(property="tax_name3", type="string", example="GST", description="The tax name"),
|
||||||
* @OA\Property(property="payment_type_id", type="string", example="1", description="The default payment type id"),
|
* @OA\Property(property="payment_type_id", type="string", example="1", description="The default payment type id"),
|
||||||
* @OA\Property(property="custom_fields", type="string", example="{}", description="JSON string of custom fields"),
|
* @OA\Property(property="custom_fields", type="string", example="{}", description="JSON string of custom fields"),
|
||||||
* @OA\Property(property="invoice_fields", type="string", example="{}", description="JSON string of invoice fields"),
|
|
||||||
* @OA\Property(property="email_footer", type="string", example="A default email footer", description="The default email footer"),
|
* @OA\Property(property="email_footer", type="string", example="A default email footer", description="The default email footer"),
|
||||||
* @OA\Property(property="email_sending_method", type="string", example="default", description="The email driver to use to send email, options include default, gmail"),
|
* @OA\Property(property="email_sending_method", type="string", example="default", description="The email driver to use to send email, options include default, gmail"),
|
||||||
* @OA\Property(property="gmail_sending_user_id", type="string", example="F76sd34D", description="The hashed_id of the user account to send email from"),
|
* @OA\Property(property="gmail_sending_user_id", type="string", example="F76sd34D", description="The hashed_id of the user account to send email from"),
|
||||||
|
@ -406,9 +406,9 @@ class ProductController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function destroy(DestroyProductRequest $request, Product $product)
|
public function destroy(DestroyProductRequest $request, Product $product)
|
||||||
{
|
{
|
||||||
$product->delete();
|
$this->product_repo->delete($product);
|
||||||
|
|
||||||
return $this->itemResponse($product);
|
return $this->itemResponse($product->fresh());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,14 +41,11 @@ class Credit extends BaseModel
|
|||||||
protected $presenter = CreditPresenter::class;
|
protected $presenter = CreditPresenter::class;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'assigned_user_id',
|
|
||||||
'project_id',
|
|
||||||
'number',
|
'number',
|
||||||
'discount',
|
'discount',
|
||||||
'po_number',
|
'po_number',
|
||||||
'date',
|
'date',
|
||||||
'due_date',
|
'due_date',
|
||||||
'partial_due_date',
|
|
||||||
'terms',
|
'terms',
|
||||||
'public_notes',
|
'public_notes',
|
||||||
'private_notes',
|
'private_notes',
|
||||||
@ -59,8 +56,9 @@ class Credit extends BaseModel
|
|||||||
'tax_name3',
|
'tax_name3',
|
||||||
'tax_rate3',
|
'tax_rate3',
|
||||||
'is_amount_discount',
|
'is_amount_discount',
|
||||||
'footer',
|
|
||||||
'partial',
|
'partial',
|
||||||
|
'partial_due_date',
|
||||||
|
'project_id',
|
||||||
'custom_value1',
|
'custom_value1',
|
||||||
'custom_value2',
|
'custom_value2',
|
||||||
'custom_value3',
|
'custom_value3',
|
||||||
@ -68,7 +66,16 @@ class Credit extends BaseModel
|
|||||||
'line_items',
|
'line_items',
|
||||||
'client_id',
|
'client_id',
|
||||||
'footer',
|
'footer',
|
||||||
|
'custom_surcharge1',
|
||||||
|
'custom_surcharge2',
|
||||||
|
'custom_surcharge3',
|
||||||
|
'custom_surcharge4',
|
||||||
|
'custom_surcharge_tax1',
|
||||||
|
'custom_surcharge_tax2',
|
||||||
|
'custom_surcharge_tax3',
|
||||||
|
'custom_surcharge_tax4',
|
||||||
'design_id',
|
'design_id',
|
||||||
|
'assigned_user_id',
|
||||||
'exchange_rate',
|
'exchange_rate',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -150,6 +150,16 @@ class Invoice extends BaseModel
|
|||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function project()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Project::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function design()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Design::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
|
@ -42,7 +42,6 @@ class Quote extends BaseModel
|
|||||||
protected $touches = [];
|
protected $touches = [];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'assigned_user_id',
|
|
||||||
'number',
|
'number',
|
||||||
'discount',
|
'discount',
|
||||||
'po_number',
|
'po_number',
|
||||||
@ -51,7 +50,6 @@ class Quote extends BaseModel
|
|||||||
'terms',
|
'terms',
|
||||||
'public_notes',
|
'public_notes',
|
||||||
'private_notes',
|
'private_notes',
|
||||||
'project_id',
|
|
||||||
'tax_name1',
|
'tax_name1',
|
||||||
'tax_rate1',
|
'tax_rate1',
|
||||||
'tax_name2',
|
'tax_name2',
|
||||||
@ -61,6 +59,7 @@ class Quote extends BaseModel
|
|||||||
'is_amount_discount',
|
'is_amount_discount',
|
||||||
'partial',
|
'partial',
|
||||||
'partial_due_date',
|
'partial_due_date',
|
||||||
|
'project_id',
|
||||||
'custom_value1',
|
'custom_value1',
|
||||||
'custom_value2',
|
'custom_value2',
|
||||||
'custom_value3',
|
'custom_value3',
|
||||||
@ -68,7 +67,16 @@ class Quote extends BaseModel
|
|||||||
'line_items',
|
'line_items',
|
||||||
'client_id',
|
'client_id',
|
||||||
'footer',
|
'footer',
|
||||||
|
'custom_surcharge1',
|
||||||
|
'custom_surcharge2',
|
||||||
|
'custom_surcharge3',
|
||||||
|
'custom_surcharge4',
|
||||||
|
'custom_surcharge_tax1',
|
||||||
|
'custom_surcharge_tax2',
|
||||||
|
'custom_surcharge_tax3',
|
||||||
|
'custom_surcharge_tax4',
|
||||||
'design_id',
|
'design_id',
|
||||||
|
'assigned_user_id',
|
||||||
'exchange_rate',
|
'exchange_rate',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -74,7 +74,6 @@ class RecurringInvoice extends BaseModel
|
|||||||
'due_date',
|
'due_date',
|
||||||
'due_date_days',
|
'due_date_days',
|
||||||
'line_items',
|
'line_items',
|
||||||
'settings',
|
|
||||||
'footer',
|
'footer',
|
||||||
'public_notes',
|
'public_notes',
|
||||||
'private_notes',
|
'private_notes',
|
||||||
@ -97,6 +96,17 @@ class RecurringInvoice extends BaseModel
|
|||||||
'auto_bill',
|
'auto_bill',
|
||||||
'auto_bill_enabled',
|
'auto_bill_enabled',
|
||||||
'design_id',
|
'design_id',
|
||||||
|
'custom_surcharge1',
|
||||||
|
'custom_surcharge2',
|
||||||
|
'custom_surcharge3',
|
||||||
|
'custom_surcharge4',
|
||||||
|
'custom_surcharge_tax1',
|
||||||
|
'custom_surcharge_tax2',
|
||||||
|
'custom_surcharge_tax3',
|
||||||
|
'custom_surcharge_tax4',
|
||||||
|
'design_id',
|
||||||
|
'assigned_user_id',
|
||||||
|
'exchange_rate',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
@ -292,7 +292,7 @@ class BaseRepository
|
|||||||
$model = $model->service()->applyNumber()->save();
|
$model = $model->service()->applyNumber()->save();
|
||||||
|
|
||||||
/* Update product details if necessary */
|
/* Update product details if necessary */
|
||||||
if ($model->company->update_products !== false)
|
if ($model->company->update_products)
|
||||||
UpdateOrCreateProduct::dispatch($model->line_items, $model, $model->company);
|
UpdateOrCreateProduct::dispatch($model->line_items, $model, $model->company);
|
||||||
|
|
||||||
/* Perform model specific tasks */
|
/* Perform model specific tasks */
|
||||||
|
@ -125,6 +125,9 @@ class HtmlEngine
|
|||||||
$data['$terms'] = &$data['$entity.terms'];
|
$data['$terms'] = &$data['$entity.terms'];
|
||||||
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
|
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
|
||||||
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')];
|
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')];
|
||||||
|
|
||||||
|
if($this->entity->project()->exists())
|
||||||
|
$data['$project.name'] = ['value' => $this->entity->project->name, 'label' => ctrans('texts.project_name')];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->entity_string == 'quote') {
|
if ($this->entity_string == 'quote') {
|
||||||
@ -154,8 +157,11 @@ class HtmlEngine
|
|||||||
|
|
||||||
if ($this->entity->partial > 0) {
|
if ($this->entity->partial > 0) {
|
||||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
||||||
|
$data['$balance_due_raw'] = ['value' => $this->entity->partial, 'label' => ctrans('texts.partial_due')];
|
||||||
} else {
|
} else {
|
||||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')];
|
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')];
|
||||||
|
$data['$balance_due_raw'] = ['value' => $this->entity->balance, 'label' => ctrans('texts.balance_due')];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['$quote.balance_due'] = $data['$balance_due'];
|
$data['$quote.balance_due'] = $data['$balance_due'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user