Changeset - 69efec188895
[Not reviewed]
0 1 0
Brett Smith - 6 years ago 2018-09-28 12:47:02
brettcsmith@brettcsmith.org
nbpy2017: Rename _RATE constants to _RBI.

This is a nonfunctional change that's just meant to better document
what these values actually represent.
1 file changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
import2ledger/importers/nbpy2017.py
Show inline comments
...
 
@@ -7,16 +7,16 @@ from .. import strparse
 

	
 
STATUS_INVOICED = 'Invoice'
 
STATUS_PAID = 'Payment'
 
STATUS_REFUNDED = 'Refund'
 

	
 
class Invoice2017:
 
    STANDARD_TICKET_RATE = decimal.Decimal('42.50')
 
    DISCOUNT_TICKET_RATE = STANDARD_TICKET_RATE / 2
 
    STANDARD_SHIRT_RATE = decimal.Decimal('25.50')
 
    DISCOUNT_SHIRT_RATE = STANDARD_SHIRT_RATE
 
    STANDARD_TICKET_RBI = decimal.Decimal('42.50')
 
    DISCOUNT_TICKET_RBI = STANDARD_TICKET_RBI / 2
 
    STANDARD_SHIRT_RBI = decimal.Decimal('25.50')
 
    DISCOUNT_SHIRT_RBI = STANDARD_SHIRT_RBI
 
    CURRENCY = 'USD'
 

	
 
    @classmethod
 
    def _elem_stripped_string(cls, elem):
 
        return ''.join(elem.stripped_strings)
 

	
...
 
@@ -75,27 +75,27 @@ class Invoice2017:
 
        recipient_cell = recipient_h.find_next_sibling('td')
 
        self.payee = next(recipient_cell.stripped_strings)
 

	
 
    def _read_invoice_items(self, table, first_row_text, rows_text):
 
        self.amount = decimal.Decimal(0)
 
        self.tickets_sold = decimal.Decimal(0)
 
        self.ticket_rate = self.STANDARD_TICKET_RATE
 
        self.ticket_rate = self.STANDARD_TICKET_RBI
 
        self.shirts_sold = decimal.Decimal(0)
 
        self.shirt_rate = self.STANDARD_SHIRT_RATE
 
        self.shirt_rate = self.STANDARD_SHIRT_RBI
 
        for description, qty, unit_price, total in rows_text:
 
            if qty is None:
 
                continue
 
            total = strparse.currency_decimal(total)
 
            self.amount += total
 
            if description.startswith('Ticket - '):
 
                if total > 0:
 
                    self.tickets_sold += int(qty)
 
            elif description.startswith('T-Shirt - '):
 
                self.shirts_sold += int(qty)
 
            elif description.startswith('Early Bird ('):
 
                self.ticket_rate = self.DISCOUNT_TICKET_RATE
 
                self.ticket_rate = self.DISCOUNT_TICKET_RBI
 

	
 
    def _read_invoice_activity(self, table, first_row_text, rows_text):
 
        self.actions = [{
 
            'date': self.invoice_date,
 
            'status': STATUS_INVOICED,
 
        }]
0 comments (0 inline, 0 general)