--- store.module.old 2007-01-02 11:14:40.000000000 +0100
+++ store.module 2007-01-03 18:01:54.000000000 +0100
@@ -251,7 +251,7 @@ function store_ec_settings() {
the bottom of the product view which will allow the user select the
quantity and other information.'),
);
-
+
$form['product_cart_is_destination'] = array(
'#type' => 'checkbox',
'#title' => t('User is directed to the shopping cart after adding item.'),
@@ -260,7 +260,58 @@ function store_ec_settings() {
on the product page and a message will alert them that the item has been added
to their cart.'),
);
-
+
+ // Begin invoice settings
+ $form['invoice'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Invoice settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE
+ );
+ $form['invoice']['invoice_our__no'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Your vat no'),
+ '#default_value' => variable_get('invoice_our_vat_no', 0),
+ '#size' => 40,
+ '#maxlength' => 180,
+ );
+ $form['invoice']['invoice_bank'] = array(
+ '#type' => 'textfield',
+ '#title' => t('The name of your bank'),
+ '#default_value' => variable_get('invoice_bank', 0),
+ '#size' => 40,
+ '#maxlength' => 180,
+ );
+ $form['invoice']['invoice_bank_account_no'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Bank account no'),
+ '#default_value' => variable_get('invoice_bank_account_no', 0),
+ '#size' => 40,
+ '#maxlength' => 180,
+ );
+ $form['invoice']['invoice_swift_code'] = array(
+ '#type' => 'textfield',
+ '#title' => t('SWIFT code'),
+ '#default_value' => variable_get('invoice_swift_code', 0),
+ '#size' => 40,
+ '#maxlength' => 180,
+ );
+ $form['invoice']['invoice_prefered_currency'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Your prefered currency'),
+ '#default_value' => variable_get('invoice_prefered_currency', 'USD'),
+ '#size' => 40,
+ '#maxlength' => 180,
+ );
+ $form['payment_default_credit_time'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Default credit'),
+ '#description' => t('The default days of credit you want to offer your customers'),
+ '#default_value' => variable_get('payment_default_credit_time', 8),
+ '#size' => 40,
+ '#maxlength' => 180,
+ );
+
return $form;
}
@@ -307,13 +358,16 @@ function theme_store_invoice($txn, $prin
$header = array();
$row = array();
+ $date_type = 'custom';
+ $custom_type = 'd.m.Y';
+ $custom_type_payment = 'd.m.Y';
if (empty($txn->mail) && $txn->uid > 0) {
$txn->mail = db_result(db_query('SELECT mail FROM {users} WHERE uid = %d', $txn->uid));
}
if ($txn->items) {
- $header = array(t('Quantity'), t('Item'), t('Price'));
+ $header = array(t('SKU'), t('Quantity'), t('Unit'), array('data' => t('Item'), 'align' => 'left'), t('Price'), t('%'), t('Amount'));
$shippable = FALSE;
foreach ($txn->items as $p) {
@@ -335,47 +389,104 @@ function theme_store_invoice($txn, $prin
}
}
- $row[] = array(array('data' => $p->qty, 'align' => 'center', 'valign' => 'top'), ''. check_plain($p->title). ' '. (($prod->sku != '') ? "[". check_plain($prod->sku) ."]" : ''). '
'. $details, array('data' => payment_format($price), 'valign' => 'top'));
+ $row[] = array(array('data' => (($prod->sku != '') ? check_plain($prod->sku) : check_plain($prod->nid)), 'width' => '81', 'align' => 'center', 'valign' => 'top'), array('data' => $p->qty, 'align' => 'center', 'valign' => 'top', 'width' => '40'), array('data' => 'stk.', 'align' => 'center', 'valign' => 'top', 'width' => '40'), array('data' => check_plain($p->title), 'align' => 'left', 'valign' => 'top', 'width' => '378'), array('data' => number_format($price,2, variable_get('payment_decimalsign', ','), variable_get('payment_digisign', '.')), 'valign' => 'top', 'width' => '75', 'align' => 'right'), array('data' => number_format(0.00,2, variable_get('payment_decimalsign', ','), variable_get('payment_digisign', '.')), 'align' => 'right', 'width' => '40', 'valign' => 'top'), array('data' => number_format($price*$p->qty,2, variable_get('payment_decimalsign', ','), variable_get('payment_digisign', '.')), 'align' => 'right', 'valign' => 'top', 'width' => '96'));
}
if (is_array($txn->misc)) {
foreach ($txn->misc as $misc) {
if (!$misc->seen) {
- $row[] = array(array('data' => t("{$misc->description}: %price", array('%price' => payment_format($misc->price))), 'colspan' => 3, 'align' => 'right'));
+ $row[] = array(array('colspan' => 3), array('data' => $misc->description, 'valign' => 'top'), array('data' => number_format($misc->price,2, variable_get('payment_decimalsign', ','), variable_get('payment_digisign', '.')), 'align' => 'right', 'valign' => 'top'), array('data' => number_format(0.00,2, variable_get('payment_decimalsign', ','), variable_get('payment_digisign', '.')), 'align' => 'right', 'valign' => 'top'), array('data' => number_format($misc->price,2, variable_get('payment_decimalsign', ','), variable_get('payment_digisign', '.')), 'align' => 'right', 'valign' => 'top'));
}
}
}
- $row[] = array(array('data' => '
| $shipping_label | -$billing_label | ++ $billing_to + | +
+ + $transaction_type ++ $creation_date + $transaction_id + $customer_id + $payment_date + |
|---|---|---|---|
| $shipping_to | -$billing_to | ++ $EAN_no + | |
$shipping_method_label $shipping_method
-$email_label $txn->mail
- -|
+ $payment_terms_label
+ $delivery_terms_label + $currency_label + $customervatno_label + $ourvatno_label + |
+
+ $payment_terms
+ + $delivery_terms + + $currency + + + $ourvatno + |
+
+ $payable_to_label
+ + + $bank + + $bank_account + + $swift_code + |
+