Changeset - 4df5748a4f5f
[Not reviewed]
0 3 0
Brett Smith - 6 years ago 2018-09-28 02:55:46
brettcsmith@brettcsmith.org
nbpy2017: Handle one-off "Sept." abbreviation in invoices.
3 files changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
import2ledger/importers/nbpy2017.py
Show inline comments
...
 
@@ -63,7 +63,7 @@ class Invoice2017:
 
        self.actions
 

	
 
    def _strpdate(self, s):
 
        date_s = strparse.rejoin_slice_words(s, slice(2), ',', 2)
 
        date_s = strparse.rejoin_slice_words(s, slice(2), ',', 2).replace('Sept.', 'Sep.')
 
        return strparse.date(date_s, '%b. %d, %Y')
 

	
 
    def _read_invoice_header(self, table, first_row_text, rows_text):
tests/data/imports.yml
Show inline comments
...
 
@@ -237,7 +237,7 @@
 
  expect:
 
    - payee: Python Person C
 
      ledger template: nbpy2017 invoice ledger entry
 
      date: !!python/object/apply:datetime.date [2017, 10, 5]
 
      date: !!python/object/apply:datetime.date [2017, 9, 5]
 
      amount: !!python/object/apply:decimal.Decimal ["55.00"]
 
      tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
 
      ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"]
...
 
@@ -245,11 +245,11 @@
 
      shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
 
      status: Invoice
 
      currency: USD
 
      invoice_date: !!python/object/apply:datetime.date [2017, 10, 5]
 
      invoice_date: !!python/object/apply:datetime.date [2017, 9, 5]
 
      invoice_id: "11"
 
    - payee: Python Person C
 
      ledger template: nbpy2017 payment ledger entry
 
      date: !!python/object/apply:datetime.date [2017, 10, 5]
 
      date: !!python/object/apply:datetime.date [2017, 9, 5]
 
      amount: !!python/object/apply:decimal.Decimal ["55.00"]
 
      tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
 
      ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"]
...
 
@@ -257,7 +257,7 @@
 
      shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
 
      status: Payment
 
      currency: USD
 
      invoice_date: !!python/object/apply:datetime.date [2017, 10, 5]
 
      invoice_date: !!python/object/apply:datetime.date [2017, 9, 5]
 
      payment_id: ch_daer0ahwoh9oDeiqu2eimoD7
 
      stripe_id: ch_daer0ahwoh9oDeiqu2eimoD7
 
      invoice_id: "11"
tests/data/nbpy2017c.html
Show inline comments
...
 
@@ -155,8 +155,8 @@
 
    <table class="table">
 
      <tr><th>Number</th><td> 11</td></tr>
 
      <tr><th>Status</th><td> Refunded</td></tr>
 
      <tr><th>Issue date</th><td> Oct. 5, 2017</td></tr>
 
        <tr><th>Due</th><td> Oct. 6, 2017, 9:09 p.m.</td></tr>
 
      <tr><th>Issue date</th><td> Sept. 5, 2017</td></tr>
 
        <tr><th>Due</th><td> Sept. 6, 2017, 9:09 p.m.</td></tr>
 
      <tr><th>Recipient</th><td> Python Person C<br />Anycountry</td></tr>
 
    </table>
 
  <div class="panel-body">
...
 
@@ -225,12 +225,12 @@
 
      <th>Amount</th>
 
    </tr>
 
      <tr>
 
        <td>Oct. 5, 2017, 9:14 p.m.</td>
 
        <td>Sept. 5, 2017, 9:14 p.m.</td>
 
        <td>Paid with Stripe reference: ch_daer0ahwoh9oDeiqu2eimoD7</td>
 
        <td>55.00</td>
 
      </tr>
 
      <tr>
 
        <td>Oct. 8, 2017, 3:20 p.m.</td>
 
        <td>Sept. 8, 2017, 3:20 p.m.</td>
 
        <td>Generated credit note 31</td>
 
        <td>-55.00</td>
 
      </tr>
0 comments (0 inline, 0 general)