I am new to NetSuite and my current role. Our warehouse team is strunggling with Picking Tickets coming through with zero quantity items among a long list of items to be picked.
Pickers are making mistakes and picking items for which an order has not been placed. The original problem is with the Sales Order which is being worked on by others.
I am trying to find a quick solution whereby when picking tickets are printed the zero quantity items are filtered out and not printed.
Really appreciate any help provided.
Try this "SHOW UNCOMMITTED ITEMS ON PICKING TICKETS"
Navigation: setup--> Accounting-->Accounting preferences-->order management
If anyone else comes across this, you can also add this code to the PDF template in the case where you still need the uncommitted line items in Netsuite but just not printed on the PDF:
<thead>
<tr>
<th>...</th>
<tr/>
</thead>
<!-- only line items with qty > 0 on Sales Order will print -->
<#if item.quantity gt 0>
<tr>
<td>...</td>
</tr>
</#if>
Related
I am a beginner in power BI. I have to create a report with share point data. I have imported the data into dataset. However, some columns have text with html table tags or style like below -
<div class="ExternalClass5DA0D04953B047459697675F266FEABF">
<p></p>
<table width="395" border="0" cellspacing="0" cellpadding="0" style="width:296pt;">
<tbody>
<tr height="115" style="height:86.4pt;">
<td width="395" height="115" class="xl64" style="width:296pt;height:86.4pt;">
I am working on issue. I shall update the progress. <br>
</td>
</tr>
</tbody>
</table>
<p><br></p>
</div>
But I would like to show the plain text only which is "I am working on issue. I shall update the progress."
From this community thread, you can find a handy function for stripping all the HTML tags:
Here's the core logic (ignoring the documentation metadata for readability):
let func = (HTML) =>
let
Check = if Value.Is(Value.FromText(HTML), type text) then HTML else "",
Source = Text.From(Check),
SplitAny = Text.SplitAny(Source,"<>"),
ListAlternate = List.Alternate(SplitAny,1,1,1),
ListSelect = List.Select(ListAlternate, each _<>""),
TextCombine = Text.Combine(ListSelect, "")
in
TextCombine
in
func
Having this handy bit of code, create a new blank query and paste the above code into the advanced editor and give it a name, say, TextFromHTML.
Once you have that function defined, you can use it in any of your queries. For example, here's what a step to transform the column ColWithHTML might look like:
Table.TransformColumns(#"Prior Step", {{"ColWithHTML", each TextFromHTML(_), type text}})
You can create a new column with below formula as show below
if [HMTLField] = null then null else Html.Table([HMTLField] , {{"text",":root"}})
Then click on the button on right top of the field to convert this field as text by expanding it.
I've written a report using ColdFusion and SQL, and the queries won't return any rows when a certain value in every row is zero. I'm using a cfstoredproc to retrieve the data, and this is how I'm displaying it:
<cfloop query="DONORS_WITHDRAWN">
<tr>
<td align="left"><cfoutput>#DONORS_WITHDRAWN.Reason#</cfoutput></td>
<td align="right" style="padding-right: 58px"><cfoutput>#DONORS_WITHDRAWN.Number_of_DONOR_withdrawals#</cfoutput></td>
</tr>
</cfloop>
This is how the results look when only some of the values are zero:
And this is how they look when all of the results are zero (no rows are displayed):
When I run the query in SQL Server Management Studio for a time period when all of the results are zero, all of the rows are returned as expected. They just won't appear in the ColdFusion report unless at least one of the values is greater than zero.
I am sending a HTML string to the Cold Fusion (9) server. The string contains a HTML table with multiple rows. Since the table doesn't have a head I need to change the <td>s of the first row into <th>s.
For your information:
The code to change is a paste code coming from MS Word. The code gets sent to the server to check if there are any tables in it. If yes, there is an option dialog shown to the user where he can descide how the table will be formatted (striped, hovers and so on).
In my opinion the best way to do that would be ReReplace(). But I can't figure what the right regex can be.
Any suggestions on that will be much appreciated.
The code looks like:
<table class="table">
<tbody>
<tr><td>Head 1</td><td>Head 2</td><td>Head 3</td></tr>
<tr><td>Content 1 Row 1</td><td>Content 2 Row 1</td><td>Content 3 Row 1</td></tr>
<tr><td>Content 1 Row 2</td><td>Content 2 Row 2</td><td>Content 3 Row 2</td></tr>
</tbody>
</table>
And should look like:
<table class="table">
<tbody>
<tr><th>Head 1</th><th>Head 2</th><th>Head 3</th></tr>
<tr><td>Content 1 Row 1</td><td>Content 2 Row 1</td><td>Content 3 Row 1</td></tr>
<tr><td>Content 1 Row 2</td><td>Content 2 Row 2</td><td>Content 3 Row 2</td></tr>
</tbody>
</table>
Thanks in advance.
Obligatory warning: maybe a parser or as #npinti suggested changing the output in the first place is a far better way to go.
That being said, you could use a lazy quantifier (expensive!) between the <td> tags and feed the function chunks of <table> parts and substitute it with <th>\2</th> (see the regex 101 demo for an example).
(<td>(.*?)<\/td>)
Hint: This does not take additional attributes into account (e.g. class="test123").
I need to add a column to a table in Spree's Admin backend. There is a data-hook on each <tr>.
So in theory I can insert_top a <td> on each row (and also insert a <th> in the <thead> and a <col> in the <colgroup>).
Is this the best way, or is there a better way?
This is fairly easy to achieve using a few small files with the new .deface DSL. Eg with HAML (assuming Spree::Order has a custom attribute called distributor)
Header:
/ insert_top "[data-hook='admin_orders_index_headers']"
%th
Distributor
Rows:
/ insert_top "[data-hook='admin_orders_index_rows']"
%td.align-center
= order.distributor.name
If you want to alter the column widths, it's often easier just to overwrite the colgroup:
/ replace_contents "table#listing_orders colgroup"
%col{style: "width: 10%"}
...etc
I have an easy question. I'm trying to use coalesce in combination with a group by clause. I want to get 0 values when the variable is null. Here is my sql server code:
SELECT SUM(COALESCE(NETTOTAL,0)) AS NETTOTAL,DATEPART(MM,RECORD_DATE) MONTH
FROM ORDERS WHERE ORDER_EMPLOYEE_ID=#attributes.record_emp_id#
GROUP BY DATEPART(MM,RECORD_DATE) ORDER BY MONTH
.. and my output:
<tr height="20">
<td>Orders</td>
<cfoutput query="get_orders"><td style="text-align:center;">#tlformat(nettotal,2)# - #month#</td></cfoutput>
</tr>
This code is just for the orders. There is also the sales row. Anyway here is the screenshot to make it more clear:
http://i.stack.imgur.com/VIAmr.png
To make it more clear I added the number of the month. As you can see the order is broken since there are no zero values for the other months...
P.S.Thank you all for the help! i really appreciate it!
Your query is not at fault. You are trying to select from ORDERS based on each employee_id. You are then looping over it.
If a given month has no orders, then there will be no row for it within the result set.
Even if there were only orders for the last 4 months, they would get pushed to the first 4 as you are not checking that the month you are currently outputting matches the column header.
For a bit of metacode, I would go down this route
1 - create an array as follows
arrMonths= [
{orders=0,sales=0},
{orders=0,sales=0}....
]
This will give you a stc you can iterate over later.
2 - I would then loop over each query
<cfoutput query="get_orders">
<cfset arrMonths[month].orders = nettotal>
</cfoutput>
3 - I would then iterate over the array
<tr height="20">
<td>Orders</td>
<cfoutput from="1" to="#ArrayLen(arrMonths)#" index="thisMonth">
<td style="text-align:center;">#tlformat(arrMonths[thisMonth].orders,2)# - #thisMonth#</td>
</cfoutput>
</tr>
This way, every month will ALWAYS have a value even if it's 0. You can also ditch the coalesce as the simple fact that rows with no orders have no records means they default to 0 so your query may become
SELECT
SUM(COALESCE(NETTOTAL)) AS NETTOTAL,
DATEPART(MM,RECORD_DATE) MONTH
FROM ORDERS
WHERE ORDER_EMPLOYEE_ID=<cfqueryparam cfsqltype="cf_sql_integer" value="#attributes.record_emp_id#">
GROUP BY DATEPART(MM,RECORD_DATE)
MONTH is now not necessary as it's just inserting into the array which deals with ordering
TRy ISNULL() Instead of COALESCE .
COALESCE is used for multiple argumentsif multiple arguments are not needed you could use ISNULL
Try to invert the order of the functions Sum and Coalesce.
IsNull might be more readable as well:
SELECT IsNull(SUM(NETTOTAL), 0) AS NETTOTAL,
DATEPART(MM, RECORD_DATE) MONTH
FROM ORDERS
WHERE ORDER_EMPLOYEE_ID = #attributes.record_emp_id#
GROUP BY DATEPART(MM, RECORD_DATE)
ORDER BY MONTH
If there are no elements of NETTOTAL, Coalesce from your code would not be called. So a Sum of no rows will be null.