Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added payment_for attribute to invoice, refs #425
- Loading branch information
Showing
13 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) 2012-2017, Jungwacht Blauring Schweiz. This file is part of | ||
# hitobito and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito. | ||
|
||
app = window.App ||= {} | ||
|
||
class app.InvoiceConfigs | ||
constructor: () -> | ||
|
||
showPaymentSlipSpecificAttributes: -> | ||
payment_slip = $('#invoice_config_payment_slip').find(":selected").val() | ||
beneficiary_control_group = $('#invoice_config_beneficiary').closest('.control-group') | ||
|
||
if payment_slip == 'ch_besr' || payment_slip == 'ch_bes' | ||
beneficiary_control_group.slideDown() | ||
else | ||
beneficiary_control_group.hide() | ||
|
||
bind: -> | ||
self = this | ||
$(document).on('change', '#invoice_config_payment_slip', (e) -> self.showPaymentSlipSpecificAttributes()) | ||
$(document).on('turbolinks:load', (e) -> self.showPaymentSlipSpecificAttributes()) | ||
|
||
new app.InvoiceConfigs().bind() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddPaymentForToInvoice < ActiveRecord::Migration | ||
def change | ||
add_column :invoices, :payment_for, :text | ||
add_column :invoice_configs, :payment_for, :text | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters