Topic: adding delivery date for each item in invoice

hi every body
I am trying to add one more field in invoice with name (Delivery date) for each item in Sales Items ...As it was required by our company because we are delivering different items in different times ...
I have found many topics talking about  modifying  - sales/view/view_invoice.php and sales/includes/ui/sales_order_ui.inc files , and i have tried all that without success .... We are using last version 2.4.4

I will be appreciated for some help or advice

Re: adding delivery date for each item in invoice

That's fine to do it.

All you need to update fields in program and add one ! more field in database.

Sales order details table and
debtor trans details

Add a column for delivery date .

And then go to sales/includes/ui

Here sales_order_ui.inc file is there. Just find below functions

add_to_order. - pass one more parameter and do it.
display_order_summary
sales_order_item_controls

And now open sales/includes/cart_class.inc update the line_details class with one more field and for date and also pass it to add_to_order function here.


With in the read and write functions it calls some more db operational functions. Just update that to complete it
Sales order entry.php

Pass the date parameter to add to cart calling function

Re: adding delivery date for each item in invoice

Dear kvvaradha
I appreciate your feedback regarding my problem ..
and please forgive my weak knowledge in PHP
I have been trying all the last days following your guidance above but all what i get is blank page
when changing in functions you mentioned ..

If you can guide me in more details regarding what should i change in functions I really be appreciated

Re: adding delivery date for each item in invoice

You need to enable debugging mode  to see the issues. Not everyone can program without bugs or mistakes. so try with debugging mode and get us the issues, we can help you somehow.

Re: adding delivery date for each item in invoice

No need for extra field in any table.

Use the function get_customer_trans() in sales/includes/db/cust_trans_db.inc and use the trans_date field for the delivery date in your report. An example of the sql used in the said function is:

SET @TRANS_ID:=5;
SET @TRANS_TYPE=13; -- ST_CUSTDELIVERY

SELECT trans.*
      , ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total
      , cust.name AS DebtorName
      , cust.address
      , cust.curr_code
      , cust.tax_id
      , trans.prep_amount>0 AS prepaid
      , com.memo_
      , shippers.shipper_name
      , sales_types.sales_type
      , sales_types.tax_included
      , branch.*
      , cust.discount
      , tax_groups.name AS tax_group_name
      , tax_groups.id AS tax_group_id 
FROM 1_debtor_trans trans
     LEFT JOIN 1_comments com ON trans.type=com.type AND trans.trans_no=com.id
     LEFT JOIN 1_shippers shippers ON shippers.shipper_id=trans.ship_via
     , 1_debtors_master cust
     , 1_sales_types sales_types
     , 1_cust_branch branch
     , 1_tax_groups tax_groups
WHERE trans.trans_no=@TRANS_ID
  AND trans.type=@TRANS_TYPE
  AND trans.debtor_no=cust.debtor_no
  AND sales_types.id = trans.tpe
  AND branch.branch_code = trans.branch_code
  AND branch.tax_group_id = tax_groups.id