Beispiel #1
0
 def write_csv(self, invoices):
     """
         Write the exported csv file to the request
     """
     exporter = InvoiceExport(self.request.config)
     writer = SageInvoiceCsvWriter()
     writer.set_prefix(self.request.config.get('invoice_prefix', ''))
     writer.set_datas(exporter.get_book_entries(invoices))
     write_file_to_request(self.request,
                           self.filename,
                           writer.render(),
                           headers="application/csv")
     self.record_exported(invoices)
     return self.request.response
Beispiel #2
0
 def write_csv(self, invoices):
     """
         Write the exported csv file to the request
     """
     exporter = InvoiceExport(self.request.config)
     writer = SageInvoiceCsvWriter()
     writer.set_prefix(self.request.config.get('invoice_prefix', ''))
     writer.set_datas(exporter.get_book_entries(invoices))
     write_file_to_request(
             self.request,
             self.filename,
             writer.render(),
             headers="application/csv")
     self.record_exported(invoices)
     return self.request.response
Beispiel #3
0
 def test_modules(self, config_request, app_config):
     config_request.config = app_config
     exporter = InvoiceExport(None, config_request)
     assert len(exporter.modules) == 3
     sage_factories = [SageFacturation, SageContribution, SageRGInterne]
     for fact in sage_factories:
         assert True in [
             isinstance(module, fact) for module in exporter.modules
         ]
Beispiel #4
0
 def test_modules(self):
     config = {
         'sage_contribution': '1',
         'sage_assurance': '1',
         'sage_cgscop': '0'
     }
     exporter = InvoiceExport(config)
     assert len(exporter.modules) == 3
     sage_factories = [SageFacturation, SageContribution, SageAssurance]
     for fact in sage_factories:
         assert True in [
             isinstance(module, fact) for module in exporter.modules
         ]