moy_sklad 1.0.0.beta7 → 1.0.0.beta8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dca62846b4be85a3c2819c5d5f93fe41b06cc6b4
4
- data.tar.gz: 086c9df04c65e1e303ce5d0847755cab70744a3a
3
+ metadata.gz: fbb69d8118b52033c1cf54bc81e90969d6b14a57
4
+ data.tar.gz: 0f323588cfb4482bc85ed8e6e1be24749802612a
5
5
  SHA512:
6
- metadata.gz: b9f242dc52acbf7c11ab44acc7bcc8686c3b038928be42d3f9b11bc4ac50c796f833133a047237185197c7b2f7ebfbc839ed8b4afb9ce8e3bd94b6fbe4fdec1f
7
- data.tar.gz: d1016ebd7cc58c18cf0601b9e46807f78b4ed585e9fe6f5420b8b30c1e93ec2744a6643ab1dc2b232ee5013ae81407e38f25d9216148fc56267ddd6abe86a116
6
+ metadata.gz: d8a9fb5481a5824fff56903695f1ff73de9dc00d9e3674992c8cfea75132ad712979e403f6926f31cf8432609373456dbdadff84ff22d8aafffdc6702274423a
7
+ data.tar.gz: 6c8ac4b78b3513f40e7beb1c0f7f78a3a1b7f482dd234bb95f48a61ae8135c290219f6f7d1d36e5028689d76c9bc8dad69862bf149ef37bfd44e8f153fc1ff3f
@@ -0,0 +1,9 @@
1
+ module MoySklad::Model
2
+ class InvoiceOut < MoySklad::Client::Base
3
+ def initialize(*args)
4
+ super(*args)
5
+ create_nested_resource(:sum)
6
+ create_nested_collection(:invoicePosition)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,135 @@
1
+ xml.invoiceOut(name: name, stateUuid: stateUuid, targetAgentUuid: targetAgentUuid, sourceAgentUuid: sourceAgentUuid, targetStoreUuid: targetStoreUuid,
2
+ sourceStoreUuid: sourceStoreUuid, applicable: applicable, projectUuid: projectUuid, contractUuid: contractUuid, moment: moment,
3
+ targetAccountUuid: targetAccountUuid, sourceAccountUuid: sourceAccountUuid, payerVat: payerVat, retailStoreUuid: retailStoreUuid,
4
+ currencyUuid: currencyUuid, rate: rate, vatIncluded: vatIncluded, employeeUuid: employeeUuid, paymentPlannedMoment: paymentPlannedMoment,
5
+ customerOrderUuid: customerOrderUuid) {
6
+ xml.accountUuid_ accountUuid
7
+ xml.accountId_ accountId
8
+ xml.uuid_ uuid
9
+ xml.groupUuid_ groupUuid
10
+ xml.deleted_ deleted
11
+ xml.code_ code
12
+ xml.externalcode_ externalcode
13
+ xml.description_ description
14
+
15
+ to_a(:attribute).each do |a|
16
+ xml.attribute(metadataUuid: a.metadataUuid, valueText: a.valueText, valueString: a.valueString,
17
+ doubleValue: a.doubleValue, longValue: a.longValue, booleanValue: a.booleanValue,
18
+ timeValue: a.timeValue, entityValueUuid: a.entityValueUuid, agentValueUuid: a.agentValueUuid,
19
+ goodValueUuid: a.goodValueUuid, placeValueUuid: a.placeValueUuid, consignmentValueUuid: a.consignmentValueUuid,
20
+ contractValueUuid: a.contractValueUuid, projectValueUuid: a.projectValueUuid, employeeValueUuid: a.employeeValueUuid,
21
+ goodUuid: a.goodUuid) {
22
+
23
+ xml.accountUuid_ a.accountUuid
24
+ xml.accountId_ a.accountId
25
+ xml.uuid_ a.uuid
26
+ xml.groupUuid_ a.groupUuid
27
+ xml.deleted_ a.deleted
28
+
29
+ a.to_a(:file).each do |f|
30
+ xml.file(name: f.name, created: f.created, filename: f.filename, miniatureUuid: f.miniatureUuid) {
31
+
32
+ xml.accountUuid_ f.accountUuid
33
+ xml.accountId_ f.accountId
34
+ xml.uuid_ f.uuid
35
+ xml.groupUuid_ f.groupUuid
36
+ xml.deleted_ f.deleted
37
+ xml.code_ f.code
38
+ xml.externalcode_ f.externalcode
39
+ xml.description_ f.description
40
+ xml.contents_ f.contents
41
+ }
42
+ end
43
+ }
44
+ end
45
+
46
+ to_a(:document) do |d|
47
+ xml.document(name: d.name, created: d.created, filename: d.filename, miniatureUuid: d.miniatureUuid,
48
+ emailedDate: d.emailedDate, publicId: d.publicId, operationUuid: d.operationUuid) {
49
+ xml.accountUuid_ d.accountUuid
50
+ xml.accountId_ d.accountId
51
+ xml.uuid_ d.uuid
52
+ xml.groupUuid_ d.groupUuid
53
+ xml.deleted_ d.deleted
54
+ xml.code_ d.code
55
+ xml.externalcode_ d.externalcode
56
+ xml.description_ d.description
57
+ xml.contents_ d.contents
58
+ }
59
+ end
60
+
61
+ xml.sum(sum: sum.sum, sumInCurrency: sum.sumInCurrency)
62
+
63
+ to_a(:invoicePosition).each do |p|
64
+ xml.invoicePosition(discount: p.discount, quantity: p.quantity, goodPackUuid: p.goodPackUuid, consignmentUuid: p.consignmentUuid,
65
+ goodUuid: p.goodUuid, slotUuid: p.slotUuid, vat: p.vat) {
66
+
67
+ xml.accountUuid_ p.accountUuid
68
+ xml.accountId_ p.accountId
69
+ xml.uuid_ p.uuid
70
+ xml.groupUuid_ p.groupUuid
71
+
72
+ xml.basePrice(sum: p.basePrice.sum, sumInCurrency: p.basePrice.sumInCurrency)
73
+ xml.price(sum: p.price.sum, sumInCurrency: p.price.sumInCurrency)
74
+
75
+ xml.thins {
76
+ p.to_a(:thingRef).each do |t|
77
+ xml.thingRef(name: t.name, goodUuid: t.goodUuid) {
78
+
79
+ xml.accountUuid_ t.accountUuid
80
+ xml.accountId_ t.accountId
81
+ xml.uuid_ t.uuid
82
+ xml.groupUuid_ t.groupUuid
83
+ xml.deleted_ t.deleted
84
+ xml.code_ t.code
85
+ xml.externalcode_ t.externalcode
86
+ xml.description_ t.description
87
+
88
+ t.to_a(:attribute).each do |a|
89
+ xml.attribute(metadataUuid: a.metadataUuid, valueText: a.valueText, valueString: a.valueString,
90
+ doubleValue: a.doubleValue, longValue: a.longValue, booleanValue: a.booleanValue,
91
+ timeValue: a.timeValue, entityValueUuid: a.entityValueUuid, agentValueUuid: a.agentValueUuid,
92
+ goodValueUuid: a.goodValueUuid, placeValueUuid: a.placeValueUuid, consignmentValueUuid: a.consignmentValueUuid,
93
+ contractValueUuid: a.contractValueUuid, projectValueUuid: a.projectValueUuid, employeeValueUuid: a.employeeValueUuid,
94
+ goodUuid: a.goodUuid) {
95
+
96
+ xml.accountUuid_ a.accountUuid
97
+ xml.accountId_ a.accountId
98
+ xml.uuid_ a.uuid
99
+ xml.groupUuid_ a.groupUuid
100
+ xml.deleted_ a.deleted
101
+
102
+ a.to_a(:file) do |f|
103
+ xml.file(name: f.name, created: f.created, filename: f.filename, miniatureUuid: f.miniatureUuid) {
104
+
105
+ xml.accountUuid_ f.accountUuid
106
+ xml.accountId_ f.accountId
107
+ xml.uuid_ f.uuid
108
+ xml.groupUuid_ f.groupUuid
109
+ xml.deleted_ f.deleted
110
+ xml.code_ f.code
111
+ xml.externalcode_ f.externalcode
112
+ xml.description_ f.description
113
+ xml.contents_ f.contents
114
+ }
115
+ end
116
+ }
117
+ end
118
+ }
119
+ end
120
+ }
121
+ }
122
+ end
123
+
124
+ xml.demandsUuid {
125
+ demandsUuid.to_a(:demandRef).each do |r|
126
+ xml.demandRef_ r
127
+ end
128
+ } if demandsUuid.present?
129
+
130
+ xml.paymentsUuid {
131
+ paymentsUuid.to_a(:demandRef).each do |r|
132
+ xml.financeInRef_ r
133
+ end
134
+ } if paymentsUuid.present?
135
+ }
@@ -1,3 +1,3 @@
1
1
  module MoySklad
2
- VERSION = '1.0.0.beta7'
2
+ VERSION = '1.0.0.beta8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moy_sklad
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta7
4
+ version: 1.0.0.beta8
5
5
  platform: ruby
6
6
  authors:
7
7
  - uno4ki
@@ -149,6 +149,7 @@ files:
149
149
  - lib/moy_sklad/model/demand.rb
150
150
  - lib/moy_sklad/model/good.rb
151
151
  - lib/moy_sklad/model/good_folder.rb
152
+ - lib/moy_sklad/model/invoice_out.rb
152
153
  - lib/moy_sklad/model/payment_in.rb
153
154
  - lib/moy_sklad/model/supply.rb
154
155
  - lib/moy_sklad/model/templates/cash_in.builder
@@ -158,6 +159,7 @@ files:
158
159
  - lib/moy_sklad/model/templates/demand.builder
159
160
  - lib/moy_sklad/model/templates/good.builder
160
161
  - lib/moy_sklad/model/templates/good_folder.builder
162
+ - lib/moy_sklad/model/templates/invoice_out.builder
161
163
  - lib/moy_sklad/model/templates/payment_in.builder
162
164
  - lib/moy_sklad/model/templates/supply.builder
163
165
  - lib/moy_sklad/nokogiri/document.rb