diff --git a/server/integration_tests/abacus_sftp/test_abacus_sftp.py b/server/integration_tests/abacus_sftp/test_abacus_sftp.py index 77178ef0..1a173b5f 100644 --- a/server/integration_tests/abacus_sftp/test_abacus_sftp.py +++ b/server/integration_tests/abacus_sftp/test_abacus_sftp.py @@ -171,11 +171,6 @@ def test_upload_abacus_xml(setup_abacus_env): order_filepath = os.path.join( tmppath, "order/myVBV_orde_20240215083312_60000012_6000000124.xml" ) - assert os.path.exists(order_filepath) - with open(order_filepath) as order_file: - order_content = order_file.read() - assert ( - "24021508331287484" - in order_content - ) - assert "60000012" in order_content + + # it should not upload the order file again + assert not os.path.exists(order_filepath) diff --git a/server/vbv_lernwelt/shop/invoice/abacus.py b/server/vbv_lernwelt/shop/invoice/abacus.py index 6aaed41e..a60b0dd2 100644 --- a/server/vbv_lernwelt/shop/invoice/abacus.py +++ b/server/vbv_lernwelt/shop/invoice/abacus.py @@ -52,9 +52,11 @@ def abacus_ssh_upload(checkout_information: CheckoutInformation): abacus_ssh_upload_invoice( customer_xml_filename, customer_xml_content, folder="debitor" ) - abacus_ssh_upload_invoice( - invoice_xml_filename, invoice_xml_content, folder="order" - ) + + if not checkout_information.abacus_ssh_upload_done: + abacus_ssh_upload_invoice( + invoice_xml_filename, invoice_xml_content, folder="order" + ) checkout_information.abacus_ssh_upload_done = True checkout_information.invoice_transmitted_at = timezone.now()