hackroot

hackroot

Member Since 1 Month Ago

Web Designer at Brandsafric

Experience Points 120
Experience Level 1

4,880 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

28 Jun
3 weeks ago

hackroot left a reply on Sharing One Database For 2 Laravel Apps?

Hi please I would like some aid on the sharing two databases Issue discussed above; Thing is I created a point of sale project and now I want to create another laravel app an Ecommerce to be precised and i want to share my current users and product details with my new app. I want to create a "add to shop" button within my old application. would be very glad for any conversations.

21 Jun
4 weeks ago

hackroot left a reply on Hiding A Section Of A Table When Empty In Laravel

I also wish to thank all of you @cronix & @jlrdw, I appreciate the help thanks a ton

hackroot left a reply on Hiding A Section Of A Table When Empty In Laravel

@DEANSATCH - Thanks a lot @deansatch your answer worked great.

hackroot left a reply on Hiding A Section Of A Table When Empty In Laravel

@CRONIX - Ok so it's not gonna be possible then? Please I am very new to PHP and LARAVEL

19 Jun
1 month ago

hackroot left a reply on Hiding A Section Of A Table When Empty In Laravel

The invoice result is like below;

Items Qty Price Total Baby Oil - Each 1 GH¢ 28.00 GH¢ 28.00 Baby Powder - Each 1 GH¢ 70.00 GH¢ 70.00 Sub Total GH¢ 98.00 Discount GH¢ 0.00 Tax GH¢ 0.00 Total GH¢ 98.00 Cash Round GH¢ 0.00 Balance GH¢ 98.00 Tendered GH¢ 100.00 (editable) Change GH¢ 2

The invoice looks like the above. Don't know if I can share an image here. What i am trying to do is to hide the discount, tax and cash round when they are GHS 0.00.

hackroot left a reply on Hiding A Section Of A Table When Empty In Laravel

Hi, @cronix, first I want to thank you for answering my question however I have tried using your methods above but the table sections still show. Although your code hasn't shown me any errors yet it didn't solve the problem. Please check from the code below if I am doing something wrong, please

The Code;

        <table class="" style="width: 290px;">
            <thead>
            <tr>
                <th>@lang('form.items')</th>
                <th class="text-center">@lang('form.qty')</th>
                <th class="text-center">@lang('form.price')</th>
                <th class="text-right">@lang('form.total')</th>
            </tr>
            </thead>
            <tbody>

            @foreach($invoice->sold_items as $lineRow)

            <tr>
                <td class="first-column"><?php echo $lineRow->item->item_name ." - ". $lineRow->unit->unit_name ; ?> </td>
                <td class="text-center"><?php echo $lineRow['quantity']; ?></td>
                <td class="text-right"><?php echo format_currency($lineRow['unit_price']); ?></td>
                <td class="text-right"><?php echo format_currency($lineRow['sub_total']); ?></td>
            </tr>

            <tr>
                <td colspan="4"></td>
            </tr>
            @endforeach

            </tbody>

            <tfoot>
                @if ($invoice->gross_total)
            <tr>
                <td colspan="3" class="text-right">@lang('form.gross_total')</td>
                <td class="text-right">{{ format_currency( $invoice->gross_total) }}</td>
            </tr>
                @endif
                
                @if ($invoice->discount_total)
            <tr>
                <td colspan="3" class="text-right" >@lang('form.discount')</td>
                <td class="text-right">{{ format_currency( $invoice->discount_total) }}</td>
            </tr>
                @endif
                
                @if ($invoice->tax_total)
            <tr>
                <td colspan="3" class="text-right">@lang('form.tax')</td>
                <td class="text-right">{{ format_currency( $invoice->tax_total) }}</td>
            </tr>
                @endif
                 
                @if ($invoice->net_total)
            <tr>
                <td colspan="3" class="text-right">@lang('form.total')</td>
                <td class="text-right">{{ format_currency( $invoice->net_total ) }}</td>
            </tr>
                @endif
                
                @if ($invoice->cash_rounded_amount)
            <tr>
                <td colspan="3" class="text-right">@lang('form.cash_round')</td>
                <td class="text-right">{{ format_currency( $invoice->cash_rounded_amount ) }}</td>
            </tr>
                @endif
                
                @if ($invoice->balance)
            <tr>
                <td colspan="3" class="text-right">@lang('form.balance')</td>
                <td class="text-right">{{ format_currency( $invoice->balance ) }}</td>
            </tr>
                @endif
            <tr>
                <td colspan="3" class="text-right">@lang('form.tendered')</td>
                <td class="text-right">{{ format_currency( $invoice->amount_received ) }}</td>
            </tr>
                
            <tr>
                <td colspan="3" class="text-right">@lang('form.change')</td>
                <td class="text-right">{{ format_currency( $invoice->amount_received - $invoice->balance ) }}</td>
            </tr>


            </tfoot>
        </table>

        <br>
        <div class="text-center thank-you-text">Thank you for your purchase!</div>
    </div>

