I want to Create a Crystal Report of Paid Sales Invoices - crystal-reports-2016

When a Sales invoice is paid it is matched against the receipt.
A Sales invoice can also be matched against a credit note but there is no distinguishing flag.
I want the final report to only show the Paid invoices.
I am currently Grouping by Customer, then Matching Letter, then document, so at this level you can see if the match is with a receipt or with credit notes.
I output the Group footer of the document giving me a list of documents, which for a customer payment will start with the Receipt, followed by one or more invoices totaling the value of the receipt:
GF4 Customer A Match BC REC101009798 GBP240.00
GF4 Customer A Match BC INV101059389 ‘new field’ GBP120.00
GF4 Customer A Match BC INV101059390 ‘new field’ GBP120.00
If the matching is as a result of a customer payment, the Receipt will always be on the first line in the group output.
How do I create a ’new field’ on the Invoice lines that will say “Paid” , it doesn’t matter if the new field also appears on the Receipt line?
I have tried to use a formula on the group footer referencing the document type but of course when the document type changes, so does the result of the formula.
Having a success on the first line I have been concentrating on trying to copy the result on to the successive lines so thought a fresh pair of eyes might help.
Many thanks

Use Subreport. You can pass inv no or doc type to subreport and get status . Put subreport in invoice line.

