When on an order page, the 'Create an invoice' button shows an empty page with this error:

Notice: Trying to get property of non-object in erpal_reports_create_money_output() (line 80 of /home/office/public_html/profiles/erpal_platform/modules/erpal/erpal_reports/erpal_reports.rules.inc).
and
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_output_unit_target_id' cannot be null: INSERT INTO {field_data_field_output_unit} (entity_type, entity_id, revision_id, bundle, delta, language, field_output_unit_value, field_output_unit_target_id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => erpal_output [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => revenue [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 184.5 [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 514 of /home/office/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
CommentFileSizeAuthor
#5 version.png6.39 KBYuri
#5 error.jpg52.05 KBYuri
#5 orderpage1.jpg53.71 KBYuri
#13 Invoice-from-order.png63.06 KBchoy
#13 Order-1.png46.65 KBchoy

Comments

Yuri created an issue. See original summary.

choy’s picture

I cannot reproduce your error on my erpal platform installations.
Please have a look at your configuration. Your error don't seemed to be linked to erpal platform

Yuri’s picture

What configuration to you suggest I check?
And this is a clean install of the latest dev version of ERPAL Platform. Nothing added or removed to the installation.

choy’s picture

you say you are at the url */invoice/add&destination=invoices
then you hit a button with the url *//admin/commerce/orders/add/commerce_order?render=references-dialog

a) this button doen't exist at the named url !
b) the url */admin/commerce/orders/add/commerce_order?render=references-dialog doesn't exist and isn't defined in the erpal platform default installation - only admin/commerce/orders/add/ but that url you won't get from the page */invoice/add&destination=invoices

with other words, I don't what and how you modified the default erpal platform installation, but you did it deeply wrong ! - Have a look at you dblog - maybe you'll find there an answer - but again I am 100% sure this mistake is yours and not a bug of the distribution

Yuri’s picture

StatusFileSize
new6.39 KB
new52.05 KB
new53.71 KB

No, I did not add remove or change anything to the ERPAL clean installation.

version

orderpage

error

choy’s picture

here again - your error is not reproducable. Please check your installation! There is something wrong with.

andrewsizz’s picture

Hey Yuri
Thanks for all your issues, I will check it tomorrow, and will try to fix or answer. Thanks for your time guys.

Yuri’s picture

Yuri’s picture

Issue summary: View changes
Yuri’s picture

Title: cannot create order from invoice » cannot create invoice from order
Issue summary: View changes
Yuri’s picture

Issue summary: View changes
Yuri’s picture

@ChoY I have reinstalled ERPAL Platform very carfully again, and the same error messages that I have posted today and yesterday are still appearing. So I'm quite sure that this is not an installation error of my side. Besides, I never had installation issues with my server using other Drupal distributions.

choy’s picture

StatusFileSize
new46.65 KB
new63.06 KB

To me your error looks like that your database wasn't completely created during the installation.
A PDOExeption: SQLSTATE message is typical for a missing or a wrong configured table in a database.

Attached I send you my screenshots when oping a quote an hitting the button create an "invoice"
The following message in green should look like mine (see second screenshot)

So to me there is definitely a mistake in your installation!
How do yo install the distribution? Do you get any error message during installation or afterwards?
Have you ever tried to run a cache clear? Dp you work with drush - what happens when you run $: drush cc all ?

Harsikesa’s picture

Hi,

I can reproduce the issue. It is caused by missing measure unit. The trigger is, when you install erpal you choose different currency than the default currency available (Dollar & Euro or usd, eur). The solution is add your current currency via this link: /admin/structure/units-measure/money/units-unit

Click on the add unit measurement link, and make the machine name your currency code.

Hope this help.

  • AndrewsizZ committed 9da5890 on 7.x-3.x
    Issue #2807173 by Yuri, ChoY, AndrewsizZ, Harsikesa: cannot create...
andrewsizz’s picture

Status: Active » Fixed

Thanks Guys a lot, yes issue really was that we don't have units for all other currencies, added code which will create automatically unit for selected currency on installation

andrewsizz’s picture

and yes, Harsikesa totally right, you also can add new unit on /admin/structure/units-measure/money/units-unit

Yuri’s picture

Correct I used another currency when installing. Adding the currency (and resaving any existing orders with the new currency) worked without the need to reinstall ERPAL Platform. Thanks guys, great work!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.