<?php
if (!empty($$class->sd_delivery_header_id)) {
// pa($sd_delivery_line_object);
 foreach ($sd_delivery_line_object as &$sd_delivery_lines) {
	if (!empty($sd_delivery_lines->sd_so_line_id)) {
	 $soa = new sd_so_all_v();
	 $soa_i = $soa->findBY_soLineId($sd_delivery_lines->sd_so_line_id);
	 $sd_delivery_lines->item_number = $soa_i->item_number;
	 $sd_delivery_lines->so_number = $soa_i->so_number;
	 $sd_delivery_lines->so_line_number = $soa_i->line_number;
//	 $sd_delivery_lines->shipped_quantity = $soa_i->shipped_quantity;
	 $sd_delivery_lines->ar_customer_id = $soa_i->ar_customer_id;
	 $sd_delivery_lines->ar_customer_number = $soa_i->customer_number;
	 $sd_delivery_lines->ar_customer_name = $soa_i->customer_name;
	 $sd_delivery_lines->ar_customer_site_id = $soa_i->ar_customer_site_id;
	 $sd_delivery_lines->ar_customer_site_number = $soa_i->customer_site_number;
	 $sd_delivery_lines->ar_customer_site_name = $soa_i->customer_site_name;
	 $sd_delivery_lines->action = null;
	 
	}
 }
}

if(empty($$class->delivery_date)){
 $$class->delivery_date = current_time(true);
}

if(empty($$class->status)){
 $$class->status = 'AWAITING_SHIPPING';
}

?>

