ALD VAT Sum Question

I am a realy newbie regarding to the ALD in Business One.
I am trying to print out at the end of my producttable in my invoice a line like this:
"incl. VAT with Code A2 at 16,00% (for instance) of (the amount of all the lines which are calculated with the Code A2) (and then the sum of the taxes)"
Could you tell me how to describe the function ?
Thanks in advance

I had the same problem. At first it looks as though SAP has already worked upon tax summaries inside ALD, but there was no way to find out how they should work.
One can only shout out loud that, at least with german laws, <b><i>ALD is no use for sales documents as long as it can't produce VAT sums</i></b>.
<u><b>Here's a workaround:</b></u>
1. Create three sum variables for each relevant vat group:
- price before taxation (e.g. "PRICE")
- price after taxation (e.g. "GROSS")
- tax itself (e.g. "VAT")
Example:
Implementing two tax groups, create:
@PRICE1,@PRICE2,@GROSS1,@GROSS2,@VAT1,@VAT2
2. Use conditional accumulation for the sum variables:
Example for a @GROSS1 variable:
if( Belegzeile.Steuerdefinition_VatGroup.Code="A1" , Belegzeile.Preis_inkl__Steuer * Belegzeile.Menge , 0 )
Sorry 'bout the german field names; I'm sure it'll be easy to translate.
3. Create taxation summary in the footer of your table:
- Add one line per tax group.
- Use the corresponding sum variables to print out values.
- Use one of the sum variables for definition of a print condition. Example:
@GROSS1>0
The corresponding VAT sum line will only be printed if there are amounts available in the current document.
That's all!
It's quite easy, but it requires static definition of known tax groups. Sum variables can only be numeric, so there's no way to extract the tax group names from the database for later use.
However, to create a more generic template you can define the group names and codes by user variables. Usage of such "constants" could make adaption of form templates much easier (I use them for tax names and fstring$ format definitions).
====================================
Extension:
If you want to extract the vat percentage rates into sum variables you would have to expand the variable calculations as such (example for sum variable @PERC1):
if(@PERC1=0 and Belegzeile.Steuerdefinition_VatGroup.Code="A1",Belegzeile.USt__Prozentsatz_pro_Zeile,0)
@PERC_A1 will only be accumulated once and takes over a single desired value.
<i>keywords: "advanced layout designer" tax taxation "tax summary" "vat summary" vat invoice legal</i>