All the sections that are suppose to be hidden still show when I am trying to print.

hackroot started a new conversation Hiding A Section Of A Table When Empty In Laravel

Hi, I am working on a pos system with laravel, currently i am trying to hide empty options on th pos receipt whe they are empty. Example I have a section for Tax, Discounts, Change, and several others however my client may not make use of Tax during sales. Is there any possible way i can make 'Tax' visible only when a value has been entered but invisible even on printed receipt when null?

My Code is Below;

@lang('form.items') @lang('form.qty') @lang('form.price') @lang('form.total')
            @foreach($invoice->sold_items as $lineRow)

            <tr>
                <td class="first-column"><?php echo $lineRow->item->item_name ." - ". $lineRow->unit->unit_name ; ?> </td>
                <td class="text-center"><?php echo $lineRow['quantity']; ?></td>
                <td class="text-right"><?php echo format_currency($lineRow['unit_price']); ?></td>
                <td class="text-right"><?php echo format_currency($lineRow['sub_total']); ?></td>
            </tr>

            <tr>
                <td colspan="4"></td>
            </tr>
            @endforeach

            </tbody>

            <tfoot>
            <tr>
                <td colspan="3" class="text-right">@lang('form.gross_total')</td>
                <td class="text-right"><?php echo format_currency( $invoice->gross_total); ?></td>
            </tr>
            <tr>
                <td colspan="3" class="text-right" >@lang('form.discount')</td>
                <td class="text-right"><?php echo format_currency( $invoice->discount_total); ?></td>
            </tr>
            <tr>
                <td colspan="3" class="text-right">@lang('form.tax')</td>
                <td class="text-right"><?php echo format_currency( $invoice->tax_total); ?></td>
            </tr>


            <tr>
                <td colspan="3" class="text-right">@lang('form.total')</td>
                <td class="text-right"><?php echo format_currency( $invoice->net_total ); ?></td>
            </tr>
            <tr>
                <td colspan="3" class="text-right">@lang('form.cash_round')</td>
                <td class="text-right"><?php echo format_currency( $invoice->cash_rounded_amount ); ?></td>
            </tr>
            <tr>
                <td colspan="3" class="text-right">@lang('form.balance')</td>
                <td class="text-right"><?php echo format_currency( $invoice->balance ); ?></td>
            </tr>

            <tr>
                <td colspan="3" class="text-right">@lang('form.tendered')</td>
                <td class="text-right"><?php echo format_currency( $invoice->amount_received ); ?></td>
            </tr>

            <tr>
                <td colspan="3" class="text-right">@lang('form.change')</td>
                <td class="text-right"><?php echo format_currency( $invoice->amount_received - $invoice->balance ); ?></td>
            </tr>


            </tfoot>
        </table>

Please check and help me thanks