Data collection during manufacturing


#1

Hello, I have been looking through this erp which is very good comparative to the others. its more like ofbiz.
But I will like to know how i can call and present the production task comments, dates, returned or unused material on the production printout. most of the information during manufacturing is not present in the printout.


#2

Hi Maximillian and welcome to the community.

That’s correct, we noticed that the production printout has some missing information. Check this recent post for further info.
In any case, we will improve that in the following releases, most likely in 1.14.6, not in the 1.14.5 version we will release soon. However, production runs are usually very specific so it is possible that even with our changes your requirements won’t be met. That means that ultimately you’ll have to make your custom changes anyway.


#3

Thanks, Am unable to access the the the link you sent for the recent post

Do I need some other permission?


#4

Please check again. I revived the topic.


#5

Thanks, I checked, Seems @nges issue in that post is not very far from mine but am abit familiar with the report format but blocked at the level of calling the variables to the report (Is there a list of variables for the manufacturing module and syntax ? An example will be helpful). I also checked the end user documentation and it seems manufacturing is not yet available.
Thanks


#6

It is a little known fact, but our templating toolkit comes with a utility function that lists every variable in context: https://www.scipioerp.com/community/developer/freemarker-macros/utilities/#entry-printVars

Those are a bit tricky to use in the FOP screens, however, so if you are interested in the variables of a pdf screen, it is easiest to look at the screen definition and check for a groovy file that will define the context.

For example, if you are interested in the screen: https://localhost:8443/manufacturing/control/PrintProductionRun?productionRunId=10073

Then the following is the screen definition:

<screen name="ProductionRunPdf">
    <section>
        <actions>
            <property-map resource="ManufacturingReportsUiLabels" map-name="uiLabelMap" global="true"/>
            <property-map resource="ManufacturingUiLabels" map-name="uiLabelMap" global="true"/>
            <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
            <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
            <set field="titleProperty" value="ManufacturingProductionRun"/>
            <set field="bodyFontSize" value="10pt"/>
            <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy"/>
        </actions>
        <widgets>
            <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                <decorator-section name="body">
                    <platform-specific>
                        <xsl-fo><html-template location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRun.fo.ftl"/></xsl-fo>
                    </platform-specific>
                </decorator-section>
            </decorator-screen>
        </widgets>
    </section>
</screen>

Check the groovy file

<script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy"/>

and you can search for context.xxx entries. That’s the variables you are looking for. In the case of the above I find:

context.productionRunId 
context.productionRun 
context.orderItems 
context.inventoryItems 
context.lastLotId 
context.canDeclareAndProduce 
context.canProduce 
context.productionRunData 
context.actionForm 
context.routingTaskData 
context.routingTaskId 
context.delivProducts 
context.prunInventoryProduced 
context.productionRunRoutingTasks 
context.startTaskId (startTaskId ? startTaskId: 
context.issueTaskId (issueTaskId? issueTaskId: 
context.completeTaskId (completeTaskId != null? completeTaskId: 
context.productionRunContents 
context.productionRunComponentsData 
context.productionRunComponentsDataReadyForIssuance 
context.productionRunComponentsAlreadyIssued

#7

Thanks this is very helpful, I have gotten some data but in the production run pdf print out, I have something like this: **<fo:block>${productionRunRoutingTask.estimatedMilliSeconds!}</fo:block>**
which displays the estimated time of a task.

How do I display on the pdf print something like actual used times from production run declaration ? I have gone through all the groovy files for manufacturing but don’t seem to see for the task edit declaration
pls see screen shot and pls let me know if am missing something: http://prntscr.com/mc7kli


#8

Hey, no problem. Just had a quick look at that groovy file i mentioned.

The red arrows you drew all seem to come from this bit of the screen:

                      <screenlet title="${uiLabelMap.ManufacturingListOfProductionRunRoutingTasks}">
                        <include-form name="ListProductionRunDeclRoutingTasks" location="component://manufacturing/widget/manufacturing/ProductionRunForms.xml"/>
                    </screenlet>

Follow that include and you’ll find a form which iterates over the variable “productionRunRoutingTasks”. That one is set by the groovy file I mentioned before.

So if you want to add those values to the pdf, you just need to iterate over that value and display it like such:

<#list productionRunRoutingTasks as prt>
       <fo:block>${uiLabelMap.ManufacturingTaskActualSetupMillis} : ${prt.actualSetupMillis}</fo:block>
</#list>

Give it a try and get used to checking the screen definitions for this, that will make it easier to modify those templates in the future.

If you are new to this, you may also want to check out:

https://www.scipioerp.com/community/developer/views-requests/
https://www.scipioerp.com/community/developer/views-requests/request-controller/
https://www.scipioerp.com/community/developer/views-requests/screen-widgets-decorators/

That should bring you up to speed on how things connect.


#9

Thanks its gradually coming. It really seems to be abit tricky. This is an extract of the form part I want to display on pdf especially the input values because labels display well.

`    <form name="EditProductionRunDeclRoutingTask" type="single" target="updateProductionRunTask" title="" default-map-name="routingTaskData"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <field name="actionForm">
            <hidden value="${actionForm}"/>
        </field>
        <field name="productionRunId">
            <hidden value="${routingTaskData.workEffortParentId}"/>
        </field>
        <field name="productionRunTaskId">
            <hidden value="${routingTaskData.workEffortId}"/>
        </field>
        <field name="priority" title="${uiLabelMap.CommonSequenceNum}">
            <display/>
        </field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}">
            <display/>
        </field>
        <field name="description" title="${uiLabelMap.CommonDescription}">
            <display/>
        </field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}">
            <display/>
        </field>
        <field name="fromDate" title="${uiLabelMap.ManufacturingFromDate}">
            <date-time/>
        </field>
        <field name="toDate" title="${uiLabelMap.ManufacturingToDate}">
            <date-time/>
        </field>
        <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}">
            <display/>
        </field>
        <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}">
            <display/>
        </field>
        <field name="addSetupTime" title="${uiLabelMap.ManufacturingAddSetupTime}">
            <text/>
        </field>
        <field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}">
            <display/>
        </field>
        <field name="actualMilliSeconds" title="${uiLabelMap.ManufacturingTaskActualMilliSeconds}">
            <display/>
        </field>
        <field name="addTaskTime" title="${uiLabelMap.ManufacturingAddTaskTime}">
            <text/>
        </field>

        <field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}">
            <display/>
        </field>
        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}">
            <display/>
        </field>
        <field name="addQuantityProduced" title="${uiLabelMap.ManufacturingAddQuantityProduced}">
            <text/>
        </field>
        <field name="quantityRejected" title="${uiLabelMap.ManufacturingQuantityRejected}">
            <display/>
        </field>
        <field name="addQuantityRejected" title="${uiLabelMap.ManufacturingAddQuantityRejected}">
            <text/>
        </field>
        <field name="comments" title="${uiLabelMap.ManufacturingComments}">
            <text/>
        </field>
        <field name="partyId" title="${uiLabelMap.ManufacturingWorker}">
            <text/>
        </field>
        <field name="submitAction" title="${uiLabelMap.CommonSubmit}" widget-style="${styles.link_run_sys} ${styles.action_update}">
            <submit button-type="button"/>
        </field>
    </form>``

When I iterate values for say the example you gave it works, but when i take another variable it shows some error

` <#list productionRunRoutingTasks as productionRunRoutingTask>
                    <fo:table-row>
                        
                        <fo:table-cell ">
                            <fo:block>${productionRunRoutingTask.workEffortName!}</fo:block>
                        </fo:table-cell>
                        <fo:table-cell >
                            <fo:block>${productionRunRoutingTask.actualStartDate!}</fo:block>
                        </fo:table-cell>
		    <fo:table-cell padding="5pt" border="solid 0.1mm black">
                        <fo:block>${productionRunRoutingTask.actualCompletionDate!}</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
					
                </#list>`

The above works and shows the required information but when I do for this values below it shows error in pdf.

  <#list productionRunRoutingTasks as productionRunRoutingTask>
                        <fo:table-row>
                            
                            <fo:table-cell ">
                                <fo:block>${productionRunRoutingTask.workEffortName!}</fo:block>
                            </fo:table-cell>
                            <fo:table-cell >
                                <fo:block>${productionRunRoutingTask.partyID!}</fo:block>
                            </fo:table-cell>
			    <fo:table-cell padding="5pt" border="solid 0.1mm black">
                            <fo:block>${productionRunRoutingTask.comments!}</fo:block>
                            </fo:table-cell>
                        </fo:table-row>
						
                    </#list>`

It shows this error message: http://prntscr.com/mcme8a
I have checked the groovy files but dont seem to see the declaration
Am trying to display comment, partyID, lot ID but these all show errors. As I mentioned above it has worked for some but not for other.
Sorry for these many questions. I am just wondering where am going wrong to display the other variables like comment, partyID, lot ID :thinking:


#10

Not tricky at all. Check this out:

     <form name="EditProductionRunDeclRoutingTask" type="single" target="updateProductionRunTask" title="" default-map-name="routingTaskData"

The “default-map-name” is the variable the form looks up to get its data from.

So instead of using “productionRunRoutingTask.workEffortName!” you should use “routingTaskData.workEffortName!”.

But I think you are on the right track, so keep on it :slight_smile:


#11

Thanks, Issue is that I tried that below even individually but it returns error.
${routingTaskData.workEffortName!}
${routingTaskData.partyId!}
${routingTaskData.comments!}

but when I iterate with ${productionRunData.comments!}, it does not show error but does not output anything.
When I check well, I noticed that the comment, worker does not save anywhere in the database (when i click on Declare to edit previous data of comment, place is empty meaning it was never saved) maybe the reason of errors because all data that saves in the db displays.

Can there be issue with comment, worker data saving, because others display, how can I correct this pls?


#12

There are high chances that we got a bug there. I am currently investigating in deep so I’ll keep you posted once I figure out what’s going on and mostly likely provide a fix which you’ll have to pull from our public repository.


#13

oK thanks. Am waiting …


#14

Hi Maximillian,

I’ve committed a fix that will be available soon (today most likely) in our public repo. Check it out once you have the chance.


#15

Hello Minifreak,
thanks for the comit, I just checked it out and noticed the comit. and I pulled the changes from your git repository. I see the comment section actually added on the pdf printout file but values still shows error: http://prntscr.com/mdxbkf and there is no way to edit the comment again if I declare again. Once the comment is entered, can it not just remain there so that it can be redited and submitted again? for the added for comment in the template, I hope I can use the same logic to add other elements like partyID, worker and so on for the valules with error.
Pls check maybe am missing something from the commit ?


#16

I think you missed to recompile. Just run ./ant clean build from your installation folder and let me know how it goes.


#17

Hi, am getting this error when running “ant clean build” http://prntscr.com/me66ml


#18

Weird, I highly doubt this is caused by my fixes. Checking it anyway on all repos (internal and Github)


#19

Also I downloaded all the repository and tested it on another pc, and ant build works, comment label showing but comment value still not displaying .:sweat:


#20

Odd, I am testing it in our demo server https://ce.scipioerp.com/manufacturing/control/ProductionRunDeclaration?productionRunId=10000 and it works fine there. Check the printout too https://ce.scipioerp.com/manufacturing/control/PrintProductionRun?productionRunId=10000

This is the workflow I’m following:

  1. Create a production run by filling the basic fields

  2. Set it to confirmed by clicking on the confirm top-bar button

  3. Start the task/s associated to that production run

  4. Click on the declare button for each task I want to add info like comments and so.

  5. Check if the printout displays the comments

In my case, when I follow this steps, it works smoothly. So can you tell me exactly how are you creating production runs and adding tasks comments?