Can We Show Product Varriants In Sale And Puchase

0

Hello support,

I have products varriants and I am struggling with product detail page, where it shows only product name (qty) so I have to basically click each invoice to see the detail of varriants product and check if quantity is right or not.

is there a way or modification i can make to show the Product Varriants next to the Product name in Product detail page?

example now it shows
Product name (qty)
please see my screenshot of how it looks now .

could it be >>
Product name
(varriants 1 = qty)
(varriants 2 = qty) etc...
or it could display like what it display in invoice as summary (see my last attachment)

Thank you

Question Resolved For: Stock Manager Advance with All Modules 0 Votes 28 Answers 1.1k Views
Asked by Prom Vongchann 1 year ago

0

Answered by Mian Saleem 2 weeks ago

Hello,

I get the code from repo. You can try replace the line 2232 - 2239 with following

$this->db
    ->select("date, reference_no, biller, customer, GROUP_CONCAT(CONCAT({$this->db->dbprefix('sale_items')}.product_name, ' ', {$this->db->dbprefix('product_variants')}.name, ' (', ROUND({$this->db->dbprefix('sale_items')}.quantity, {$this->Settings->qty_decimals}), ')') SEPARATOR '\n') as iname, grand_total, paid, payment_status", false)
    ->from('sales')
    ->join('sale_items', 'sale_items.sale_id=sales.id', 'left')
    ->join('warehouses', 'warehouses.id=sales.warehouse_id', 'left')
    ->join('product_variants', 'product_variants.id=sale_items.option_id', 'left')
    ->group_by('sales.id')
    ->order_by('sales.date desc');

I don't have machine with php8 so I am unable to check this but it should add the variant name after products name in column E.

Thank you

0

Answered by Prom Vongchann 2 weeks ago

Mian Saleem
I have tried but the exported report are missing data and variant still not showing
you could check my attached screenshot

0

Answered by Prom Vongchann 2 weeks ago

The item those are not showing maybe because they are not having any variants, so it might be a bit of query condition missing.

0

Answered by Prom Vongchann 2 weeks ago

Mian Saleem so you have any idea about that ?

0

Answered by Mian Saleem 2 weeks ago

Hello,

I am not so sure but it should be due to new changes. Maybe you can try case statement, something like

$this->db
    ->select("date, reference_no, biller, customer, GROUP_CONCAT(CONCAT({$this->db->dbprefix('sale_items')}.product_name, (CASE WHEN {$this->db->dbprefix('sale_items')}.option_id > 0 THEN CONCAT(' ', {$this->db->dbprefix('product_variants')}.name) ELSE '' END), ' (', ROUND({$this->db->dbprefix('sale_items')}.quantity, {$this->Settings->qty_decimals}), ')') SEPARATOR '\n') as iname, grand_total, paid, payment_status", false)
    ->from('sales')
    ->join('sale_items', 'sale_items.sale_id=sales.id', 'left')
    ->join('warehouses', 'warehouses.id=sales.warehouse_id', 'left')
    ->join('product_variants', 'product_variants.id=sale_items.option_id', 'left')
    ->group_by('sales.id')
    ->order_by('sales.date desc');

Thank you

0

Answered by Prom Vongchann 1 week ago

Mian Saleem Wonderful,
It works.

Thank you very much

We use Cookies

We use cookies to ensure that we give you the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies.