sw_fac 0.3.56 → 0.3.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84574e598775ba54312d593c9657fc84d703d5ac5466b411771df0f4d45b4803
4
- data.tar.gz: 7089b3ab0dbe3984cb750838b708a5cf4074663e9d7da5228df2aa62cb824811
3
+ metadata.gz: 2b42c257daa8d42e001986d905ffab338db35601a8ddc082815ce3a9000440d2
4
+ data.tar.gz: f513ba041875e90d46cbc9ca47e57a4f3d216e669fa814fadb5539677094e050
5
5
  SHA512:
6
- metadata.gz: 519b791710dd626a4295df217855757cbc37f3ed7e5c899dddfac935a0a1fffb10f912b182140883903c1df4d5bd3c8643d7a4e9f2addfecdeb06affe90fefe1
7
- data.tar.gz: 7b73a3a8d9b0b441a610135a75cf62c3f6ce7a7196c0eb7f980128a232a74d583a24d4be2d427a2a3aa109ad74026f1836f4dfa4523bb259bb864a574bb91bca
6
+ metadata.gz: 69ecc08be4f9d4f5c97199b964085f6574a571271806c0ef7ff7b428c72072ab805ace8f8e1641cab06383c0befeac7b95fb1ed97a2a24383e5839fe0ea82c8c
7
+ data.tar.gz: 2140988d0cd6d7a09a58e80cbc10224c7385ff87196b9aa35d39665be54a9a9535ab47f21206f67593ae9ecb2a2c5cb64154d92bfdc9e1fa5637b3fbf5c39425
@@ -9,9 +9,9 @@ module SwFac
9
9
  # venta_folio: '',
10
10
  # cp: '',
11
11
  # receptor_razon: 'Car zone',
12
- # receptor_rfc: 'XAXX010101000',
13
- # forma_pago: '01',
14
- # total: 100.00,
12
+ # receptor_rfc: 'XAXX010101000',
13
+ # forma_pago: '01',
14
+ # total: 100.00,
15
15
  # time: '',
16
16
  # modena: '',
17
17
  # line_items: [
@@ -23,15 +23,17 @@ module SwFac
23
23
  # }
24
24
 
25
25
  puts " Datos --------"
26
- puts "-- Total: #{params[:total]}"
26
+ puts "-- Total params: #{params[:total]}"
27
27
  puts "--- Line items: "
28
28
  params[:line_items].each do |line|
29
29
  puts "--- #{line[:monto]}"
30
- end
31
- puts "-- Suma de line_items: #{params[:line_items].inject(0) {|sum, x| sum + x[:monto].to_f.round(2) }}"
30
+ end
31
+ lines_total = params[:line_items].inject(0) {|sum, x| sum + x[:monto].to_f}
32
+
33
+ puts "-- Suma de line_items: #{lines_total}"
32
34
 
33
- if (params[:line_items].inject(0) {|sum, x| sum + x[:monto].to_f }) > params[:total].to_f.round(2)
34
- raise 'Error - la suma de los complementos de pago es mayor al total reportado'
35
+ if (lines_total > params[:total].to_f)
36
+ raise 'Error SW - la suma de los complementos de pago es mayor al total reportado'
35
37
  end
36
38
 
37
39
  uri = @production ? URI("#{SwFac::UrlProduction}cfdi33/stamp/customv1/b64") : URI("#{SwFac::UrlDev}cfdi33/stamp/customv1/b64")
@@ -1,3 +1,3 @@
1
1
  module SwFac
2
- VERSION = "0.3.56"
2
+ VERSION = "0.3.57"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sw_fac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.56
4
+ version: 0.3.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel Padilla
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-30 00:00:00.000000000 Z
11
+ date: 2020-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler