Post by afwollis » Fri Mar 11, 2011 9:27 pm

Hi guys,
so you wanna comments in "oscomm_invoice" ?
I will take a look on it, probably this evening or tomorrow.

thanks for your interest :)

Русское коммьюнити разработчиков OpenCart - myopencart.ru

some useful mods:
[Released] Orders and Comments AT-A-GLANCE, [Released] Prof. Invoice and Packingslip, [Released] Recently viewed

My commercial modules: [W]ebme Compare Products, [W]ebme Bought With This


Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by afwollis » Sun Mar 13, 2011 5:01 am

customer comments available in the osc_invoice template as

Code: Select all

$order["comment"]
Let see what we need to do to add "customer comments" into osc_invoice, lets say, before our "yellow line":
1. open

Code: Select all

admin/view/template/sale/osc_order_invoice.tpl
2. add this code

Code: Select all

		<!-- order - comments - start //-->
		<?php if ($order["comment"]) { ?>
		<tr>
			<td>
				<table width="100%" border="1" cellpadding="2" cellspacing="0">
					<tbody>
						<tr class="dataTableRow">
							<td><?php echo $order["comment"]; ?></td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<?php } ?>
		<tr>
			<td><img src="view/osc_invoice/pixel_trans.gif" alt="" width="1" border="0" height="5"></td>
		</tr>
		<!-- order - comments - end //-->
before this one

Code: Select all

		<tr>
			<td>
				<table width="100%" border="0" cellpadding="2" cellspacing="0">
					<tbody>
						<tr>
							<td class="main-payment2"><?php echo $entry_yellow_line; ?></td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
"admin comments" can be simply added BUT not available now because there is NO "common" way to put into invoice right that comment(s) which you need.

Русское коммьюнити разработчиков OpenCart - myopencart.ru

some useful mods:
[Released] Orders and Comments AT-A-GLANCE, [Released] Prof. Invoice and Packingslip, [Released] Recently viewed

My commercial modules: [W]ebme Compare Products, [W]ebme Bought With This


Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by FTW » Sun Mar 13, 2011 7:41 am

ok so this code is only for customer comment right?

admin comments have to be added manually?

FTW
Newbie

Posts

Joined
Sat Nov 06, 2010 11:27 am

Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by MarkFIN » Wed Mar 16, 2011 5:23 pm

"admin comments" can be simply added BUT not available now because there is NO "common" way to put into invoice right that comment(s) which you need.
Dear Sir,
Thanks! this is great but not for me.
If admin comment is simply - can you tell it?
All admin comments is OK for me.
Thank you !!!

Newbie

Posts

Joined
Tue Mar 08, 2011 4:56 pm

Post by afwollis » Sat Mar 19, 2011 11:36 am

MarkFIN,
open your

Code: Select all

admin/controller/sale/order.php
find

Code: Select all

	/* webme - osCommerce Invoice - mod - end */
scroll UP a bit.
replace

Code: Select all

				$this->data['orders'][] = array(
					'order_id'	       	=> $order_id,
					'invoice_id'       	=> $invoice_id,
					'invoice_date'       	=> $invoice_date,
					'date_added'       	=> date($this->language->get('date_format_short'), strtotime($order_info['date_added'])),
					'store_name'       	=> $order_info['store_name'],
					'store_url'        	=> rtrim($order_info['store_url'], '/'),
					'address'          	=> nl2br($this->config->get('config_address')),
					'telephone'        	=> $this->config->get('config_telephone'),
					'fax'              	=> $this->config->get('config_fax'),
					'email'            	=> $this->config->get('config_email'),
					'shipping_address' 	=> $shipping_address,
					'payment_address'  	=> $payment_address,
					'shipping_method'  	=> $order_info['shipping_method'],
					'payment_method'  	=> $order_info['payment_method'],
					'customer_email'   	=> $order_info['email'],
					'ip'   				=> $order_info['ip'],
					'customer_telephone'=> $order_info['telephone'],
					'comment'   	  	=> $order_info['comment'],
					'product'          	=> $product_data,
					'total'            	=> $total_data
				);
with

Code: Select all

				/* order - admin_comments - start */
				$histories = array();
				$order_histories = $this->model_sale_order->getOrderHistory($this->request->get['order_id']);
				
				foreach ($order_histories as $order_history) {
					if (!empty($order_history['comment'])) {
						$histories[] = array(
							'date_added' => date($this->language->get('date_format_short'), strtotime($order_history['date_added'])),
							'status'     => $order_history['status'],
							'comment'    => nl2br($order_history['comment']),
							'notify'     => $order_history['notify'] ? $this->language->get('text_yes') : $this->language->get('text_no')
						);
					}
				}
				/* order - admin_comments - end */
				
				$this->data['orders'][] = array(
					'order_id'	       	=> $order_id,
					'invoice_id'       	=> $invoice_id,
					'invoice_date'       	=> $invoice_date,
					'date_added'       	=> date($this->language->get('date_format_short'), strtotime($order_info['date_added'])),
					'store_name'       	=> $order_info['store_name'],
					'store_url'        	=> rtrim($order_info['store_url'], '/'),
					'address'          	=> nl2br($this->config->get('config_address')),
					'telephone'        	=> $this->config->get('config_telephone'),
					'fax'              	=> $this->config->get('config_fax'),
					'email'            	=> $this->config->get('config_email'),
					'shipping_address' 	=> $shipping_address,
					'payment_address'  	=> $payment_address,
					'shipping_method'  	=> $order_info['shipping_method'],
					'payment_method'  	=> $order_info['payment_method'],
					'customer_email'   	=> $order_info['email'],
					'ip'   				=> $order_info['ip'],
					'customer_telephone'=> $order_info['telephone'],
					'comment'   	  	=> $order_info['comment'],
					'product'          	=> $product_data,
					'total'            	=> $total_data,
					'history'		=> $histories
				);
then open your

Code: Select all

admin/view/template/sale/osc_order_invoice.tpl
before this code

Code: Select all

		<tr>
			<td>
				<table width="100%" border="0" cellpadding="2" cellspacing="0">
					<tbody>
						<tr>
							<td class="main-payment2"><?php echo $entry_yellow_line; ?></td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
add next one

Code: Select all

		<!-- order - admin_comments - start //-->
		<?php if ($order["history"]) { ?>
		<tr>
			<td>
				<table width="100%" border="1" cellpadding="2" cellspacing="0">
					<tbody>
						<?php foreach($order["history"] as $order_history) { ?>
						<tr class="main-payment">
							<td><?php echo $order_history["comment"]; ?></td>
						</tr>
						<?php } ?>
					</tbody>
				</table>
			</td>
		</tr>
		<?php } ?>
		<tr>
			<td><img src="view/osc_invoice/pixel_trans.gif" alt="" width="1" border="0" height="5"></td>
		</tr>
		<!-- order - admin_comments - end //-->
thats all :)


FTW, you will need small changes to last code to put admin-comments into "yellow line".
replace this code

Code: Select all

		<tr>
			<td>
				<table width="100%" border="0" cellpadding="2" cellspacing="0">
					<tbody>
						<tr>
							<td class="main-payment2"><?php echo $entry_yellow_line; ?></td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td><img src="view/osc_invoice/pixel_trans.gif" alt="" width="1" border="0" height="5"></td>
		</tr>
with this one

Code: Select all

		<!-- order - admin_comments - start //-->
		<?php if ($order["history"]) { ?>
		<tr>
			<td>
				<table width="100%" border="1" cellpadding="2" cellspacing="0">
					<tbody>
						<?php foreach($order["history"] as $order_history) { ?>
						<tr class="main-payment">
							<td class="main-payment2"><?php echo $order_history["comment"]; ?></td>
						</tr>
						<?php } ?>
					</tbody>
				</table>
			</td>
		</tr>
		<?php } ?>
		<tr>
			<td><img src="view/osc_invoice/pixel_trans.gif" alt="" width="1" border="0" height="5"></td>
		</tr>
		<!-- order - admin_comments - end //-->
questions, comments, etc...

Русское коммьюнити разработчиков OpenCart - myopencart.ru

some useful mods:
[Released] Orders and Comments AT-A-GLANCE, [Released] Prof. Invoice and Packingslip, [Released] Recently viewed

My commercial modules: [W]ebme Compare Products, [W]ebme Bought With This


Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by rocketero » Sat Mar 19, 2011 11:26 pm

why did you repeat the same staff after FTW (which I have not idea what it is), under and on top of that word the code seems to be the same, first u said place before that code, then later you said to replace it with something else. so at the end what is it ?

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by celestial » Sun Mar 20, 2011 2:48 am

One is outside yellow line and the other is inside yellow line, 2 different steps

Celestial - Martín Abel Rosales
WhatsApp: 50671482211
Email: martinrosales2012@hotmail.com
Skype: martin.abel.rosales
San José , Costa Rica


User avatar
Expert Member

Posts

Joined
Sat Mar 20, 2010 4:19 am
Location - Costa Rica

Post by rocketero » Sun Mar 20, 2011 5:45 am

celestial wrote:One is outside yellow line and the other is inside yellow line, 2 different steps
I still don't see how to do the second part.
I did the necessary changes to admin/controller/sale/order.php by adding the code between the
/* order - admin_comments - start */
/* order - admin_comments - end */
(adding at the end: 'history' => $histories AFTER 'total' => $total_data,)

OK, that file is easy to understand those changes.

But then comes along admin/view/template/sale/osc_order_invoice.tpl
the first two codes boxes are easy to apply, just add the code in the second box before the occurrence of the first box.

But the las two code boxes I see them hard to apply as the code they refer to looks most the same to the previous 2 code boxes. I see only one line referring to "$entry_yellow_line" and not two.

I might have difficulty understanding, have not much knowledge of php coding

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by afwollis » Mon Mar 21, 2011 11:28 am

celestial, thanks =)

rocketero, dont panic ;)
you have to decide - are you gonna use admin-comments inside "yellow line", or left that "yellow line" for other static staff (like bank info or so) and use admin-comments in separate "grey-block".

1) to add admin-comments within the "grey-block":
follow the first part (all above "thats all :)" phrase) of instructions.

2) to add admin-comments within the "yellow-line-block":
follow the first part (all above "thats all :)" phrase) of instructions EXCEPT last changes in template file.
and then apply changes described after
FTW, you will need small changes to last code to put admin-comments into "yellow line".

Русское коммьюнити разработчиков OpenCart - myopencart.ru

some useful mods:
[Released] Orders and Comments AT-A-GLANCE, [Released] Prof. Invoice and Packingslip, [Released] Recently viewed

My commercial modules: [W]ebme Compare Products, [W]ebme Bought With This


Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by Thegge » Tue Mar 22, 2011 2:44 am

Hi,

I installed it an works beautifully! except... generating an invoice number and then clicking on osCommerce invoice (or print invoice for that matter) seems to not display the invoice number.

Als when I leave and return to the order, the invoice number is gone and the button generate invoice number is back instead.

I THINK it has more to do with a CHMOD issue than an osCommerce issue. Anyone can help me out?

Newbie

Posts

Joined
Wed Feb 09, 2011 1:37 am

Post by i2Paq » Tue Mar 22, 2011 3:02 am

What version of OpenCart?

If it is 1.4.9.4 I think this modification is incompatible due to the change of the Invoice-number way of working.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Thegge » Tue Mar 22, 2011 3:04 am

i2Paq wrote:What version of OpenCart?

If it is 1.4.9.4 I think this modification is incompatible due to the change of the Invoice-number way of working.

Sorry, forgot to mention: Version 1.4.9.3

Newbie

Posts

Joined
Wed Feb 09, 2011 1:37 am

Post by i2Paq » Tue Mar 22, 2011 4:29 am

Thegge wrote:
i2Paq wrote:What version of OpenCart?

If it is 1.4.9.4 I think this modification is incompatible due to the change of the Invoice-number way of working.
Sorry, forgot to mention: Version 1.4.9.3
Then it should work.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by afwollis » Tue Mar 22, 2011 4:41 am

Als when I leave and return to the order, the invoice number is gone and the button generate invoice number is back instead.
you have some problems with ajax.
you have to check the browser's log console to see if there any errors appears when you clicking "Generate" button.
I THINK it has more to do with a CHMOD issue than an OS Commerce issue. Anyone can help me out?
please use "osc" lower case abbreviation (or "osc_invoice" or "osc invoice") instead of "OS Commerce" in any future posts, because it could confuse other users.

