Comments

miro_dietiker’s picture

Only these document types make sense (for now):
10 Angebot
12 Bestellung
20 Rechnung

s_leu’s picture

Status: Active » Needs review
StatusFileSize
new1.88 KB

Ok i added a field on the settings form, a getter for the types and changed the output of the export to use the configured type. Default is still 20 (order confirmation).

Note that you have to set the document type option of your website configuration in WinBiz to "Standard" in order to get the imported documents with the type configured in Drupal.

miro_dietiker’s picture

Status: Needs review » Needs work

That note is fine, however it should be added to the settings description in the admin area.

s_leu’s picture

Status: Needs work » Needs review
StatusFileSize
new862 bytes
new2.01 KB
miro_dietiker’s picture

Status: Needs review » Needs work
+++ b/commerce_winbiz.moduleundefined
@@ -230,7 +230,7 @@ function commerce_winbiz_export_orders($oid_from, $oid_to) {
-  $data[2] = WINBIZ_DEFAULT_TYPE;

+++ b/commerce_winbiz.pages.incundefined
@@ -171,6 +171,14 @@ function commerce_winbiz_admin_settings_form($form, &$form_state) {
+    '#default_value' => variable_get('commerce_winbiz_document_type', 20),

It seems now the constant is no more used. Search for it and remove it. Or use it below in the settings...

+++ b/commerce_winbiz.pages.incundefined
@@ -171,6 +171,14 @@ function commerce_winbiz_admin_settings_form($form, &$form_state) {
+    '#description' => t('Determines what kind of document type will be used to create the imported document. Note that you have to set the document type in your WinBiz website configuration to "By default" in order to make this work.'),

WinBiz - Plz check how we defined to write it consistently...

s_leu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.18 KB
new2.2 KB
corvus_ch’s picture

Status: Needs review » Needs work
+++ b/commerce_winbiz.moduleundefined
@@ -6,7 +6,6 @@
-define('WINBIZ_DEFAULT_TYPE', '20');

Keept the constant and use it for the default when using variable get.

s_leu’s picture

Status: Needs work » Needs review
StatusFileSize
new2 KB
new2.06 KB

Ok here's the suggested change

corvus_ch’s picture

Code looks fine for me. I did not have testet the functionality though.

s_leu’s picture

The functionality was well tested by me and it's working fine.

miro_dietiker’s picture

Status: Needs review » Needs work
+++ b/commerce_winbiz.moduleundefined
@@ -503,3 +503,14 @@ function commerce_winbiz_get_payment_method_code($payment_method_id) {
+    WINBIZ_DEFAULT_TYPE => t('Order confirmation'),

No, here you need to use the plain value, not the constant!

s_leu’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB
miro_dietiker’s picture

Status: Needs review » Fixed

Added.

Status: Fixed » Closed (fixed)

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