Lines 192-202
the attribute names the exposed REST api spec.
Link Here
|
192 |
=cut |
192 |
=cut |
193 |
|
193 |
|
194 |
sub _to_api { |
194 |
sub _to_api { |
195 |
|
|
|
196 |
my $vendor = shift; |
195 |
my $vendor = shift; |
197 |
|
196 |
|
198 |
#my $vendor = $vendor_param->TO_JSON; |
|
|
199 |
|
200 |
# Delete unused fields |
197 |
# Delete unused fields |
201 |
delete $vendor->{booksellerfax}; |
198 |
delete $vendor->{booksellerfax}; |
202 |
delete $vendor->{bookselleremail}; |
199 |
delete $vendor->{bookselleremail}; |
Lines 205-220
sub _to_api {
Link Here
|
205 |
delete $vendor->{othersupplier}; |
202 |
delete $vendor->{othersupplier}; |
206 |
|
203 |
|
207 |
# Rename changed fields |
204 |
# Rename changed fields |
208 |
$vendor->{list_currency} = $vendor->{listprice}; |
205 |
$vendor->{list_currency} = delete $vendor->{listprice}; |
209 |
delete $vendor->{listprice}; |
206 |
$vendor->{invoice_currency} = delete $vendor->{invoiceprice}; |
210 |
$vendor->{invoice_currency} = $vendor->{invoiceprice}; |
207 |
$vendor->{gst} = delete $vendor->{gstreg}; |
211 |
delete $vendor->{invoiceprice}; |
208 |
$vendor->{list_includes_gst} = delete $vendor->{listincgst}; |
212 |
$vendor->{gst} = $vendor->{gstreg}; |
209 |
$vendor->{invoice_includes_gst} = delete $vendor->{invoiceincgst}; |
213 |
delete $vendor->{gstreg}; |
|
|
214 |
$vendor->{list_includes_gst} = $vendor->{listincgst}; |
215 |
delete $vendor->{listincgst}; |
216 |
$vendor->{invoice_includes_gst} = $vendor->{invoiceincgst}; |
217 |
delete $vendor->{invoiceincgst}; |
218 |
|
210 |
|
219 |
return $vendor; |
211 |
return $vendor; |
220 |
} |
212 |
} |
Lines 227-247
attribute names.
Link Here
|
227 |
=cut |
219 |
=cut |
228 |
|
220 |
|
229 |
sub _to_model { |
221 |
sub _to_model { |
230 |
my $vendor_param = shift; |
222 |
my $vendor = shift; |
231 |
|
|
|
232 |
my $vendor = $vendor_param; |
233 |
|
223 |
|
234 |
# Rename back |
224 |
# Rename back |
235 |
$vendor->{listprice} = $vendor->{list_currency}; |
225 |
$vendor->{listprice} = delete $vendor->{list_currency}; |
236 |
delete $vendor->{list_currency}; |
226 |
$vendor->{invoiceprice} = delete $vendor->{invoice_currency}; |
237 |
$vendor->{invoiceprice} = $vendor->{invoice_currency}; |
227 |
$vendor->{gstreg} = delete $vendor->{gst}; |
238 |
delete $vendor->{invoice_currency}; |
228 |
$vendor->{listincgst} = delete $vendor->{list_includes_gst}; |
239 |
$vendor->{gstreg} = $vendor->{gst}; |
229 |
$vendor->{invoiceincgst} = delete $vendor->{invoice_includes_gst}; |
240 |
delete $vendor->{gst}; |
|
|
241 |
$vendor->{listincgst} = $vendor->{list_includes_gst}; |
242 |
delete $vendor->{list_includes_gst}; |
243 |
$vendor->{invoiceincgst} = $vendor->{invoice_includes_gst}; |
244 |
delete $vendor->{invoice_includes_gst}; |
245 |
|
230 |
|
246 |
return $vendor; |
231 |
return $vendor; |
247 |
} |
232 |
} |
248 |
- |
|
|