Add Line Items to Cases For No Charge Work Orders (Cases)

I have installed the latest version of Suite CRM

I have renamed the Cases Module to “Tickets” to be used as Work Orders to be given to our technicians to go out in the field.

We have a requirement that we be able to add line items directly to the tickets(cases)

We have a number of clients that are under managed support.

The purpose of this requirement is to demonstrate what the client would have been charged if an actual invoice had been processed.

I need to know the best way to approach this.

I know that I will have to pull the line items into the Cases module somehow.

I am wondering with this requirement if I should create a complete new custom module or reverse engineer the quotes/invoices modules and figure out how to add the line items into cases.

Any ideas would be greatly appreciated.

Thanks in advance.
Scott

Seriously no one?

Is there a breakdown of this thing anywhere?

Do I have to pay to get an answer? If so How Much?

I have messed around with line items a few times but I am not sure how you would implement it in another module to be honest. The relationships are set up differently. I can go looking through my previous posts to see if anything useful in there as I don’t remember off the top of my head.

I think it is partly a complexity issue with them getting back to you, in my short experience with it the most difficult to customise part of Suite is to do with line items. I would love to see in the future a way to add line items via Studio, not sure how much would be involved in it but I think it could be really useful.

Good luck with your customisations!

Sam

I was trying to copy what was going on with Quotes and Invoices.

In my google search I found they had also added line items to contracts.

When I looked at contracts I couldn’t figure out the difference of what I was doing.

The issue was “Cases” wasn’t the function it was suppose to be relating too. it was “aCase”

case is a php reserved word (function) to “Cases:Case” had to become Cases:aCase"

Once I made this change I was able to get line items into cases.

That makes sense, for future reference would you mind putting down a quick list of steps you took? Or a link to the post for the contracts solution.

Cheers.

It’s all about duplicating the vars from invoices, quotes.

I deconstructed the var defs in invoices

added the required vars to the vardefs in cases.

Used studio to duplicate the layout of the details and edit templates.

manually added “Line Items” to the edit view.

All that seemed pretty straight forward for copying fields from one module to another.

The trip up was in the relationships

Here is my version of the working relationships in cases vardefs.php


, 'relationships' => array (

        'a_case_aos_products_quotes' =>
            array(
                'lhs_module' => 'aCase',
                'lhs_table' => 'cases',
                'lhs_key' => 'id',
                'rhs_module' => 'AOS_Products_Quotes',
                'rhs_table' => 'aos_products_quotes',
                'rhs_key' => 'parent_id',
                'relationship_type' => 'one-to-many',
            ),
        'a_case_aos_line_item_groups' =>
            array(
                'lhs_module' => 'aCase',
                'lhs_table' => 'cases',
                'lhs_key' => 'id',
                'rhs_module' => 'AOS_Line_Item_Groups',
                'rhs_table' => 'aos_line_item_groups',
                'rhs_key' => 'parent_id',
                'relationship_type' => 'one-to-many',
            ),
1 Like