Hello, AppSheet Community!
I am working on an app that involves generating purchase order documents for suppliers. Here's how my data is structured:
Other important details:
My goal is to generate a consolidated document for each supplier that lists all the items I intend to order from them, along with a total price. Considering the structure of my data, I am unsure about the best way to sum up the pricing for each order, especially since the materials for a given recipe can come from different suppliers.
Any advice or guidance on how I can achieve this would be greatly appreciated!
Thank you in advance for your assistance.
<body>
<p class="startifend"><<Start: FILTER(data_supplier,in([supplier_id],[supplier]))>></p>
<div class="container company-data">
<div class="company text">
<h1 class="title"><<[_THISROW-1].[order_list_id]>></h1>
</div>
<div class="timboel-logo"> <<LOOKUP("1RLad602hAgB6aD_E_c1Ck7_QDuxEe2Xy", "Logo PT Timboel","_ID", "File")>>
<!--<img src=""
alt="Logo PT. Timboel"
width="100">-->
</div>
</div>
<table class="header">
<thead>
<tr>
<th>Vendor</th>
<th>Customer</th>
<!-- <th>Vendor Bank</th> -->
<th colspan="3">Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<b><<[nama]>></b>
</td>
<td>
<b>PT. Timboel</b>
</td>
<!-- <td>
<b><<[bank_id].[bank_des]>></b>
</td> -->
<td>
<b>Date</b>
</td>
<td><<[tanggal]>></td>
</tr>
<tr>
<td rowspan="6"><<[supplier_id]>> <br>
<<[alamat_1]>> <br>
<<[alamat_2]>> <br>
<<[alamat_3]>> <br>
<<[no_telefon]>> <br>
<<[email]>> <br>
</td>
<td rowspan="6"> PII removed by staff
</td>
<!-- <td rowspan="5"> <<[bank_id].[atas_nama]>> <br> <<[bank_id].[nomor_account]>> <br> <<[bank_id].[nama]>> <br> <<[bank_id].[alamat]>> <br> <<[bank_id].[no_telfon]>> <br>
</td>-->
<td class="deadline">
<b >Deadline</b>
</td>
<td class="deadline"><<[_THISROW-1].[deadline]>></td>
</tr>
<!-- <tr>
<td>
<b>Packing</b>
<br>
</td>
<td><<[_THISROW-1].[jenis_packing]>></td>
</tr> -->
<tr>
<td>
<b>Mentah Deadline</b>
<br>
</td>
<td><<[_THISROW-1].[deadline_mentah]>></td>
</tr>
<tr>
<td>
<b>Rangkai Deadline</b>
<br>
</td>
<td><<[_THISROW-1].[deadline_rangkai]>></td>
</tr>
<tr>
<td>
<b>Finishing Deadline</b>
<br>
</td>
<td><<[_THISROW-1].[deadline_finishing]>></td>
</tr>
<tr>
<td rowspan="3">
<b>Comments <br>
</b>
</td>
<td rowspan="3" style="width: 30%;"><<[_THISROW-1].[komentar]>></td>
</tr>
<tr></tr>
<tr></tr>
</tbody>
</table>
<table class="order_list_id-items">
<thead>
<tr>
<th class="idcolumn">Item ID</th>
<th>Photo</th>
<th class="idcolumn">Item Name</th>
<th>Material</th>
<th class="smallcolumn">Finishing</th>
<th class="smallcolumn">Size (cm)</th>
<th >QTY</th>
<!--<th>Mentah</th>-->
<!--<th>Rangkai</th>-->
<!--<th>Finishing</th>-->
<th>Total</th>
<th style="width: 4cm;">Notes</th>
</tr>
</thead>
<tbody>
<p class="startifend"><<Start: ORDERBY(
FILTER(
"order_list_detailed",
AND(
[order_list_id] = [_THISROW].[order_list_id],
IN([_THISROW-1].[supplier_id], [Supplier List]),
[quantity_bikin]>0
)
),
[barang_id].[Finishing]
)>></p>
<tr>
<td class="idcolumn"><<[barang_id]>></td>
<td><<[barang_id].[foto]>></td>
<td class="idcolumn"><<[barang_id].[nama_barang]>></td>
<td><<[barang_id].[kategori]>></td>
<td class="smallcolumn"><<IF(SUM(
SELECT(
Resep bukan packing[Value Rupiah],
AND(
[barang_id] = [_THISROW-1].[barang_id],
[supplier_id] = [_THISROW-2].[supplier_id],
[kategori] = "finishing"
)
))=0,"Unfinish",[barang_id].[Finishing])>></td>
<td class="smallcolumn"><<[ukuran]>></td>
<td><<[quantity_bikin]>></td>
<td>
<<[quantity_bikin]*
(SUM(
SELECT(
Resep bukan packing[Value Rupiah],
AND(
[barang_id] = [_THISROW-1].[barang_id],
[supplier_id] = [_THISROW-2].[supplier_id],
[kategori] = "finishing"
)
)
) +
SUM(
SELECT(
Resep bukan packing[Value Rupiah],
AND(
[barang_id] = [_THISROW-1].[barang_id],
[supplier_id] = [_THISROW-2].[supplier_id],
[kategori] = "rangkai"
)
)
) +
SUM(
SELECT(
Resep bukan packing[Value Rupiah],
AND(
[barang_id] = [_THISROW-1].[barang_id],
[supplier_id] = [_THISROW-2].[supplier_id],
[kategori] = "mentah"
)
)
))>>
</td>
<td style="width: 4cm;"><<[komentar]>></td>
</tr>
<p class="startifend"><<End>></p>
</tbody>
</table>
<div class="post-table-info">
<table class="items-totals">
<!-- <tr>
<th>Total CBM</th>
<td colspan="2"><<[Total CBM]>> m³</td>
</tr> -->
<tr>
<th>Total QTY</th>
<td colspan="2"><<SUM(SELECT(order_list_detailed[quantity_bikin],AND(IN([_THISROW-1].[supplier_id],[Supplier List]),
[order_list_id] = [_THISROW].[order_list_id]),FALSE))>> Pcs</td>
</tr>
</table>
<table class="items-totals">
<!-- <tr>
<th>Subtotal</th>
<td colspan="2"><<[Subtotal]>></td>
</tr>
<tr>
<th>Discount (<<[discount_percent]*100>> %)</th>
<td colspan="2"><<[Diskon Persen Amount]>></td>
<td></td>
</tr>
<tr>
<th>Discount Amount</th>
<td colspan="2"><<[discount_amount]>></td>
<td></td>
</tr> -->
<th>Deposit (30%)</th>
<td><<[Deposit]>></td>
<td><<[Tanggal DP]>></td>
</tr>
<tr>
<th>Shipping Cost</th>
<td colspan="2"><<[Shipping]>></td>
<td></td>
</tr>
<tr>
<th>Balance</th>
<td><<[Balance]+[Shipping]>></td>
<td><<[Tanggal Lunas]>></td>
</tr> -->
</table>
</div>
<p class="startifend"><<End>></p>
</body>โ
User | Count |
---|---|
16 | |
13 | |
8 | |
7 | |
4 |