The Datepicker on the invoice form just uses the wrong format. I configured everything to fit German Date formats. It works for other Dates as i can see. Mut the Datepicker on the invocie form still uses english:

http://root.artwaves.de/sharex/2015-08-19_15-58-50.png

Comments

marcoka created an issue. See original summary.

marcoka’s picture

updated to the latest dev

http://root.artwaves.de/sharex/2015-08-23_23-20-10.png

Datefield is wrong (en). Left shows the correct date in german.

marcoka’s picture

note. it seems the pdf settings are not saved and defaults are always loaded.
http://root.artwaves.de/sharex/2015-08-25_10-38-30.png

the invoice page uses
function erpal_commerce_ui_commerce_order_view($order, $view_mode) { ... }

That is why the whole PDF settings dont work because it uses wrong variable_get names.

If i edit the PDF settings on the invoice page nothing is used. If i edit the PDF settings on the order page, this data appears.

marcoka’s picture

Title: Date Picker on Invoice Form » Invoice PDF settings never used.
Version: 7.x-3.0-alpha12 » 7.x-3.x-dev
Category: Support request » Bug report
Priority: Normal » Major
AndrewsizZ’s picture

Hey marcoka,
thank you for report, we will check. Patches always welcome.

marcoka’s picture

Need to make some Notes about variable setting names:

Settings Pages

http://dev.erpal-platform.de/admin/commerce/config/billy-order/pdf
calls:

function erpal_commerce_ui_pdf_admin_form($form, &$form_state) {

 $settings = variable_get('erpal_order_pdf_text_settings', array());

  $form['erpal_order_pdf_settings'] = array(
    '#tree' => TRUE,
    '#type' => 'fieldset',
    '#title' => t('PDF Text settings'),
  );
...

http://dev.erpal-platform.de/admin/commerce/config/billy-invoice/pdf?des...
calls:

function commerce_billy_pdf_admin_form($form, &$form_state) {

$settings = variable_get('commerce_billy_pdf_text_settings', array());

  $form['commerce_billy_pdf_settings'] = array(
    '#tree' => TRUE,
    '#type' => 'fieldset',
    '#title' => t('PDF Text settings'),
  );
.....

View Pages

http://dev.erpal-platform.de/order/3
calls:

function commerce_billy_pdf_commerce_order_view($order, $view_mode) {
  // Add content variables for the PDF generation.
  $settings = variable_get('commerce_billy_pdf_text_settings', array());
  $custom_date_format = !empty($settings['invoice_date_format']) ? $settings['invoice_date_format'] : 'Y-m-d';
  if ($view_mode == "pdf" || $view_mode == 'canceled') {
    $order->content['invoice_footer'] = array(
      '#markup' => isset($settings['invoice_footer']) ? $settings['invoice_footer'] : '',
    );
...

http://dev.erpal-platform.de/invoice/4
calls:

function commerce_billy_pdf_commerce_order_view($order, $view_mode) {
  // Add content variables for the PDF generation.
  $settings = variable_get('commerce_billy_pdf_text_settings', array());
  $custom_date_format = !empty($settings['invoice_date_format']) ? $settings['invoice_date_format'] : 'Y-m-d';
  if ($view_mode == "pdf" || $view_mode == 'canceled') {
    $order->content['invoice_footer'] = array(
...

it seems both admin/form pages have their own name for the settings
$settings = variable_get('erpal_order_pdf_text_settings', array());
$settings = variable_get('commerce_billy_pdf_text_settings', array());

BUT they share the same view function that loads
$settings = variable_get('commerce_billy_pdf_text_settings', array());

marcoka’s picture

it seems that the code just doesnt use the settings, it uses the address data.

function erpal_commerce_ui_commerce_order_view($order, $view_mode) { 
..
// Set quote/order footer.
      $order->content['order_footer'] = array(
        '#markup' => implode(', ', $address),
      );

      $order->content['invoice_footer'] = array(
        '#markup' => implode(', ', $address),
      );
..

for example if i replace this it will work. problem is that i am not sure how the logic works here.

   /*  $order->content['invoice_footer'] = array(
        '#markup' => implode(', ', $address),
      );*/

      $order->content['invoice_footer'] = array(
        '#markup' => $settings['order_footer'],
      );

what confuses me a bit is this code. it overrides $value so after the loop the last value of settings will be saved inside. what is the use ?

  foreach ($settings as &$value) {
    $value = token_replace($value, array('commerce-order' => $order));
  }

i think that maybe the values of $order->content are the right ones we should set? not sure
http://root.artwaves.de/sharex/2015-08-25_15-41-28.png

marcoka’s picture

Title: Invoice PDF settings never used. » Invoice/Order PDF settings for the Footer never used.
Yuri’s picture

Priority: Major » Normal