Русское коммьюнити разработчиков OpenCart - myopencart.ru

some useful mods:
[Released] Orders and Comments AT-A-GLANCE, [Released] Prof. Invoice and Packingslip, [Released] Recently viewed

My commercial modules: [W]ebme Compare Products, [W]ebme Bought With This


Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by Thegge » Tue Mar 22, 2011 5:12 am

Alright, found the problem!

I set the start count for the invoices to 000 and seems it does not accept a 0.
Prefix was 2011 and then 000 for start, but it does not work.
Changed it to 0001 and now shows 20111.

Leaves the zeroes out, but at least it works!

Newbie

Posts

Joined
Wed Feb 09, 2011 1:37 am

Post by Tiger1937 » Tue Mar 22, 2011 11:59 pm

Are there any plans to make Invoices work with 1.4.9.4 ??

Packing Slips seem fine, installed and running ;-)

New member

Posts

Joined
Fri Mar 05, 2010 7:42 pm

Post by rocketero » Wed Mar 23, 2011 3:55 am

When I press on the button "SHIPPING RECEIPT", I get the receipt ok, but at the top of the page I see this message:

Code: Select all

Notice: Undefined index: history in /home2/MyWebsite/public_html/admin/view/template/sale/osc_order_invoice.tpl on line 184
I did placed all the code poted here in the thread in this file /admin/view/template/sale/osc_order_invoice.tpl , I checked it twice.

so I don't understand is that 'history' undefined index? what does index means, usually I see 'Undefined variable' but this is different.

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by afwollis » Wed Mar 23, 2011 8:21 am

Tiger1937, yeah - when I will have some free time to download and check OC_1.4.9.4 =)

rocketero, backup your current template file

Code: Select all

/home2/MyWebsite/public_html/admin/view/template/sale/osc_order_invoice.tpl
and then replace it with attached one in archive (it is my current tpl-file)...
???

Attachments


Русское коммьюнити разработчиков OpenCart - myopencart.ru

some useful mods:
[Released] Orders and Comments AT-A-GLANCE, [Released] Prof. Invoice and Packingslip, [Released] Recently viewed

My commercial modules: [W]ebme Compare Products, [W]ebme Bought With This


Active Member

Posts

Joined
Tue Jan 11, 2011 5:41 am
Location - Ukraine

Post by rocketero » Wed Mar 23, 2011 12:54 pm

I replace my /admin/view/template/sale/osc_order-invoice.tpl with yours, and now I get more notices, when I press print shipping invoice or print payment I get all these:

For Print Shipping Invoice, I get now these 3 Notices in the same page:, the url ends on:
/admin/index.php?route=sale/order/osc_invoice&token=3cc546b95faee48ff249719cf5c3384e

Code: Select all

Undefined index: history in /home2/MYWEBSITE/public_html/admin/view/template/sale/osc_order_invoice.tpl on line 253

Code: Select all

Notice: Undefined variable: column_sku in /home2/MYWEBSITE/public_html/admin/view/template/sale/osc_order_invoice.tpl on line 189

Code: Select all

Notice: Undefined index: sku in /home2/MYWEBSITE/public_html/admin/view/template/sale/osc_order_invoice.tpl on line 204

for the other button, print invoice, the url ends on:
/admin/index.php?route=sale/order/invoice&token=3cc546b95faee48ff249719cf5c3384e

Code: Select all

Notice: Undefined index: order_id in /home2/MYWEBSITE/public_html/admin/controller/sale/order.php on line 928
=========================
Update: After taking off this osc_order_invoice.tpl and replacing it by the privious osc_order_invoice.tpl that I had before any changes about this whole issue 'web admin comments', Now the invoices and shipping receipts show fine with no Notices at all. And to be honest I don't even see that did any impact to what I was looking at once I clicked on Sales / Orders in backoffice.
Last edited by rocketero on Sun Mar 27, 2011 3:54 pm, edited 1 time in total.

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm
Who is online

Users browsing this forum: No registered users and 33 guests