Commit da602460 authored by Jérome Perrin's avatar Jérome Perrin

AccountingZuite_create*

  Respect allowed content types configuration when creating lines in setup
  
test_sale_invoice_transaction_create_reversal
test_purchase_invoice_transaction_create_reversal
  Update tests, reversal transactions are created with the same portal type
 


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13024 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69183210
...@@ -237,12 +237,12 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -237,12 +237,12 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertValue</td>\n
<td>field_my_source_section</td>\n <td>field_my_destination_section</td>\n
<td>organisation_module/my_organisation</td>\n <td>organisation_module/my_organisation</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertValue</td>\n <td>assertValue</td>\n
<td>field_my_destination_section_title</td>\n <td>field_my_source_section_title</td>\n
<td>Supplier</td>\n <td>Supplier</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
...@@ -252,22 +252,22 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -252,22 +252,22 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertTextPresent</td> <!-- this is the portal type. -->\n <td>assertTextPresent</td> <!-- this is the portal type. -->\n
<td>Accounting Transaction</td>\n <td>Purchase Invoice Transaction</td>\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>verifyValue</td>\n <td>verifyValue</td>\n
<td>subfield_field_my_start_date_year</td>\n <td>subfield_field_my_stop_date_year</td>\n
<td>2005</td>\n <td>2005</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>verifyValue</td>\n <td>verifyValue</td>\n
<td>subfield_field_my_start_date_month</td>\n <td>subfield_field_my_stop_date_month</td>\n
<td>01</td>\n <td>01</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>verifyValue</td>\n <td>verifyValue</td>\n
<td>subfield_field_my_start_date_day</td>\n <td>subfield_field_my_stop_date_day</td>\n
<td>01</td>\n <td>01</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
...@@ -298,32 +298,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -298,32 +298,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[3]/input</td>\n
<td>10.0</td> \n <td>10.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>0.0</td> \n <td>0.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[3]/input</td>\n
<td>1.0</td>\n <td>1.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[3]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n
<td>11.0</td>\n <td>11.0</td>\n
</tr>\n </tr>\n
<!-- }}} -->\n <!-- }}} -->\n
......
...@@ -254,7 +254,7 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -254,7 +254,7 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertTextPresent</td>\n <td>assertTextPresent</td>\n
<td>Accounting Transaction</td>\n <td>Sale Invoice Transaction</td><!-- This is the portal_type -->\n
<td></td>\n <td></td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
...@@ -300,32 +300,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n ...@@ -300,32 +300,32 @@ delivered. FIXME: we won\'t be able to delete the transaction later\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[3]/input</td>\n
<td>0.0</td> \n <td>0.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_0\']/td[4]/input</td>\n
<td>10.0</td> \n <td>10.0</td> \n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[3]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_1\']/td[4]/input</td>\n
<td>1.0</td>\n <td>1.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[3]/input</td>\n
<td>11.0</td>\n <td>11.0</td>\n
</tr>\n </tr>\n
<tr>\n <tr>\n
<td>assertFloatValue</td>\n <td>assertFloatValue</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[5]/input</td>\n <td>//tr[@id=\'listbox_data_line_2\']/td[4]/input</td>\n
<td>0.0</td>\n <td>0.0</td>\n
</tr>\n </tr>\n
<!-- }}} -->\n <!-- }}} -->\n
......
...@@ -209,15 +209,15 @@ for month in range(1, month_count + 1):\n ...@@ -209,15 +209,15 @@ for month in range(1, month_count + 1):\n
stop_date=default_date,\n stop_date=default_date,\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=-(amount * (1 + vat_rate)))\n quantity=-(amount * (1 + vat_rate)))\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
quantity=amount * vat_rate)\n quantity=amount * vat_rate)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
quantity=amount)\n quantity=amount)\n
...@@ -248,15 +248,15 @@ for month in range(1, month_count + 1):\n ...@@ -248,15 +248,15 @@ for month in range(1, month_count + 1):\n
stop_date=default_date,\n stop_date=default_date,\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
destination=getAccountByTitle(\'Payable\'),\n destination=getAccountByTitle(\'Payable\'),\n
quantity=-(amount * (1 + vat_rate)))\n quantity=-(amount * (1 + vat_rate)))\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
destination=getAccountByTitle(\'Refundable VAT 10%\'),\n destination=getAccountByTitle(\'Refundable VAT 10%\'),\n
quantity=amount * vat_rate)\n quantity=amount * vat_rate)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Purchase Invoice Transaction Line\',\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
destination=getAccountByTitle(\'Goods Purchase\'),\n destination=getAccountByTitle(\'Goods Purchase\'),\n
quantity=amount)\n quantity=amount)\n
...@@ -282,15 +282,15 @@ if add_draft_transactions:\n ...@@ -282,15 +282,15 @@ if add_draft_transactions:\n
stop_date=default_date,\n stop_date=default_date,\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=random.randint(300, 400),\n quantity=random.randint(300, 400),\n
immediate_reindex=immediate_reindex)\n immediate_reindex=immediate_reindex)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
quantity=random.randint(300, 400),\n quantity=random.randint(300, 400),\n
immediate_reindex=immediate_reindex)\n immediate_reindex=immediate_reindex)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
quantity=random.randint(300, 400),\n quantity=random.randint(300, 400),\n
immediate_reindex=immediate_reindex)\n immediate_reindex=immediate_reindex)\n
......
...@@ -146,21 +146,21 @@ for month in range(1, month_count + 1):\n ...@@ -146,21 +146,21 @@ for month in range(1, month_count + 1):\n
resource=euro_resource,\n resource=euro_resource,\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
)\n )\n
receivable_qty = -(amount * (1 + vat_rate)) \n receivable_qty = -(amount * (1 + vat_rate))\n
total_receivable_quantity += receivable_qty\n total_receivable_quantity += receivable_qty\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
destination=getAccountByTitle(\'Payable\'),\n destination=getAccountByTitle(\'Payable\'),\n
quantity=receivable_qty,\n quantity=receivable_qty,\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
)\n )\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
destination=getAccountByTitle(\'Refundable VAT 10%\'),\n destination=getAccountByTitle(\'Refundable VAT 10%\'),\n
quantity=amount * vat_rate,\n quantity=amount * vat_rate,\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
)\n )\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
destination=getAccountByTitle(\'Goods Purchase\'),\n destination=getAccountByTitle(\'Goods Purchase\'),\n
quantity=amount,\n quantity=amount,\n
......
...@@ -153,15 +153,15 @@ for month in range(1, month_count + 1):\n ...@@ -153,15 +153,15 @@ for month in range(1, month_count + 1):\n
stop_date=DateTime(year, month, day),\n stop_date=DateTime(year, month, day),\n
resource=euro_resource,\n resource=euro_resource,\n
)\n )\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
destination=getAccountByTitle(\'Payable\'),\n destination=getAccountByTitle(\'Payable\'),\n
quantity=-(amount * (1 + vat_rate)))\n quantity=-(amount * (1 + vat_rate)))\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Collected VAT 10%\'),\n source=getAccountByTitle(\'Collected VAT 10%\'),\n
destination=getAccountByTitle(\'Refundable VAT 10%\'),\n destination=getAccountByTitle(\'Refundable VAT 10%\'),\n
quantity=amount * vat_rate)\n quantity=amount * vat_rate)\n
tr.newContent(portal_type=\'Accounting Transaction Line\',\n tr.newContent(portal_type=\'Sale Invoice Transaction Line\',\n
source=getAccountByTitle(\'Goods Sales\'),\n source=getAccountByTitle(\'Goods Sales\'),\n
destination=getAccountByTitle(\'Goods Purchase\'),\n destination=getAccountByTitle(\'Goods Purchase\'),\n
quantity=amount)\n quantity=amount)\n
......
37 38
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment