56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/einvoice/tradevan/validator/issue_data_validator.rb', line 56
def validate_each(record, attribtue, value)
if record.itemList.map(&:itemTotal).map(&:blank?).reduce(&:|)
record.errors[:itemList] << options[:message] || :invalid
elsif record.itemList.map(&:taxType).map(&:blank?).reduce(&:|)
record.errors[:itemList] << options[:message] || :invalid
else
end
if %w(A H).include?(record.type)
if record.itemList.map(&:invoiceNumber).map(&:blank?).reduce(&:|)
record.errors[:itemList] << options[:message] || :invalid
elsif record.itemList.map(&:invoiceDate).map(&:blank?).reduce(&:|)
record.errors[:itemList] << options[:message] || :invalid
elsif record.itemList.map(&:itemExclude).map(&:blank?).reduce(&:|)
record.errors[:itemList] << options[:message] || :invalid
else
end
end
end
|