Difference between revisions of "Plugin: Alt OrderLine"

From iDempiere en
 
(35 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
* '''Current Version:''' 2.1
 
* '''Current Version:''' 2.1
 
* '''License:''' [http://www.gnu.org/licenses/gpl-2.0.html GPLv2] - Free as in Freedom not Free Lunch
 
* '''License:''' [http://www.gnu.org/licenses/gpl-2.0.html GPLv2] - Free as in Freedom not Free Lunch
* '''Source:''' [http://bitbucket.org/red1/alt.orderline BitBucket]
+
* '''Source:''' [https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://bitbucket.org/red1/alt.orderline archive.softwareheritage.org]
* '''Plugin:''' [http://sourceforge.net/projects/red1/files/Localisation/AulerSipel/ alt.orderline]plugin & 2Pack
+
* '''Plugin:''' [http://sourceforge.net/projects/red1/files/Localisation/AulerSipel/ alt.orderline] SQL script, 2Pack (Alt_OrderLine.zip), and plugin
 
* '''Forum:''' [http://red1.org/adempiere/ red1.org]
 
* '''Forum:''' [http://red1.org/adempiere/ red1.org]
 
* '''Sponsor:''' [[AulerSipel]].  
 
* '''Sponsor:''' [[AulerSipel]].  
Line 10: Line 10:
 
==Continuation==
 
==Continuation==
 
*This project is a separate plugin and continuation of [[Plugin:_Alternative_Output]].
 
*This project is a separate plugin and continuation of [[Plugin:_Alternative_Output]].
**To be able to group items arbitrarily and have control over their output display
+
**To be able to group items arbitrarily and have control over their output display on screen and in printout.  
*Use that plugin if you just want a simple display and control of alternative output.
+
*This plugin here has additional CONSOLIDATE and CONSOLIDATE_SAME_LINE output control.
*This plugin here has additional CONSOLIDATE and CONSOLIDATE_SAME_LINE output
+
*Again, what is vital is that this is a pure separate non impact to core or design entanglement, i.e. it allows more plugins to work on the same core as long as every plugin follows the same practice. It is a Java and OSGi concept of Object-Oriented to have separation of concern and loosely coupled.
*Again, what is vital is that this is a pure separate non impact to core plugin with no meta-model or design entanglement. Everything follows the Java and OSGi concept of Object-Oriented componentisation with loose coupling.
+
 
 +
==Release Status==
 +
*This is a beta release but good for production because it has no impact to any data values in database nor corrupt any processing.
 +
*It is beta only pending it to become more fine working and complete.
 +
*So users are welcome to try it and provide feedback to improve further.
 +
 
 +
==How To Use==
 +
*From [http://sourceforge.net/projects/red1/files/Localisation/AulerSipel/ Plugin repo], run the SQL script '''Alt_OrderLineView.sql''' to create the alternative printout view in your Database.
 +
*Pack In the '''Alt_OrderLine.zip''' to your System admin.
 +
*Install the plugin '''AltOrderLine_3.1.0.<timestamp>.jar''' via your Felix OSGi console.
 +
*Setup any product under a new BOM in the Parts and BOM menu as shown below.
 +
*Prepare a Sales Order and see the effects.
 +
*Print Preview out the Sales Order to see the effects. (Set your Document Type for Standard Order to the new Print Format - Order Header AS)
 +
*You can still return to normal use while this plugin is running as if nothing changed.
 +
 
 +
==Uninstalling==
 +
*To uninstall, simply stop or uninstall the plugin jar in your Felix Console.
 +
*Go to Window-Tab and remove the last tab - Alt OrderLine
 +
*Go to PrintFormat and remove Order Header AS and Order Line AS
 +
*However remember that the plugin has no backward impact and thus very compatible and safe to use.
  
 
==Tab Model==
 
==Tab Model==
*The extra tab model is same as C_OrderLine with each line for each display output row.
+
[[File:SOrderLineAlt.png|450px|right]]
*Same as previous plugin, it has simplified fields.
+
[[File:AltCONSOLIDATE.png|400px|right]]
*C_ALTOrderLine parent key is C_Order_ID, it can have many to one C_Order parent.
+
[[File:AltConsolidated.png|400px|right]]
 +
[[File:AltCONSOLIDATESAMELINE.png|400px|right]]
 +
[[File:AltConsolidatedSameLine.png|400px|right]]
 +
 
 +
*The extra tab model, C_ALT_OrderLine has minimal overlay of C_OrderLine fields merely for output model.
 +
*C_ALT_OrderLine parent key is C_Order_ID, and it correlates with C_OrderLine_ID for easier View handling during printformat.
 +
*PrintFormats of Standard Order is copied over as optional PrintFormat, is compatible with simple JOIN to C_Alt_OrderLine.
  
 
==CONSOLIDATE for Readability==
 
==CONSOLIDATE for Readability==
[[File:SOrderLineAlt.png|400px|right]]
+
*Hash # character in BOM parent Document Note box, to effect any group of products.  
*Similar to previous plugin, it uses hash # character in BOM parent Document Note box, to effect any group of products. Read the source code where it is well documented at bitbucket.
 
 
*HEADER#CONSOLIDATE will take any similar product lines into one with its qty value summed up
 
*HEADER#CONSOLIDATE will take any similar product lines into one with its qty value summed up
 
*HEADER#CONSOLIDATE_SAME_LINE will group only those that have same qtys.
 
*HEADER#CONSOLIDATE_SAME_LINE will group only those that have same qtys.
**For example:
+
*HEADER# is mandatory and will pull BOM Parent label as first line of output. You can leave it blank if unneeded.
 +
* #DETAIL_NO_PRICE and #DETAIL_OWN_PRICE still working as other plugin.
 +
*Example of #CONSOLIDATE_SAME_LINE:
 
**Cable A1 - Qty=100 meters
 
**Cable A1 - Qty=100 meters
 
**Cable A1 - Qty=100 meters
 
**Cable A1 - Qty=100 meters
 
*Will result in:
 
*Will result in:
 
**2 X Cable A1 - Qty=100 meters
 
**2 X Cable A1 - Qty=100 meters
 
+
*If set to #CONSOLIDATE will result in:
[[File:AltCONSOLIDATE.png|270px|right]]
+
**Cable A1 - Qty=200 meters
[[File:AltConsolidated.png|400px|right]]
 
  
 
==Screenshots of Examples==
 
==Screenshots of Examples==
*See screen above of normal OrderLine tab showing source that has two lines of similar products and similar qtys (2 sets of screws at qty=8)
+
*See screen above of normal OrderLine tab showing source that has two lines of similar products and similar qtys (2 sets of Seeders at qty=5)
 
*They will be used to quickly test the plugin as shown on screens below.
 
*They will be used to quickly test the plugin as shown on screens below.
 
*First the setting is to #CONSOLIDATE#, then Prepare the Sales Order.
 
*First the setting is to #CONSOLIDATE#, then Prepare the Sales Order.
*Note the output has both lines merged with the qty = 16
+
*Note the output has both lines merged with the qty = 10
 
*Next we change to #CONSOLIDATE_SAME_LINE, and Prepare the same Sales Order again.
 
*Next we change to #CONSOLIDATE_SAME_LINE, and Prepare the same Sales Order again.
*Note that now the alternative orderline has maintained the qty = 8 but description is '2 X <product>'
+
*Note that now the alternative orderline has maintained the qty = 5 but description is '2 X <product>'
 +
*All real data such as prices and totals remain untouched. It is only display that is affected.
 +
 
 
==Easy Source==
 
==Easy Source==
[[File:AltCONSOLIDATESAMELINE.png|270px|right]]
 
[[File:AltConsolidatedSameLine.png|400px|right]]
 
 
*I have made the source code as pushed to bitbucket well described so that any coder can change it easily.
 
*I have made the source code as pushed to bitbucket well described so that any coder can change it easily.
*Note that the ALT tab did not apply discount for LineNetAmt, but that is easy to solve in code - just copy the original C_OrderLine column values. What is important is the ability to group arbitrarily any set of products quickly and to change description for PrintFormat to be more readable.
+
*Note that the ALT tab only affects Name, PriceEntered and QtyOrdered.
 +
*Also note that during BOM Parent setting, only the first record need be registered to give effect. This setup is not strict and inclusive rather than exclusive. After some playing around the user should be very efficient and quick is doing any variant required.
 +
 
 
==2Pack==
 
==2Pack==
 +
[[File:AltPrintFormat.png|400px|right]]
 +
[[File:AltPrintFormatSameLine.png|400px|right]]
 +
[[File:AltPrintFormatDetailNoPrice.png|400px|right]]
 
*2Pack is embedded in [http://sourceforge.net/projects/red1/files/Localisation/AulerSipel/ alt.orderline plugin jar]
 
*2Pack is embedded in [http://sourceforge.net/projects/red1/files/Localisation/AulerSipel/ alt.orderline plugin jar]
 
*After auto Pack In, under System Admin, the PackOut window can be reused to modify and pack out again.
 
*After auto Pack In, under System Admin, the PackOut window can be reused to modify and pack out again.
  
==TODO==
+
==Print Format==
*Next will be to prepare a PrintFormat option for Sales Order Window
+
*Now a PrintFormat option for Sales Order Window is set for Document Type 'Standard Order'
 
+
*It is a copy of the Order Template but referring to a new View that access the Alt table.
== Feedback ==
+
*In this example is tested with three cases:
 
+
**#CONSOLIDATE of same products to single line with HEADER# grouping label
Please rate this plugin:
+
**#CONSOLIDATE_SAME_LINE of same line/qty X 2
+
**#DETAIL_NO_PRICE to supress group children pricing and retain only parent grandtotal
{{#w4grb_rate:Plugin:_Alt_OrderLine}}
+
**More order lines are added, one above and one below, to see if structural integrity is maintained
 +
*User can also switch back to old PrintFormat from the pull down menu.
 +
*This finally proved that all cases can be handled with no impact to core.
  
<w4grb_ratinglist pagevotes idpage="Plugin:_Alt_OrderLine"/>
+
==One more idea==
 +
*Note that the Alt_Orderline tab in Sales Order can be easily and conveniently replaced by the AltOrder_LineView directly and even give a more exact preview before print preview. This will save time because the user can change the HEADER# changes and press Prepare and right away see the print preview output!
 +
*This concept can be applied to any other Window. It is matter of creating a new extra tab and use its JOIN design to the view table that its respective PrintFormat refers to.
 +
*Perhaps one day with enough usage, we can abstract this completely to a configurator without coding further.
  
 
If you want to provide additional comments, please use the [[Talk:Plugin:_Alt_OrderLine|Discussion page]].
 
If you want to provide additional comments, please use the [[Talk:Plugin:_Alt_OrderLine|Discussion page]].
  
 
[[Category:Available_Plugins]]
 
[[Category:Available_Plugins]]

Latest revision as of 12:54, 13 February 2021


Continuation

  • This project is a separate plugin and continuation of Plugin:_Alternative_Output.
    • To be able to group items arbitrarily and have control over their output display on screen and in printout.
  • This plugin here has additional CONSOLIDATE and CONSOLIDATE_SAME_LINE output control.
  • Again, what is vital is that this is a pure separate non impact to core or design entanglement, i.e. it allows more plugins to work on the same core as long as every plugin follows the same practice. It is a Java and OSGi concept of Object-Oriented to have separation of concern and loosely coupled.

Release Status

  • This is a beta release but good for production because it has no impact to any data values in database nor corrupt any processing.
  • It is beta only pending it to become more fine working and complete.
  • So users are welcome to try it and provide feedback to improve further.

How To Use

  • From Plugin repo, run the SQL script Alt_OrderLineView.sql to create the alternative printout view in your Database.
  • Pack In the Alt_OrderLine.zip to your System admin.
  • Install the plugin AltOrderLine_3.1.0.<timestamp>.jar via your Felix OSGi console.
  • Setup any product under a new BOM in the Parts and BOM menu as shown below.
  • Prepare a Sales Order and see the effects.
  • Print Preview out the Sales Order to see the effects. (Set your Document Type for Standard Order to the new Print Format - Order Header AS)
  • You can still return to normal use while this plugin is running as if nothing changed.

Uninstalling

  • To uninstall, simply stop or uninstall the plugin jar in your Felix Console.
  • Go to Window-Tab and remove the last tab - Alt OrderLine
  • Go to PrintFormat and remove Order Header AS and Order Line AS
  • However remember that the plugin has no backward impact and thus very compatible and safe to use.

Tab Model

SOrderLineAlt.png
AltCONSOLIDATE.png
AltConsolidated.png
AltCONSOLIDATESAMELINE.png
AltConsolidatedSameLine.png
  • The extra tab model, C_ALT_OrderLine has minimal overlay of C_OrderLine fields merely for output model.
  • C_ALT_OrderLine parent key is C_Order_ID, and it correlates with C_OrderLine_ID for easier View handling during printformat.
  • PrintFormats of Standard Order is copied over as optional PrintFormat, is compatible with simple JOIN to C_Alt_OrderLine.

CONSOLIDATE for Readability

  • Hash # character in BOM parent Document Note box, to effect any group of products.
  • HEADER#CONSOLIDATE will take any similar product lines into one with its qty value summed up
  • HEADER#CONSOLIDATE_SAME_LINE will group only those that have same qtys.
  • HEADER# is mandatory and will pull BOM Parent label as first line of output. You can leave it blank if unneeded.
  • #DETAIL_NO_PRICE and #DETAIL_OWN_PRICE still working as other plugin.
  • Example of #CONSOLIDATE_SAME_LINE:
    • Cable A1 - Qty=100 meters
    • Cable A1 - Qty=100 meters
  • Will result in:
    • 2 X Cable A1 - Qty=100 meters
  • If set to #CONSOLIDATE will result in:
    • Cable A1 - Qty=200 meters

Screenshots of Examples

  • See screen above of normal OrderLine tab showing source that has two lines of similar products and similar qtys (2 sets of Seeders at qty=5)
  • They will be used to quickly test the plugin as shown on screens below.
  • First the setting is to #CONSOLIDATE#, then Prepare the Sales Order.
  • Note the output has both lines merged with the qty = 10
  • Next we change to #CONSOLIDATE_SAME_LINE, and Prepare the same Sales Order again.
  • Note that now the alternative orderline has maintained the qty = 5 but description is '2 X <product>'
  • All real data such as prices and totals remain untouched. It is only display that is affected.

Easy Source

  • I have made the source code as pushed to bitbucket well described so that any coder can change it easily.
  • Note that the ALT tab only affects Name, PriceEntered and QtyOrdered.
  • Also note that during BOM Parent setting, only the first record need be registered to give effect. This setup is not strict and inclusive rather than exclusive. After some playing around the user should be very efficient and quick is doing any variant required.

2Pack

AltPrintFormat.png
AltPrintFormatSameLine.png
AltPrintFormatDetailNoPrice.png
  • 2Pack is embedded in alt.orderline plugin jar
  • After auto Pack In, under System Admin, the PackOut window can be reused to modify and pack out again.

Print Format

  • Now a PrintFormat option for Sales Order Window is set for Document Type 'Standard Order'
  • It is a copy of the Order Template but referring to a new View that access the Alt table.
  • In this example is tested with three cases:
      1. CONSOLIDATE of same products to single line with HEADER# grouping label
      2. CONSOLIDATE_SAME_LINE of same line/qty X 2
      3. DETAIL_NO_PRICE to supress group children pricing and retain only parent grandtotal
    • More order lines are added, one above and one below, to see if structural integrity is maintained
  • User can also switch back to old PrintFormat from the pull down menu.
  • This finally proved that all cases can be handled with no impact to core.

One more idea

  • Note that the Alt_Orderline tab in Sales Order can be easily and conveniently replaced by the AltOrder_LineView directly and even give a more exact preview before print preview. This will save time because the user can change the HEADER# changes and press Prepare and right away see the print preview output!
  • This concept can be applied to any other Window. It is matter of creating a new extra tab and use its JOIN design to the view table that its respective PrintFormat refers to.
  • Perhaps one day with enough usage, we can abstract this completely to a configurator without coding further.

If you want to provide additional comments, please use the Discussion page.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.