forked from NetSweet/netsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why: *There was not support for expense lines to show up on item receipts in Netsuite This change addresses the need by: *added in the item receipt expense list and item receipt expense models to the gem Ticket * [CLD-737]
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 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
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,36 @@ | ||
module NetSuite | ||
module Records | ||
class ItemReceiptExpense | ||
include Support::Fields | ||
include Support::RecordRefs | ||
include Support::Records | ||
include Namespaces::TranPurch | ||
|
||
fields :account, :amount, :line, :mark_received, :memo, :order_line | ||
|
||
field :options, CustomFieldList | ||
field :custom_field_list, CustomFieldList | ||
|
||
def initialize(attributes_or_record = {}) | ||
case attributes_or_record | ||
when Hash | ||
initialize_from_attributes_hash(attributes_or_record) | ||
when self.class | ||
initialize_from_record(attributes_or_record) | ||
end | ||
end | ||
|
||
def initialize_from_record(record) | ||
self.attributes = record.send(:attributes) | ||
end | ||
|
||
def to_record | ||
rec = super | ||
if rec["#{record_namespace}:customFieldList"] | ||
rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") | ||
end | ||
rec | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module NetSuite | ||
module Records | ||
class ItemReceiptExpenseList < Support::Sublist | ||
include Namespaces::TranPurch | ||
|
||
sublist :expense, ItemReceiptExpense | ||
|
||
alias :expenses :expense | ||
end | ||
end | ||
end |