Thank you Pals, I have solved this with a colleague.
We revised the formula on the Group Footer. First we created a formula that assigned a 1 to a Receipt and 0 to all other docments: IF {GACCDUDATE.TYP_0} = "REC01" THEN 1 ELSE 0. Next we created a SUM formula: IF Sum({#rowIsPaid}, {GACCENTRYD.MTC_0}) > 0 THEN "Paid"
and put this on the Group footer.

Related

Apex/Salesforce/flow: Be able to increase price and clone/update product automatically

I asked a similar question before but I am still struggling and was not able to do what I was required to do and am coming back to this community for help.
I am trying to increase the price of the products on a quote in salesforce CPQ/Billing based on a field and to do this automatically.
The Setup
In Salesforce CPQ, If you go to account -> Contract -> Sales Service: There is a field called Price Increase %(PROD_Price_Increase__c)
A contract can have multiple quotes
What I want to do
When a quote has reached the final step a contract is created. In the contract I have the option to click a button called Amend. Which allows me to take the products in the existing quotes and amend it.
I want to create a batch job that does the following:
The Contract has these fields: Start Date (PROD_Start_Date__c), Price increase Date (PROD_Increase_Date__c), End Date (PROD_End_Date__c).
-- If the Price Increase Date is 12 months after the start date, these are the contracts that will need to be updated
-- For example, If the start date is 15 Feb 2023, Price increase is 1 Jan 2024, end date is 15 Feb 2025. Since the increase date is not 12 months, these contract should be ignored.
Main Task
When products who have a price increase 12 months after the start date, the contract should be able to 'amend' and update the quantity of the products and clone the products.
In the contract, the action buttons on top have "Amend". once clicked, it shows all the subscriptions products, you click next then it comes into the edit quote page.
Once here it shows all the products that were part of the contract and its quote. The net price filed for the original products will be '0'. These products will need to be cloned and the quantity for these to be applied to the cloned products. Once the quantity has been copied over, the original products quantity should change to 0.
After these products have a quantity of 0, the clone products should have the price increase. The value I mentioned from earlier Price Increase % (ROD_Price_Increase__c) value should be added to the Discount filed in the quote but as a minus value since we are doing an increase of price.
Once this has been done, we can submit/order the quote. This creates a new quote. Once the new quote has been created, I want to be able to update a filed in the quote - a checkbox that says order. I want to be able to check the value on it.
This all should be done automatically like though Apex and Flows.
Sorry for this long text and request. I apologise and know some of the information not be out of box or confusing. Its one of these challenges I have been facing with trying to automate this.

Display all the distinct values in 1 ssrs letter

Hi I am creating an ssrs report (which is a letter format). And in the letter format, if a owner has highest sales for 3 products in same store I need those products to be listed in the same letter instead of 3 different letters. I have written an expression for the body of the letter. But that expression is taking all the products that has highest sales and generating 3 different letters. May I know how can I embed the product names within the body of the letter?
Sample That I need:
Hi Doc,
It has really great that you are making a huge impact on our product sales.
In our recent survey, we found that your store had the highest sales for following products:
Comforters
Cosmetics
Toys
Please continue this xyz.
NA Dept.

Identify elements that do not appear in the period (Google Data Studio)

I have a table that shows the recurrence of purchasing a product, with the columns: product_id, report_date, quantity.
I need to list in a table the products that are more than 50 days unsold. The opposite I managed to do (list those that were sold in the last 50 days) but the opposite logic has not yet been able to implement.
Does anyone have any tips?
An example of the table:
product_id,date,report_date,quantity
329,2019-01-02 08:19:17,2019-01-02 14:34:12,6
243,2019-01-03 09:19:17,2019-01-03 15:34:12,6
238,2019-02-02 08:19:17,2019-03-02 14:34:12,84
170,2019-04-02 08:19:17,2019-04-02 14:34:12,84
238,2019-04-02 08:19:17,2019-04-02 14:34:12,8
238,2019-04-02 08:19:17,2019-04-02 14:34:12,100
238,2019-08-02 08:19:17,2019-08-02 14:34:12,100
238,2019-10-02 08:19:17,2019-10-02 14:34:12,100
170,2020-01-02 08:19:17,2020-01-02 14:34:12,84
170,2020-01-02 08:19:17,2020-01-02 14:34:12,84
There are many steps to do this task. I assume the date column is the one to work with. Your example from table includes duplicated entries. Is it right that at the same time the order is there twice?
So here are the steps:
At first add an calculated field date_past to your dataset:
DATE_DIFF(CURRENT_DATE(),date)
To the dataset add a filter SO_demo with:
include date_past<30
Then blend the data with it self. Use product_id as Join key. Only the 2nd dataset has the SO_demo filter. Add to the dimension of this dataset the calculated field sold_last_30_days with the formula "yes".
In the table/chart to display add a filter on the field include sold_last_30_days is Null.

Summing up values from one column into one row on a different table when joining

I've only had a (frustrating) couple days experience with SQL Server, and I need some help, since I cant find anything related to my question when searching.
For background info, I'm working in an accountancy, and right now I'm trying to create a table for balance statements to use in crystal reports. Each invoice has multiple items, but for the statement I need to sum them all up with the invoice reference being the information that links the group of data that needs to be summarised.
So, what I need is to pull information from one table (dbo.SalesInvItems), this information including the date (InvDate), the due date (InvDueDate), and the customer name (CustomerName). This information stays the same with the Invoice Reference (InvRef), and it's what I want to use to link the two tables.
For example, Invoice Reference: 1478 will always have the date 14/05/18, the due date: 14/06/18 and the customer name: Pen Sellers Ltd.
The same Invoice Reference is used by multiple rows, but the only thing that changes (that I need) is the Invoice Item Total (InvItemTotal).
For example, the one reference will always be addressed to Pen Sellers, but one item has the Total as £13 and another item using the same reference is £20.
The Invoice Item Total is what I need to sum up. I want to add all the Invoice Item Total's together that have the same Invoice Reference, while joining the tables.
Sales Invoices
So when I've inserted the references into the table (sorry they're not the same in both pictures, I was having problems making examples and I made a mistake), I want to grab the information from the Invoice table to fill it in, going from this...
Pre Solution
To this...
Desired Result
The desired location is a table called dbo.Statement.
1.Is this even possible to do?
2.How would I go about doing this?
3.Is there a method I could use that would make sure that every time I insert an Invoice Reference into the Statement table, it would automatically pull out the data needed from the Invoice Table?
If any additional information is needed, just say and I'll do my best to provide it, I have never asked a question on here before and I'm new to SQL Server and coding in general.
Im using SQL Server Management Tool 2017
Thank You
Select item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate
, Sum(item.InvItemTotal) InvAmt
, sum(IsNull(payments.Amount,0)) PayAmount
, Sum(item.InvItemTotal) InvAmt - sum(IsNull(payments.Amount,0)) as Balance
from SalesInvItems item
left join payments -- you didn't define this
on item.InvRef = payments.InvRef
group by item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate
Select item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate
, Sum(item.InvItemTotal) InvAmt
from SalesInvItems item
left join Statement
on item.InvRef = Statement.Reference
group by item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate

Batching Invoices in SSRS - One Invoice per Customer

I have a written an invoice report that bundles up various charges to customers during a month. I have a filter set to a Parameter for a customer code that I am using for testing purposes. The final product, however, I would like to be able to specify a date and have a separate invoice (ideally it's own PDF) generated for each customer. Is this achievable in SSRS?
Notes: Invoice number is a generated field that is a combo of MM-YYYY-CustCode so we don't need a register or some sort of incrementing facility for the invoice number.
Emailing the resulting PDFs to one email address is acceptable so we don't need the system to pull a unique address for each customer.
The selection string from the SQL is as follows (not sure its needed but just in case)
CAST(VP_BSL_OWnerTrn.accountingdate AS DATE) = #accountingdate
AND (VP_BSL_OWnerTrn.code = 'Rental Com'
OR VP_BSL_OWnerTrn.code = 'Mgmt Fee'
OR VP_BSL_OWnerTrn.code = 'Gifts/Amen'
OR VP_BSL_OWnerTrn.code = 'Handling')
AND VP_BSL_OWnerTrn.Price_Local <> 0
AND VP_BSL_OWnerTrn.RoomNo = #RoomNo
Thanks in advance for any help/advice.

Resources