Similar Messages

  • VAT SUM AVAILABLE ON PRINT DOCUMENT

    Hello
    I have a question regarding VAT and PLD
    Does anyone knows how to see at the end of the report the sum of each VAT category at item level
    Say one item is 5.5%
    One item 19.6% I would like to have the sum at teh bottom of all 5.5% and all 19.6% I can not figure out what way to do it in PLD
    Thank you for your help

    hi dealone,
    Check this links
    https://forums.sdn.sap.com/click.jspa?searchID=19650249&messageID=5735635
    https://forums.sdn.sap.com/click.jspa?searchID=19650368&messageID=4534547
    https://forums.sdn.sap.com/click.jspa?searchID=19650368&messageID=4422384
    https://forums.sdn.sap.com/click.jspa?searchID=19650368&messageID=5599714
    https://forums.sdn.sap.com/click.jspa?searchID=19650368&messageID=5083227
    Jeyakanthan

  • SSRS expression sum question

    I want to add a column after Total lets say..'Progress' where Progress = sum(Actual)/sum(Budget)
    The only filter on Progress is to consider only those values from months where both Actual and Budget are present.
    So, e.g.
    For first row: 0/0 = 0
    For second row: 0/0 = 0
    For third row: 28334/67060(instead of 200511) = 0
    if there would have been an Actual value for the month of August e.g. 100, then (28334+100)/(67060+66614)
    For fourth row: 0/0 = 0
    How can I achieve this using expressions in SSRS?
    Thanks in advanc

    Hi rockstar283,
    As per my understanding, you want to add a column names Progress, it is calculated from the values of Actual and Budget. In current month, Progress = sum(Actual)/sum(Budget), else, it is set to 0. If so, please refer to the following expression:
    =IIF(Month(Fields!pmonth.Value)=Month(Today()),Sum(Fields!Actual.Value),0)/IIF(Sum(Fields!budget.Value)=0,1,Sum(Fields!budget.Value))
    The following screenshot is for your reference:
    If my understanding is not correct, please feel free to let me know. I would appreciate it if you could give us detailed description of your requirements, it’s also better to provide the table structure and some sample data. It will help us move more quickly
    toward a solution.
    Thanks,
    Wendy Fu

  • SUM-question

    Hi
    I should be able to get this myself, but I dont...  :(
    From one page/gallery I pick out Products, With a Price and a number of how many of each. Those are stored into Collection.
    The on an another page I show this Collection in a gallery called "Tilbudslisten". And for each Product I sum the total cost for that Product With this: Text(Sum(ThisItem!Price*ThisItem!AntallEnheter!Text),"Kr #.##")  (this is the
    code in the cell "Price")
    Then, at the end of that page I want to show the total amounth. I've tried different code, like this:
    Sum(Tilbudslisten!AllItems!Price)  and
    Sum(Tilbudslisten!Price)   and Sum(Tilbudslisten!Price!Value)  etc....  But With no Luck....
    So, this is the last piece in my latest demo/prortype.... - So please... - anybody? 
    Best regards Terje F - Norway www.profo.no

    Hello Terje,
    Assuming that Tilbudslisten is your collection name it should be as a simple label outside your gallery with
    Sum(Tilbudslisten,Antal*Price)
    will do the trick.
    You can do the same in each item of the gallery too.
    That will allow you to add some funky statistics to show how much percentage that item is in the total sum
    Regards
    StonyArc
    http://www.stonyarc.com http://www.xboxlivenation.com

  • Sql sum question

    I need to produce a CF report only showing the top five
    suppliers, plus other information.
    I count each supplier, with group by, then sum the count,
    with group by, to get the total occurrances of each supplier. My
    query/subquery is something like this :
    select sum(supplierCount) as totalCount, supplier
    from
    select count(supplier) as suppliercount, supplier
    from table
    group by supplier
    ) as a
    group by supplier
    order by supplier
    This appears to work and gives me the total occurrances of
    each supplier. I can then select the top 5. Howver, when I start
    including the other columns, the count/sum does not seem to work
    anymore and becomes 1 for each supplier. I even tried usign QofQ
    and that did not work.
    How can I write the query to give me the total number of
    occurrances of each supplier, in addition to having the other
    columns on the report ?

    if you were using mysql as your db, your current query would
    have worked
    just fine with any other columns you added - mysql does not
    require the
    query to be grouped by ALL non-aggregate columns, one is
    enough.
    in your case, i think you will need to have 2 queries and
    then combine
    then with a QoQ.
    something like (untested):
    <!--- get top 5 suppliers with unique supplier id --->
    <cfquery name="top5suppliers" ...>
    SELECT TOP 5 COUNT(supplier_id) AS supplierCount, supplier_id
    FROM table
    GROUP BY supplier_id
    ORDER BY COUNT(supplier_id) DESC
    </cfquery>
    <!--- store top 5 supplier ids in a list --->
    <cfset supplier_id_list =
    valuelist(top5suppliers.supplier_id)>
    <!--- get all other data for top 5 suppliers --->
    <cfquery name="top5suppliersData" ...>
    SELECT supplier_id, ....
    FROM suppliers_table
    WHERE supplier_id IN (#supplier_id_list#)
    </cfquery>
    <!--- combine data using QoQ --->
    <cfquery name="suppliersFullData" dbtype="query">
    SELECT top5suppliers.supplierCount, top5suppliersData.*
    FROM top5suppliers, top5suppliersData
    WHERE top5suppliers.supplier_id =
    top5suppliersData.supplier_id
    ORDER BY supplierCount DESC
    </cfquery>
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Xsl sum question

    hi all,
    I'm trying to find the sum of a specific set of nodes and my sum statement looks like this:
    <xsl:value-of select="sum(//row[*[name=$sortDefault]/month=$currentMonth]/obligation)"/>
    This will sum up all the obligation nodes of all the rows that have $sortDefault as the name of the node and their month node equal to $currentMonth, however, I need the rows to have their year node equal to $currentYear also, is there any way i can add that criteria into that statement, month and year nodes are siblings, thanks in advance.

    this is what my xml looks like:
    <row>
    <row>
    <r_object_id>0000FE3451024</r_object_id>
    <kex_agreement>service agreement</kex_agreement>
    - <kex_date date="20050407">
    <fulldate>4/7/05 4:03 PM</fulldate>
    <year>2005</year>
    <month>04</month>
    <day>07</day>
    </kex_date>
    <agreement_name>5</agreement_name>
    <obligation>300</obligation>
    </row>

  • Summing questions from a newbie

    Hi there. I have 3 parent/child tables: Projects (can have many...) Purchase Orders (can have many...) Purchase Order Items.
    I want to see Project Name and total of all purchase orders. I total a purchase order by summing the items in the purchase order.
    Here's my attempt:
    SELECT distinct Proj.ID, Proj.TXTNAME,
    (SELECT sum(NUMSUBTOTAL) POAmount
    from FAC_PURCHASE_ORDER_ITEMS POI, FAC_PURCHASE_ORDERS PO, FAC_PROJECTS Proj
    where PO.PROJECTID = Proj.ID
    and POI.PURCHASEORDERID = PO.ID) Amount
    FROM FAC_PURCHASE_ORDERS PO, FAC_PROJECTS Proj
    WHERE PO.PROJECTID = Proj.ID
    Here is what I get:
    ID TXTNAME AMOUNT
    23 New Office for Darby 3036
    42 Move 1 staff in Portfolio 3036
    65 Remove poplars 3036
    121 Additional 5 cubes required in corporate systems area 3036
    129 test2 3036
    Why am I getting the same amount for each project?
    Am I doing the right thing by embedding the one sql select inside the other?
    I'd appreciate any help! thank you!
    ~Darby

    Hi, Darby,
    Whenever you have a problem involving a sub-query, it helps to run the sub-query by itself, to see what it does.
    In your case, you have a scalar sub-query that computes amount:
    SELECT sum(NUMSUBTOTAL) POAmount
    from    FAC_PURCHASE_ORDER_ITEMS POI
    ,       FAC_PURCHASE_ORDERS PO
    ,       FAC_PROJECTS Proj
    where   PO.PROJECTID = Proj.ID
    and     POI.PURCHASEORDERID = PO.IDWithout having your tables and your test data I can't actually run it, but it looks like it's getting the grand total for all Projects and all Purchase Orders. There's nothing limiting the sub-query to a particular Project or Purchase Order. (The WHERE-clause seems to consist entirely of join conditions.)
    If you want to continue using a scalar sub-query, you should corellate the main query to the sub-query, so the sub-query will only look at the Project (or Purchase Order: see note at the end of the message) being computed in the main query, like this:
    SELECT distinct
            MainProj.ID
    ,       MainProj.TXTNAME
    ,       (       -- Begin scalar sub-query to compute amount
            SELECT sum(NUMSUBTOTAL) POAmount
            from    FAC_PURCHASE_ORDER_ITEMS POI
            ,       FAC_PURCHASE_ORDERS PO
            ,       FAC_PROJECTS Proj
            where   PO.PROJECTID = Proj.ID
            and     POI.PURCHASEORDERID = PO.ID
            AND     proj.id = MainProj.id   -- Corellation to main query
            ) Amount
    FROM    FAC_PURCHASE_ORDERS PO
    ,       FAC_PROJECTS MainProj
    WHERE   PO.PROJECTID = MainProj.IDNotice I changed the table alias in the main query from proj to mainproj. That way, you can keep the table alias proj in the sub-query, and have a unique name for each one, in order to do the corellation.
    (Actually, there's no need to reference the fac_projects table in the sub-query at all, since the project id is in the fac_purchase_orders table, and there's no need to reference the fac_purchase_orders table in the main query at all.)
    But I think there's a much better way.
    I think it would be simpler and more efficient not to do a scalar sub-query at all.
    The problem with the original sub-query was that it was producing the grand total for all Projects, all lumped together. The fix above makes it return the total for one Project at at time. If we turn it into a GROUP BY query, as shown below, it will return the total for each Project on a separate line.
    SELECT proj.id
    ,       MAX (txtname)
    ,       sum(NUMSUBTOTAL) POAmount
    from    FAC_PURCHASE_ORDER_ITEMS POI
    ,       FAC_PURCHASE_ORDERS PO
    ,       FAC_PROJECTS Proj
    where   PO.PROJECTID = Proj.ID
    and     POI.PURCHASEORDERID = PO.ID
    GROUP BY  proj.id
    ORDER BY  proj.idThis is un-tested. If you would have posted some sample data, I could have tested it.
    NOTE:
    I'm not sure if you want one line of output per Project or one line per Purchase Order. Everything above assumes you want one line per Project, but it's easy to modify if you want one line per Purchase Order.

  • Another Sum Question

    Hey Guys,
    I've got a little bit different of a sum situation here. I'm
    working with the following XML:
    <rider id="1">
    <name>john doe</name>
    <round1>20</round1>
    <round2>12</round2>
    <round3>14</round3>
    <round4></round4>
    <round5></round5>
    <round6></round6>
    <round7></round7>
    <round8></round8>
    </rider>
    I've got 20-30 different riders listed in the XML. I want to
    of course calculate the total from each "round" tag. The following
    code isn't quite working, and it's because I'm not referencing
    "round1-8" correctly. Here it is:
    function sumIt(i) {
    var total = 0;
    var x = 0;
    var num_rounds = 8;
    var rider_total = 0;
    for (x = 0; x < i; x++) { // length of data set
    for (y = 0; y < num_rounds; y++) { // loop through each
    round node
    rider_total += (dsPoints.getData()[x]["round1"]);
    alert(rider_total);
    This line is the issue:
    rider_total += (dsPoints.getData()[x]["round1"]);
    I tried "rider_total += (dsPoints.getData()[x]["round"][y]),
    but that is incorrect. And after that, I'm unsure how to store all
    the total data - whether to use an array or another way that might
    work better.
    Any ideas?
    Thanks.

    To further complicate things :) .. If we get this working to
    calculate the total for each rider, it would be logical to then
    sort the data based on the total. I'm guessing there isn't a way to
    sort the data by total, but only by values within the XML. ie:
    var ds = new Spry.Data.XMLDataSet("data.xml",
    "/points/point", { sortOnLoad: "round1", sortOrderOnLoad:
    "descending"});
    So there the results are sorted based on round1 values. Being
    able to dynamically caculate the total loses it's importance if we
    can't sort the data based on that, from the onload call. Does that
    make sense?
    Thanks again everyone.

  • My latest questions

    Hi Guys!!
    Saved up sum questions for my fave Berries! 
    1.  While loading web pages, does putting the BB in it's case affect the download time?   Also, does the backlight timing out have any affect?
    2.  How many drops on a hard floor can a BB survive?
    3.  Does keeping old emails and text messages affect performance of the BB?
    4.  I know that crackly audio is an issue...internet radio does this on mine.  Are there any updates on this problem?
    Much love and junk,
    Steph

    Hello there, Subhi.sa.
    Just wanted to second Niel's recommendation. Additionally this Knowledge Base article also provides some steps you can take yourself if you don't remember your security questions:
    Apple ID: All about Apple ID security questions
    http://support.apple.com/kb/HT5665
    What should I do if I don't remember the answers to my Apple ID security questions?
    Try answering them at least once to see if you can get them right, even if you are not sure you remember the answers to your security questions.
    If you are confident you can't remember them, try one of the following:
    If you have three security questions and a rescue email addresssign in to My Apple ID and select the Password and Security tab to send an email to your rescue email address to reset your security questions and answers. 
    If you have one security question and you know your Apple ID passwordsign in to My Apple ID and select the Password and Security tab to reset your security question.
    If you have one security question, but don't remember your Apple ID passwordcontact Apple Support for assistance. Learn more about creating a temporary support PIN to help Apple confirm your identity when you contact Apple Support.
    Note: If you have forgotten your password and answer your security questions incorrectly too many times in a row, you will be unable to try to answer your security questions for a period of time. During that time you will not be able to reset your password and will not have access to your account.
    Thanks for reaching out to us on the Apple Support Communities.
    Cheers,
    Pedro D.

  • Dublicate Value In HTML PL/SQL Report

    hi,
    i have to enter item name and item Price iinto transaction_details by using a form and labour Work, labour amount into LAB_WORK_DTL table using a form .
    Now Problem is when i fetch these value in to PL/SQL Report then it's shows me double value like My Total Amount is 100 Then It show Me 200 and if there is two Values eg A , B then in report it's shows me A ,B , A, B, these two Value Shows Me in four Rows .How can i remove Dublicate Values .Why it does show me that double value . My code is below
    How can i remove this problem .
    declare
    SA NUMBER;
    tot number;
    TH NUMBER;
    va number;
    am number;
    lst number;
    tst number;
    st NUMBER;
    cursor c2 is select
    T.VAT,
    SUM(T.AMOUNT) AMOUNT,
    SUM(T.VAT_AMOUNT) VAT_AMOUNT
    from transaction_details T FULL JOIN LAB_WORK_DTL L
    ON T.BILL_NO = L.BILL_NO
    WHERE T.BILL_NO = :P27_BILL_NO
    GROUP BY T.bill_no,t.vat, T.bill_date, T.vehicle_no, T.PARTY_NAME;
    BEGIN
    FOR x IN(SELECT t.item_name, t.qty,t.rate, t.bill_no
    FROM transaction_details t,LAB_WORK_DTL l where t.bill_no=l.bill_no(+) and t.bill_no=:p27_bill_no
    LOOP
    HTP.P('<tr>
    <td width="2%"> </td>
    <td width="55%" align="left"> '|| HTF.escape_sc (x.item_name)||'</td>
    <td width="15%" ALIGN="right">'|| HTF.escape_sc (x.qty)||'</td>
    <td width="15%" ALIGN="right">'|| HTF.escape_sc (x.rate)||'</td>
    <td width="25%" ALIGN="right">'|| HTF.escape_sc (x.qty)* HTF.escape_sc (x.rate)||'
    </td>
    </tr>');
    END LOOP;
    tot:=0;
    bc:=0;
    KA:=0;
    open c2;
    loop
    FETCH c2 INTO va,am,vat_am;
    exit when c2%notfound;
    tot:=nvl(tot+am,0);
    bc:=nvl(bc+vat_am,0);
    end loop;
    close c2;
    HTP.P('<tr>
    <td width="38">  </td>
    <td width="29"> </td>
    <td width="447"> </td>
    <td>  </td>
    <td width="173">
    <p align="Right">-------------------</td>
    </tr>
    <tr>
    <td width="38"> </td>
    <td width="447"> TOTAL</td>
    <td> </td>
    <td width="95"></td>
    <td width="172">
    <p align="right">'
    || nvl(HTF.escape_sc (tot),0)
    ||'</td>
    </tr>');
    </table></body>
    </html>');
    END;
    Thanks
    Manoj Kaushik
    Edited by: Manoj Kaushik on Apr 8, 2010 11:01 PM

    hi,
    this is my Complete Code But I facing Dublicate Value Error .
    In that Code In Total Amount Of All Item Price Show me Jus Double.
    How Can I remove it.
    declare
    a number;
    bd date;
    b varchar2(20);
    c varchar2(50);
    d varchar2(50);
    e varchar2(50);
    f varchar2(50);
    g varchar2(50);
    h varchar2(4000);
    la NUMBER;
    p NUMBER;
    SA NUMBER;
    K NUMBER;
    FA NUMBER;
    HA NUMBER;
    KA NUMBER;
    KH NUMBER;
    MA NUMBER;
    cnt NUMBER;
    tot number;
    l number;
    TH NUMBER;
    FS NUMBER;
    va number;
    am number;
    vat_am number;
    bc NUMBER;
    lst number;
    tst number;
    st NUMBER;
    c_tra number;
    c_lab number;
    cursor c1 is select T.bill_no,T.bill_date,T.vehicle_no,T.PARTY_NAME
           from  transaction_details T FULL JOIN LAB_WORK_DTL L
    ON    T.BILL_NO = L.BILL_NO
    WHERE T.BILL_NO = :P27_BILL_NO
    GROUP BY T.bill_no, T.bill_date, T.vehicle_no, T.PARTY_NAME;
    cursor c2 is select
           T.VAT,
           SUM(T.AMOUNT) AMOUNT,
           SUM(T.VAT_AMOUNT) VAT_AMOUNT
    from  transaction_details T FULL JOIN LAB_WORK_DTL L
    ON    T.BILL_NO = L.BILL_NO
    WHERE T.BILL_NO = :P27_BILL_NO
    GROUP BY T.bill_no,t.vat, T.bill_date, T.vehicle_no, T.PARTY_NAME;
    cursor c3 is select L.service_tax,SUM(L.LABOUR_AMT) LABOUR_AMT,
           SUM(L.SERVICE_TAX_AMT) SERVICE_TAX_AMT
    from  transaction_details T FULL JOIN LAB_WORK_DTL L
    ON    T.BILL_NO = L.BILL_NO
    WHERE T.BILL_NO = :P27_BILL_NO
    GROUP BY T.bill_no,L.service_tax, T.bill_date, T.vehicle_no, T.PARTY_NAME;
    cursor c4 is select
           T.VAT,
           SUM(T.AMOUNT) AMOUNT,
           SUM(T.VAT_AMOUNT) VAT_AMOUNT
    from  transaction_details T FULL JOIN LAB_WORK_DTL L
    ON    T.BILL_NO = L.BILL_NO
    WHERE T.BILL_NO = :P27_BILL_NO
    GROUP BY T.bill_no,t.vat, T.bill_date, T.vehicle_no, T.PARTY_NAME;
    cursor c5 is select L.service_tax,SUM(L.LABOUR_AMT) LABOUR_AMT,
           SUM(L.SERVICE_TAX_AMT) SERVICE_TAX_AMT
    from  transaction_details T FULL JOIN LAB_WORK_DTL L
    ON    T.BILL_NO = L.BILL_NO
    WHERE T.BILL_NO = :P27_BILL_NO
    GROUP BY T.bill_no,L.service_tax, T.bill_date, T.vehicle_no, T.PARTY_NAME;
    BEGIN
    select chasis_no,ENGINE_NO,MAKE,MILEAGE into c,d,e,f from VEHICLE_DETAILS where vehicle_no =:P27_VEHICLE_NO;
    select ADDRESS into h from PARTY_DETAILS where PARTY_NAME =:p27_PARTY_NAME;
    open c1;
    FETCH c1 INTO a,bd,b,g;
    htp.p('<html>
    <body leftmargin="0" rightmargin="0">
    <table border="1" width="100%" bordercolorlight="#003366" cellspacing="0" bordercolordark="#003366" id="table1">
         <tr>
              <td colspan="2">
              <table border="1" width="100%" cellspacing="0" cellpadding="0" id="table3">
                   <tr>
                        <td width="50"> </td>
                        <td width="21"> </td>
                        <td> </td>
                   </tr>
    <tr>
    <td width="50"><b>
    </b></td>
    <td width="21"><b></b></td>
    <td align ="left">
    <font size="4" face="Arial Black">'||HTF.escape_sc(g)||'</font></td>
                   </tr>
                   <tr>
                        <td width="50"> </td>
                        <td width="21"> </td>
                        <td> </td>
                   </tr>
                   <tr>
         <td width="50"><b>
         </b></td>
                   <td width="60"><b></b></td>
    <td rowspan="4">
    <font size="4" face="Arial Black">'||HTF.escape_sc(h)||'</font></td>
                   </tr>
                   <tr>
                        <td width="50"> </td>
                        <td width="21"> </td>
                   </tr>
                   <tr>
                        <td width="50"> </td>
                        <td width="21"> </td>
                   </tr>
                   <tr>
                        <td width="50"> </td>
                        <td width="21"> </td>
                   </tr>
              </table>
              </td>
              <td width="44%" colspan="3">
              <table border="1" width="100%" cellspacing="0" cellpadding="0" id="table4">
                   <tr>
                        <td width="53"> </td>
                        <td width="104"><b></b></td>
                        <td width="10"></td>
                        <td ><font size="5" face="Arial Black">     ' || HTF.escape_sc(a) ||'</font> </td>
                   </tr>
                   <tr>
                        <td width="53"> </td>
                        <td width="104"><b></b></td>
                        <td width="10"></td>
         <td ><font size="5" face="Arial Black">     ' || HTF.escape_sc(bd) ||'</font></td>
                   </tr>
                   <tr>
                        <td width="53"> </td>
                        <td width="104"><b>
                        </b></td>
                        <td width="10"></td>
              <td ><font size="5" face="Arial Black">     '|| HTF.escape_sc(b) ||'</font> </td>
                   </tr>');
    CLOSE c1;
                   htp.p('<tr>
                        <td width="53"> </td>
                        <td width="104"><b>
                        </b></td>
                        <td width="10"></td>
         <td ><font size="5" face="Arial Black">     ' || HTF.escape_sc (c) ||'</font></td>
                   </tr>
                   <tr>
                        <td width="53"> </td>
                        <td width="104"><b>
                        </b></td>
                        <td width="10"><b></b></td>
                        <td ><font size="5" face="Arial Black">     ' || HTF.escape_sc (d) ||'</font></td>
                   </tr>
                   <tr>
                        <td width="53"> </td>
                        <td width="104"><b>
                        </b></td>
                        <td width="10"><b></b></td>
                        <td ><font size="5" face="Arial Black">     ' || HTF.escape_sc (e) ||'</font></td>
                   </tr>
                   <tr>
                        <td width="53"> </td>
                        <td width="104"><b>
                        </b></td>
                        <td width="10"><b></b></td>
                        <td ><font size="5" face="Arial Black">     ' || HTF.escape_sc (f) ||'</font></td>
                   </tr>
              </TABLE>
              </td>
         </tr>
    <tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
    <tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
    <tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
    <tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr>
    select count(*) into c_tra from transaction_details  where bill_no=:p27_bill_no;
    select count(*) into c_lab from lab_work_dtl  where bill_no=:p27_bill_no;
    if c_tra>0 and c_lab=NULL then
    FOR x IN(SELECT distinct t.item_name, t.qty,t.rate, t.bill_no
    FROM transaction_details t,LAB_WORK_DTL l  where t.bill_no=l.bill_no(+) and t.bill_no=:p27_bill_no
    LOOP
         HTP.P('<tr>
              <td width="2%"> </td>
              <td width="55%"  align="left"> '|| HTF.escape_sc (x.item_name)||'</td>
              <td width="15%" ALIGN="right">'|| HTF.escape_sc (x.qty)||'</td>
              <td width="15%" ALIGN="right">'|| HTF.escape_sc (x.rate)||'</td>
              <td width="25%" ALIGN="right">'|| HTF.escape_sc (x.qty)* HTF.escape_sc (x.rate)||'
              </td>
         </tr>');
    END LOOP;
    tot:=0;
    bc:=0;
    KA:=0;
    open c2;
    loop
    FETCH c2 INTO va,am,vat_am;
    exit when c2%notfound;
    tot:=nvl(tot+am,0);
    bc:=nvl(bc+vat_am,0);
    end loop;
    close c2;
    KA :=nvl(tot+bc,0);
    HTP.P('<tr>
    <td width="38">  </td>
    <td width="29"> </td>
    <td width="447"> </td>
    <td>  </td>
    <td width="173">
    <p align="Right">-------------------</td>
    </tr>
    <tr>
    <td width="38"> </td>
    <td width="447"> TOTAL</td>
    <td> </td>
    <td width="95"></td>
    <td width="172">
    <p align="right">'
    || nvl(HTF.escape_sc (tot),0)
    ||'</td>
    </tr>');
    open c4;
    loop
    FETCH c4 INTO va,am,vat_am;
    exit when c4%notfound;
    HTP.P('<tr>
    <td width="38">  </td>
    <td width="446"> VAT  '||nvl(HTF.escape_sc (va),0)||'% OF Rs.'||nvl(HTF.escape_sc (am),0)||'</td>
    <td width="116"> </td>
    <td></td>
    <td width="172">
    <p align="right">'
    || nvl(HTF.escape_sc (vat_am),0)
    ||'</td>
    </tr>');
    end loop;
    CLOSE c4;
    HTP.P('<tr>
    <td>  </td>
    <td width="30">  </td>
    <td width="118">  </td>
    <td width="95"> </td>
    <td width="173">
    <p align="Right">------------------</td>
    </tr>
    <tr>
    <td>  </td>
    <td width="446" align="left"> TOTAL</td>
    <td width="118"> </td>
    <td width="95"></td>
    <td width="173">
    <p align="right">'
    || nvl(HTF.escape_sc (KA),0)
    ||'</td>
    </tr>
    <tr>
    <td>  </td>
    <td width="446" align="left"> LABOUR CHARGES :-</td>
    <td width="118"> </td>
    <td width="95"></td>
    <TD width="173"></td>
    </tr>');
    elsif c_lab>0 and c_tra=NULL THEN
    FOR Y IN(SELECT l.WORK_DETAIL,l.LABOUR_AMT
    FROM transaction_details t,LAB_WORK_DTL l WHERE t.bill_no(+) =l.bill_no and l.bill_no =:P27_BILL_NO
    LOOP
         HTP.P('<tr>
    <td>  </td>
    <td width="446" align="left"> '||nvl(HTF.escape_sc (Y.WORK_DETAIL),0)||'</td>
    <td width="118"> </td>
    <td width="95"></td>
    <td width="173">
    <p align="right">'|| nvl(HTF.escape_sc(Y.LABOUR_AMT),0)||'</td>
    </tr>');
    END LOOP;
    HTP.P('
    <TR>
    <td>  </td>
    <td width="30"> </td>
    <td width="118"> </td>
    <td width="95"></td>
    <td width="173">  </td>
    </tr>');
    HTP.p ( '<tr>
    <td width="36">  </td>
    <td width="445"> </td>
    <td>  </td>
    <td width="97"> </td>
    <td width="172">
    <p align="Right">------------------</td>
    </tr>');
    sa:=0;
    lst:=0;
    open c3;
    loop
    FETCH c3 INTO st,la,p;
    exit when c3%notfound;
    sa:=nvl(sa+la,0);
    lst:=nvl(lst+p,0);
    end loop;
    close c3;
    TH:=nvl(sa+lst,0);
    FS:=KA+TH;
         htp.p('<tr>
    <td width="36">  </td>
    <td width="445"> TOTAL</td>
    <td> </td>
    <td width="97"></td>
    <td width="172">
    <p align="right">'
    ||nvl(ROUND(HTF.escape_sc (sa),2),0)
    ||'</td>
    </tr>');
    open c5;
    loop
    FETCH c5 INTO st,la,p;
    exit when c5%notfound;
    htp.p('<tr>
    <td width="36">  </td>
    <td width="445"> SERVICE TAX '||nvl(HTF.escape_sc (st),0)||' OF Rs.'||nvl(ROUND(HTF.escape_sc (la),2),0)||'</td>
    <td> </td>
    <td width="97"></td>
    <td width="172">
    <p align="right">'
    || nvl(ROUND(HTF.escape_sc(p),2),0)
    ||'</td>
    </tr>');
    end loop;
    close c5;
    htp.p('<tr>
    <td width="36">  </td>
    <td width="445"> </td>
    <td>  </td>
    <td width="97"> </td>
    <td width="172">
    <p align="Right">------------------</td>
    </tr>');
    htp.p('<tr>
    <td width="36">  </td>
    <td width="445" align="left"> BILL AMOUNT</td>
    <td> </td>
    <td width="97"></td>
    <td width="172" align="right">
    <p >'||ROUND(HTF.escape_sc (FS),2)||'</td>
    </tr>
    <tr>
    <td width="36">  </td>
    <td width="445">
    <p align="left"> '|| f_words(HTF.escape_sc (FS))||'</td>
    <td>  </td>
    <td width="97"> </td>
    <td width="172">
    <p align="Right">------------------</td>
    </tr>');
    ELSE
    FOR x IN(SELECT t.item_name, t.qty,t.rate, t.bill_no
    FROM transaction_details t where t.bill_no=:p27_bill_no
    LOOP
         HTP.P('<tr>
              <td width="2%"> </td>
              <td width="55%"  align="left"> '|| HTF.escape_sc (x.item_name)||'</td>
              <td width="15%" ALIGN="right">'|| HTF.escape_sc (x.qty)||'</td>
              <td width="15%" ALIGN="right">'|| HTF.escape_sc (x.rate)||'</td>
              <td width="25%" ALIGN="right">'|| HTF.escape_sc (x.qty)* HTF.escape_sc (x.rate)||'
              </td>
         </tr>');
    END LOOP;
    tot:=0;
    bc:=0;
    KA:=0;
    open c2;
    loop
    FETCH c2 INTO va,am,vat_am;
    exit when c2%notfound;
    tot:=nvl(tot+am,0);
    bc:=nvl(bc+vat_am,0);
    end loop;
    close c2;
    KA :=nvl(tot+bc,0);
    HTP.P('<tr>
    <td width="38">  </td>
    <td width="29"> </td>
    <td width="447"> </td>
    <td>  </td>
    <td width="173">
    <p align="Right">-------------------</td>
    </tr>
    <tr>
    <td width="38"> </td>
    <td width="447"> TOTAL</td>
    <td> </td>
    <td width="95"></td>
    <td width="172">
    <p align="right">'
    || nvl(HTF.escape_sc (tot),0)
    ||'</td>
    </tr>');
    open c4;
    loop
    FETCH c4 INTO va,am,vat_am;
    exit when c4%notfound;
    HTP.P('<tr>
    <td width="38">  </td>
    <td width="446"> VAT  '||nvl(HTF.escape_sc (va),0)||'% OF Rs.'||nvl(HTF.escape_sc (am),0)||'</td>
    <td width="116"> </td>
    <td></td>
    <td width="172">
    <p align="right">'
    || nvl(HTF.escape_sc (vat_am),0)
    ||'</td>
    </tr>');
    end loop;
    CLOSE c4;
    HTP.P('<tr>
    <td>  </td>
    <td width="30">  </td>
    <td width="118">  </td>
    <td width="95"> </td>
    <td width="173">
    <p align="Right">------------------</td>
    </tr>
    <tr>
    <td>  </td>
    <td width="446" align="left"> TOTAL</td>
    <td width="118"> </td>
    <td width="95"></td>
    <td width="173">
    <p align="right">'
    || nvl(HTF.escape_sc (KA),0)
    ||'</td>
    </tr>
    <tr>
    <td>  </td>
    <td width="446" align="left"> LABOUR CHARGES :-</td>
    <td width="118"> </td>
    <td width="95"></td>
    <TD width="173"></td>
    </tr>');
    FOR Y IN(SELECT l.WORK_DETAIL,l.LABOUR_AMT
    FROM LAB_WORK_DTL l where l.bill_no =:P27_BILL_NO
    LOOP
         HTP.P('<tr>
    <td>  </td>
    <td width="446" align="left"> '||nvl(HTF.escape_sc (Y.WORK_DETAIL),0)||'</td>
    <td width="118"> </td>
    <td width="95"></td>
    <td width="173">
    <p align="right">'|| nvl(HTF.escape_sc(Y.LABOUR_AMT),0)||'</td>
    </tr>');
    END LOOP;
    HTP.P('
    <TR>
    <td>  </td>
    <td width="30"> </td>
    <td width="118"> </td>
    <td width="95"></td>
    <td width="173">  </td>
    </tr>');
    HTP.p ( '<tr>
    <td width="36">  </td>
    <td width="445"> </td>
    <td>  </td>
    <td width="97"> </td>
    <td width="172">
    <p align="Right">------------------</td>
    </tr>');
    sa:=0;
    lst:=0;
    open c3;
    loop
    FETCH c3 INTO st,la,p;
    exit when c3%notfound;
    sa:=nvl(sa+la,0);
    lst:=nvl(lst+p,0);
    end loop;
    close c3;
    TH:=nvl(sa+lst,0);
    FS:=KA+TH;
         htp.p('<tr>
    <td width="36">  </td>
    <td width="445"> TOTAL</td>
    <td> </td>
    <td width="97"></td>
    <td width="172">
    <p align="right">'
    ||nvl(ROUND(HTF.escape_sc (sa),2),0)
    ||'</td>
    </tr>');
    open c5;
    loop
    FETCH c5 INTO st,la,p;
    exit when c5%notfound;
    htp.p('<tr>
    <td width="36">  </td>
    <td width="445"> SERVICE TAX '||nvl(HTF.escape_sc (st),0)||' OF Rs.'||nvl(ROUND(HTF.escape_sc (la),2),0)||'</td>
    <td> </td>
    <td width="97"></td>
    <td width="172">
    <p align="right">'
    || nvl(ROUND(HTF.escape_sc(p),2),0)
    ||'</td>
    </tr>');
    end loop;
    close c5;
    htp.p('<tr>
    <td width="36">  </td>
    <td width="445"> </td>
    <td>  </td>
    <td width="97"> </td>
    <td width="172">
    <p align="Right">------------------</td>
    </tr>
    <tr>
    <td width="36">  </td>
    <td width="445" align="left"> BILL AMOUNT</td>
    <td> </td>
    <td width="97"></td>
    <td width="172" align="right">
    <p >'||ROUND(HTF.escape_sc (FS),2)||'</td>
    </tr>
    <tr>
    <td width="36">  </td>
    <td width="445">
    <p align="left"> '|| f_words(HTF.escape_sc (FS))||'</td>
    <td>  </td>
    <td width="97"> </td>
    <td width="172">
    <p align="Right">------------------</td>
    </tr>');
    END IF;
    HTP.P('</table>
    </body>
    </html>');
    END;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

  • Transfer posting of tax in a cross company code transaction

    Has anyone used the program RFBUST10, that transfer postings of tax in cross company code transactions?  If so , can you give some detail in how to populate the table TBUVTX in config?  There is not much documentation on this  -
    Thanks Pavi

    Adi  -
    That works as you say -
    I have also awarded points as you have been extremely helpful and i very much appreciate your input.
    We use i/c customers and vendors for our obya i/c auto post and that looks to be an issue here with the program generated postings for the tax items.   
    I have some additional VAT related questions- would you be willing to consult further with me briefly? I have a couple of questions around processes that you have seen used in the EU.  For example - if we use cust/vendors in our obya config and that prevents us from using rfbust to shift taxes between co codes (?), have you seen companies just use rfbust to calculate the amounts and then make some type of month end journal entry upload ? 
    Thanks ,Pavi

  • SAP failover clustering on windows 2008 r2.

    Dear Expert,
    I want to configure SAP failover clustering for Production Server. I hard sum questions
    1. How to configure SAP failover clustering on server?
    2. What is server requirement for SAP failover clustering?
    3. What is prerequisites?
    We are doing first time, so we need help?  How to do this task. Can someone give me step by step document with screen shot?
    as We have ECC 6.0 EHP5 Installed in Windows Server 2008 R2 and Oracle 10.2.0.5.0 as our DB.
    can anyone share me some helpful documents or links regarding this?
    Please Suggest.
    Thanks & regard.
    Amit

    http://service.sap.com/sltoolset
    click the link in the yellow text box.
    On this page you will find two entries important for you:
    Follow the links for Software Provisioning Manager (note, download link, Information links)
    At the end of the page you will find links for documentation (System Provisioning). (ECC 6.0 is an SAP Netweaver 7.0 based system).
    regards
    Peter

  • Query Modification for Invoice Outstanding

    Hi ,
    Can anybody modify this code by DocNum. This query displays the same invoice 2 times when the invoice is having more than 1 item. How to get the report without invoice number repeat.
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardName], T1.[OpenSum] ,T1.[VatSum],
    T0.WTSum AS 'TDS Amount',
    T0.DocTotal,
    (T0.DocTotal-T0.[PaidToDate]) as 'BalanceDue',
    (SELECT CASE
    WHEN T1.TargetType='14' THEN 'A/R CreditMemo'
    Else ' '
    End) as 'Target Type'
    FROM OINV T0  INNER JOIN INV1 T1 ON
    T0.DocEntry = T1.DocEntry 
    WHERE T0.[DocDate] BETWEEN '[%0]' AND '[%1]' 
    Regards
    Srini

    Hi Srini,
    Try this first:
    SELECT T0.DocNum, T0.DocDate, T0.CardName, SUM(T1.OpenSum) 'Open Sum',SUM(T1.VatSum) 'Vat Sum',
    T0.WTSum AS 'TDS Amount',
    T0.DocTotal,
    (T0.DocTotal-T0.PaidToDate) as 'BalanceDue'
    FROM OINV T0 INNER JOIN INV1 T1 ON
    T0.DocEntry = T1.DocEntry
    WHERE T0.DocDate BETWEEN '[%0\]' AND '[%1\]'
    GROUP BY T0.DocNum, T0.DocDate, T0.CardName,
    T0.WTSum,
    T0.DocTotal,T0.PaidToDate
    Thanks,
    Gordon

  • Calculate Total In Repeat Region

    Hi,
    I need to calculate a total based on fields in a repeat
    region, these values
    are stored in an SQL db, all are numeric and written in ASP.
    fields are
    TOTAL_COST VAT GRANDTOTAL (Page selects records based on
    field parameter and displays in a repeat region)
    At bottom of page need to show total sum like
    TOTAL_COST(sum of above)
    VAT(sum of above)
    GRANDTOTAL(sum of above)
    Thanks in advance
    Simon

    Above your repeat region declare three values like this
    <%
    Dim TCost = 0
    Dim VAT=0
    Dim GTotal = 0
    %>
    Then inside the repeat region simply have a line like this
    <%
    TCost = TCost + recordset.fields.item("cost").value
    %>
    Finally where you want the numbers to display you would have
    the following
    calculations
    <%
    VAT = TCost * .01
    GTotal = TCost + VAT
    %>
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "Simon Gare" <[email protected]> wrote in message
    news:e71gpa$8la$[email protected]..
    > Hi,
    >
    > I need to calculate a total based on fields in a repeat
    region, these
    > values
    > are stored in an SQL db, all are numeric and written in
    ASP.
    >
    > fields are
    >
    > TOTAL_COST VAT GRANDTOTAL (Page selects records based
    > on
    > field parameter and displays in a repeat region)
    >
    >
    > At bottom of page need to show total sum like
    >
    > TOTAL_COST(sum of above)
    > VAT(sum of above)
    > GRANDTOTAL(sum of above)
    >
    > Thanks in advance
    > Simon
    >
    >

  • Do tax Code are data time u2013independent ?

    Hi  experts,
    Due to the change of VAT Iu2019ve question. Do these tax Code are data time u2013independent?If not I must create new tax code?
    Regds Stenwa

    Tax codes have Effective From date only.  So if you have changes in rates, you should not modify the old tax code as it will create inconsistencies in the system.  You'll have to create new tax codes for new rates.
    Ravi.

Maybe you are looking for

  • ITunes is empty, how do I get my files back into it?

    This morning I was trying to clean up my Macbook, get rid of applications I'm not using, clearing caches etc. (Everything was seeming to run a bit slow - which prompted the attempt to clean up unnecessary stuff) Something ended up happening with my i

  • Mac OS X Lion Developer Preview Problems With Update

    So I just downloaded Preview 2 from the App Store with the Redemption Code, and now I've installed it and the computer takes FOREVER to start up!!! I mean like a whole day! I need lion to develop my work applications! Please Help!

  • HT5463 how i can block particular number from my contacts list

    how i can block particular number from my contacts list please guide me because even true caller software is also not supporting iphone

  • Loading library from jar file

    Hi all, My question is can we load library from jar file using System.load() method. ex: myJar.jar | |----com.test.common.Util which conatins a method to load library from jar file itself, before that i used to load from File |---libraries/MozillaPar

  • Balance Sheet report (tcode: F.01)

    Dear Experts, I would like to let Balance sheet report form  just to show the item has summarization numbers not want to show every detail account.  Could  I get it? Thanks a lot. Yacoa