Add SupplierCategory

This allows the categorization of suppliers. For a better reporting
it is necessary to split the expenses of the invoices.
E.g. we want to be able to generate independent sums of general cost
like the rent or electricity and the cost of the bought articles.
This commit is contained in:
Patrick Gansterer 2019-11-17 11:41:34 +01:00
parent f5bbe0d5ae
commit d90d188dbf
11 changed files with 90 additions and 25 deletions

View file

@ -27,6 +27,7 @@ class SuppliersController < ApplicationController
def create
@supplier = Supplier.new(supplier_params)
@supplier.supplier_category ||= SupplierCategory.first
if @supplier.save
flash[:notice] = I18n.t('suppliers.create.notice')
redirect_to suppliers_path
@ -70,7 +71,7 @@ class SuppliersController < ApplicationController
params
.require(:supplier)
.permit(:name, :address, :phone, :phone2, :fax, :email, :url, :contact_person, :customer_number,
:iban, :custom_fields, :delivery_days, :order_howto, :note,
:iban, :custom_fields, :delivery_days, :order_howto, :note, :supplier_category_id,
:shared_supplier_id, :min_order_quantity, :shared_sync_method)
end