Topic: Transaction References with Customer Placeholder

$refline_placeholders = array(
    'MM' => 'date',
    'YY' => 'date',
    'YYYY' => 'date',
    'FF' => 'date', // fiscal year
    'FFFF' => 'date',
    'UU' => 'user',
     'P' => 'pos',
//     FIXME:  for placeholders below all the code should work, but as the ref length is variable,
//       length specification in placeholder format should be implemented.
    'C' => 'customer',
    'B' => 'branch',
    'S' => 'supplier',
    'L' => 'location'
);

I uncommented the last four placeholders. should {C} shall bring the Customer's ShortCode in Reference. It is bringing 0. Any idea?

www.boxygen.pk

Re: Transaction References with Customer Placeholder

If you want test  it, you have to add 'custom'=>$customer_id  in parameters array of $Refs->get_next() wherever applicable, e.g. in sales/sales_order_entry.php:479
J.

Re: Transaction References with Customer Placeholder

The said line 479 is:

        $ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today()));

Where in it should it be added?

Any generic way to have this feature without manual intervention?

4 (edited by boxygen 08/23/2019 02:12:47 am)

Re: Transaction References with Customer Placeholder

on Line # 479 I modified the code as below

$ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today(), 'customer'=>$_SESSION['Items']->customer_id));

On Line # 673 modified the code as below

$doc->reference = $Refs->get_next($doc->trans_type, null, array('date' => Today(), 'customer'=>$doc->customer_id));

On sales/includes/ui/sales_order_ui.inc Line # 273 I added the code as below

$_POST['ref'] =  $Refs->get_next($doc->trans_type, null, array('date' => Today(), 'customer'=>get_post('customer_id'));

I got the desired result.

www.boxygen.pk

Re: Transaction References with Customer Placeholder

@itronics: must this now be added into the core?

Re: Transaction References with Customer Placeholder

@itronics: must this now be added into the core?