Ejemplo n.º 1
0
Archivo: utils.py Proyecto: flackdl/abr
def get_html(request, bill_id):
    css = request.GET.get('css')
    client = get_qbo_client(get_callback_url(request))
    bill = Bill.get(int(bill_id), qb=client)
    bill = json.loads(bill.to_json())
    attach_prices(bill, client)
    single_print = request.GET.get('single_print', '')
    items = multiply_items(bill['Line'], single_print)
    context = {
        'rows': [
            items[i:i + settings.PRINT_LABEL_COLS]
            for i in range(0, len(items), settings.PRINT_LABEL_COLS)
        ],
        'css':
        css,
    }
    return render_to_string('labels.html', context).encode()
Ejemplo n.º 2
0
    def test_delete(self, delete_object):
        bill = Bill()
        bill.Id = 1
        bill.delete(qb=self.qb_client)

        self.assertTrue(delete_object.called)
Ejemplo n.º 3
0
    def test_delete_unsaved_exception(self):
        from quickbooks.exceptions import QuickbooksException

        bill = Bill()
        self.assertRaises(QuickbooksException, bill.delete, qb=self.qb_client)