PATH:
home
/
centosnipponia
/
cronjscript
/
old
<?php date_default_timezone_set("Europe/Amsterdam"); echo date("Y-m-d H:i:s"); $today_midnight = mktime(0, 0, 0, date("m") , date("d"), date("Y")); $today_midnight_mysql = date ('Y-m-d H:i:s',$today_midnight); require __DIR__ . '/config.php'; //sale orders $query_arguments=array('&','&','&','&','&',array('product_type','=','product'),array(['order_id.warehouse_id'][0],'=',158),array('qty_delivered','=',0),array('state','=','sale'),array('create_date','>=',$today_midnight_mysql),array('x_tracking_product','=','serial')); $uii=$models->execute_kw($db, $uid, $password,'sale.order.line', 'search_read',array($query_arguments), array('limit'=>100)); $csv = "Tranfer number,Model,Qty,Destination(Customer-Address),Phone number,Date created \n";//Column headers foreach($uii as $result) { $csv.= 'Sale Order '.$result['order_id'][1].','.preg_replace('/[^A-Za-z0-9\-]/', ' ', $result['name']).','.$result['product_uom_qty'].','.preg_replace('!\s+!', ' ', $result['x_dest_address_va']).','.preg_replace('!\s+!', '', $result['x_dest_ph_va']).','.$result['create_date']." \n"; //Append data to csv } //sale orders //internal tranfers $query_arguments=array('&','&','&',array('create_date','>=',$today_midnight_mysql),array('lot_id','=',False),array('picking_code','=','internal'),array(['location_id'][0],'=',2075)); $uii=$models->execute_kw($db, $uid, $password,'stock.move.line', 'search_read',array($query_arguments), array('limit'=>100)); foreach($uii as $result) { $qtyinternal=$result['product_uom_qty']+1; echo '<tr><td>'.'Internal Tranfer '.$result['picking_id'][1].'</td><td>'.$result['product_id'][1].'</td><td>'.$qtyinternal.'</td><td>'.$result['x_dest_address_va'].' - Ph:'.$result['x_dest_ph_va'].'</td><td>'.$result['create_date'].'</td><td> <input type=text pattern=[a-zA-Z0-9]+ minlength=4 maxlength=10 id=lname name='.'CN'.$result['id'].'></td><td><label for='.'CN'.$result['id'].'></label></td></tr>'."\n";//order_id,create_date $csv.='Internal Tranfer '.$result['picking_id'][1].','.preg_replace('/[^A-Za-z0-9\-]/', ' ', $result['product_id'][1]).','.$qtyinternal.','.preg_replace('!\s+!', ' ', $result['x_dest_address_va']).','.preg_replace('!\s+!', ' ', $result['x_dest_ph_va']).','.$result['create_date']." \n"; //Append data to csv } //internal tranfers $timestamp = strtotime("now"); $time = date('Y_m_d_his', $timestamp); $filenameunique=$time.'.csv'; $csv_handler = fopen ($filenameunique,'w'); fwrite ($csv_handler,$csv); fclose ($csv_handler); //var_dump($uii); require __DIR__ . '/ml.php'; ?>
[+]
..
[-] sql_command_update_trn.php
[edit]
[-] createandsend.php pld 14102021
[edit]
[-] createandsend.php-change-contact-address
[edit]
[-] createandsend.php-old2
[edit]
[-] createandsend.php-old11
[edit]
[-] createandsend.php - old major change 11102021
[edit]
[-] config.php-staging
[edit]
[-] createandsend.php-old1
[edit]
[-] createandsend.php-old181121
[edit]
[-] sql_command_del.php-old15102021
[edit]
[-] createandsend.php-170222
[edit]
[-] createandsend.php-301121
[edit]