buat editable untuk payment method dan nilai nya - Follow Up Deployment
Browse files- index.html +364 -617
index.html
CHANGED
|
@@ -3,659 +3,406 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<style>
|
| 10 |
-
.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
display:
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
transform: rotate(45deg);
|
| 25 |
}
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
-
|
|
|
|
| 36 |
transform: translateY(0);
|
| 37 |
-
opacity: 1;
|
| 38 |
-
pointer-events: auto;
|
| 39 |
}
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
}
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
color: #
|
|
|
|
| 47 |
}
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
| 50 |
}
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 53 |
}
|
| 54 |
</style>
|
| 55 |
</head>
|
| 56 |
<body class="bg-gray-100">
|
| 57 |
-
<
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<
|
| 62 |
-
|
| 63 |
-
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
| 64 |
-
<div>
|
| 65 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Tanggal Mulai</label>
|
| 66 |
-
<input type="date" id="startDate" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 67 |
-
</div>
|
| 68 |
-
<div>
|
| 69 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Tanggal Akhir</label>
|
| 70 |
-
<input type="date" id="endDate" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 71 |
-
</div>
|
| 72 |
-
<div>
|
| 73 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Payment Method</label>
|
| 74 |
-
<select id="paymentMethod" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 75 |
-
<option value="">-- Pilih Payment Method --</option>
|
| 76 |
-
<option value="all"><i class="fas fa-check-double mr-2"></i>Select All Payment Methods</option>
|
| 77 |
-
<option value="cash"><i class="fas fa-check mr-2 hidden"></i>Cash</option>
|
| 78 |
-
<option value="edc_bca"><i class="fas fa-check mr-2 hidden"></i>EDC BCA</option>
|
| 79 |
-
<option value="edc_bri"><i class="fas fa-check mr-2 hidden"></i>EDC BRI</option>
|
| 80 |
-
<option value="edc_bni"><i class="fas fa-check mr-2 hidden"></i>EDC BNI</option>
|
| 81 |
-
<option value="transfer_bank"><i class="fas fa-check mr-2 hidden"></i>Transfer Bank</option>
|
| 82 |
-
<option value="qris_bri"><i class="fas fa-check mr-2 hidden"></i>QRIS BRI</option>
|
| 83 |
-
</select>
|
| 84 |
-
</div>
|
| 85 |
-
<div id="subPaymentContainer" class="hidden">
|
| 86 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Sub Payment</label>
|
| 87 |
-
<select id="subPayment" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 88 |
-
<option value="">-- Pilih Sub Payment --</option>
|
| 89 |
-
<option value="all"><i class="fas fa-check-double mr-2"></i>Select All Sub Payments</option>
|
| 90 |
-
<option value="on_us"><i class="fas fa-check mr-2 hidden"></i>On Us</option>
|
| 91 |
-
<option value="off_us"><i class="fas fa-check mr-2 hidden"></i>Off Us</option>
|
| 92 |
-
</select>
|
| 93 |
-
</div>
|
| 94 |
-
<div>
|
| 95 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Outlet</label>
|
| 96 |
-
<select id="outletFilter" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 97 |
-
<option value="">-- Semua Outlet --</option>
|
| 98 |
-
<option value="Outlet A">Outlet A</option>
|
| 99 |
-
<option value="Outlet B">Outlet B</option>
|
| 100 |
-
<option value="Outlet C">Outlet C</option>
|
| 101 |
-
</select>
|
| 102 |
-
</div>
|
| 103 |
-
<div>
|
| 104 |
-
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
|
| 105 |
-
<select id="statusFilter" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 106 |
-
<option value="">-- Semua Status --</option>
|
| 107 |
-
<option value="DONE">DONE</option>
|
| 108 |
-
<option value="SETTLEMENT">SETTLEMENT</option>
|
| 109 |
-
</select>
|
| 110 |
-
</div>
|
| 111 |
-
<div class="md:col-span-2 flex items-end">
|
| 112 |
-
<button id="filterButton" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md mr-2">
|
| 113 |
-
<i class="fas fa-filter mr-2"></i>Filter
|
| 114 |
-
</button>
|
| 115 |
-
<button id="resetButton" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-4 py-2 rounded-md">
|
| 116 |
-
<i class="fas fa-redo mr-2"></i>Reset
|
| 117 |
-
</button>
|
| 118 |
-
</div>
|
| 119 |
-
</div>
|
| 120 |
-
</div>
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
<
|
| 129 |
-
|
| 130 |
-
<p class="text-sm text-gray-500 mb-2">Selected for settlement: <span id="selectedCount">0</span> transactions</p>
|
| 131 |
-
<p class="text-sm font-medium">Selected Net Sales: <span class="text-green-600" id="selectedNetSales">Rp 0</span></p>
|
| 132 |
-
</div>
|
| 133 |
-
<button id="settlementButton" class="mt-4 md:mt-0 bg-green-600 hover:bg-green-700 text-white px-6 py-2 rounded-md disabled:opacity-50 disabled:cursor-not-allowed" disabled>
|
| 134 |
-
<i class="fas fa-check-circle mr-2"></i>Settlement
|
| 135 |
</button>
|
| 136 |
</div>
|
| 137 |
|
| 138 |
-
<
|
| 139 |
-
|
| 140 |
-
<
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
<
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
</div>
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
|
|
|
|
|
|
|
|
|
| 183 |
</div>
|
| 184 |
-
|
| 185 |
-
<
|
| 186 |
-
|
| 187 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
</div>
|
| 189 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
</div>
|
| 191 |
</div>
|
| 192 |
|
| 193 |
<script>
|
| 194 |
-
//
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
{
|
| 208 |
-
|
| 209 |
-
date: '2023-06-01',
|
| 210 |
-
receipt: 'TRX-002',
|
| 211 |
-
outlet: 'Outlet B',
|
| 212 |
-
qty: 2,
|
| 213 |
-
netSales: 250000,
|
| 214 |
-
paymentMethod: 'edc_bca',
|
| 215 |
-
subPayment: 'on_us',
|
| 216 |
-
status: 'DONE'
|
| 217 |
-
},
|
| 218 |
-
{
|
| 219 |
-
id: 3,
|
| 220 |
-
date: '2023-06-02',
|
| 221 |
-
receipt: 'TRX-003',
|
| 222 |
-
outlet: 'Outlet C',
|
| 223 |
-
qty: 5,
|
| 224 |
-
netSales: 375000,
|
| 225 |
-
paymentMethod: 'edc_bri',
|
| 226 |
-
subPayment: 'off_us',
|
| 227 |
-
status: 'DONE'
|
| 228 |
-
},
|
| 229 |
-
{
|
| 230 |
-
id: 4,
|
| 231 |
-
date: '2023-06-02',
|
| 232 |
-
receipt: 'TRX-004',
|
| 233 |
-
outlet: 'Outlet A',
|
| 234 |
-
qty: 1,
|
| 235 |
-
netSales: 80000,
|
| 236 |
-
paymentMethod: 'transfer_bank',
|
| 237 |
-
subPayment: '',
|
| 238 |
-
status: 'DONE'
|
| 239 |
-
},
|
| 240 |
-
{
|
| 241 |
-
id: 5,
|
| 242 |
-
date: '2023-06-03',
|
| 243 |
-
receipt: 'TRX-005',
|
| 244 |
-
outlet: 'Outlet B',
|
| 245 |
-
qty: 4,
|
| 246 |
-
netSales: 320000,
|
| 247 |
-
paymentMethod: 'qris_bri',
|
| 248 |
-
subPayment: '',
|
| 249 |
-
status: 'DONE'
|
| 250 |
-
},
|
| 251 |
-
{
|
| 252 |
-
id: 6,
|
| 253 |
-
date: '2023-06-03',
|
| 254 |
-
receipt: 'TRX-006',
|
| 255 |
-
outlet: 'Outlet C',
|
| 256 |
-
qty: 2,
|
| 257 |
-
netSales: 120000,
|
| 258 |
-
paymentMethod: 'edc_bni',
|
| 259 |
-
subPayment: 'on_us',
|
| 260 |
-
status: 'DONE'
|
| 261 |
-
},
|
| 262 |
-
{
|
| 263 |
-
id: 7,
|
| 264 |
-
date: '2023-06-04',
|
| 265 |
-
receipt: 'TRX-007',
|
| 266 |
-
outlet: 'Outlet A',
|
| 267 |
-
qty: 3,
|
| 268 |
-
netSales: 210000,
|
| 269 |
-
paymentMethod: 'cash',
|
| 270 |
-
subPayment: '',
|
| 271 |
-
status: 'DONE'
|
| 272 |
-
},
|
| 273 |
-
{
|
| 274 |
-
id: 8,
|
| 275 |
-
date: '2023-06-04',
|
| 276 |
-
receipt: 'TRX-008',
|
| 277 |
-
outlet: 'Outlet B',
|
| 278 |
-
qty: 1,
|
| 279 |
-
netSales: 95000,
|
| 280 |
-
paymentMethod: 'edc_bca',
|
| 281 |
-
subPayment: 'off_us',
|
| 282 |
-
status: 'SETTLEMENT'
|
| 283 |
-
}
|
| 284 |
-
];
|
| 285 |
-
|
| 286 |
-
// DOM Elements
|
| 287 |
-
const transactionTableBody = document.getElementById('transactionTableBody');
|
| 288 |
-
const selectAllCheckbox = document.getElementById('selectAll');
|
| 289 |
-
const settlementButton = document.getElementById('settlementButton');
|
| 290 |
-
const totalNetSalesElement = document.getElementById('totalNetSales');
|
| 291 |
-
const selectedNetSalesElement = document.getElementById('selectedNetSales');
|
| 292 |
-
const selectedCountElement = document.getElementById('selectedCount');
|
| 293 |
-
const confirmationModal = document.getElementById('confirmationModal');
|
| 294 |
-
const closeModalButton = document.getElementById('closeModal');
|
| 295 |
-
const cancelSettlementButton = document.getElementById('cancelSettlement');
|
| 296 |
-
const confirmSettlementButton = document.getElementById('confirmSettlement');
|
| 297 |
-
const paymentMethodSelect = document.getElementById('paymentMethod');
|
| 298 |
-
const subPaymentContainer = document.getElementById('subPaymentContainer');
|
| 299 |
-
const subPaymentSelect = document.getElementById('subPayment');
|
| 300 |
-
const startDateInput = document.getElementById('startDate');
|
| 301 |
-
const endDateInput = document.getElementById('endDate');
|
| 302 |
-
const filterButton = document.getElementById('filterButton');
|
| 303 |
-
const resetButton = document.getElementById('resetButton');
|
| 304 |
-
const outletFilter = document.getElementById('outletFilter');
|
| 305 |
-
const statusFilter = document.getElementById('statusFilter');
|
| 306 |
-
|
| 307 |
-
// Format currency
|
| 308 |
-
const formatCurrency = (amount) => {
|
| 309 |
-
return 'Rp ' + amount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
| 310 |
-
};
|
| 311 |
-
|
| 312 |
-
// Calculate payment method totals
|
| 313 |
-
const calculatePaymentMethodTotals = (transactionsToCalculate) => {
|
| 314 |
-
const totals = {
|
| 315 |
-
'cash': { total: 0, settled: 0, unsettled: 0 },
|
| 316 |
-
'edc_bca': { total: 0, settled: 0, unsettled: 0 },
|
| 317 |
-
'edc_bri': { total: 0, settled: 0, unsettled: 0 },
|
| 318 |
-
'edc_bni': { total: 0, settled: 0, unsettled: 0 },
|
| 319 |
-
'transfer_bank': { total: 0, settled: 0, unsettled: 0 },
|
| 320 |
-
'qris_bri': { total: 0, settled: 0, unsettled: 0 }
|
| 321 |
-
};
|
| 322 |
-
|
| 323 |
-
transactionsToCalculate.forEach(transaction => {
|
| 324 |
-
totals[transaction.paymentMethod].total += transaction.netSales;
|
| 325 |
-
if (transaction.status === 'SETTLEMENT') {
|
| 326 |
-
totals[transaction.paymentMethod].settled += transaction.netSales;
|
| 327 |
-
} else {
|
| 328 |
-
totals[transaction.paymentMethod].unsettled += transaction.netSales;
|
| 329 |
-
}
|
| 330 |
-
});
|
| 331 |
-
|
| 332 |
-
return totals;
|
| 333 |
-
};
|
| 334 |
-
|
| 335 |
-
// Render payment method totals
|
| 336 |
-
const renderPaymentMethodTotals = (totals) => {
|
| 337 |
-
const container = document.getElementById('paymentMethodTotals');
|
| 338 |
-
container.innerHTML = '';
|
| 339 |
-
|
| 340 |
-
for (const [method, amounts] of Object.entries(totals)) {
|
| 341 |
-
const card = document.createElement('div');
|
| 342 |
-
card.className = 'bg-gray-50 rounded-lg p-3';
|
| 343 |
-
card.innerHTML = `
|
| 344 |
-
<p class="text-sm font-medium text-gray-500">${getPaymentMethodLabel(method)}</p>
|
| 345 |
-
<p class="text-lg font-semibold text-gray-800">${formatCurrency(amounts.total)}</p>
|
| 346 |
-
<div class="flex justify-between text-xs mt-1">
|
| 347 |
-
<span class="text-gray-500">Settled:</span>
|
| 348 |
-
<span class="text-green-600">${formatCurrency(amounts.settled)}</span>
|
| 349 |
-
</div>
|
| 350 |
-
<div class="flex justify-between text-xs mt-1">
|
| 351 |
-
<span class="text-gray-500">Unsettled:</span>
|
| 352 |
-
<span class="text-yellow-600">${formatCurrency(amounts.unsettled)}</span>
|
| 353 |
-
</div>
|
| 354 |
-
`;
|
| 355 |
-
container.appendChild(card);
|
| 356 |
}
|
| 357 |
-
};
|
| 358 |
-
|
| 359 |
-
//
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
let totalNetSales = 0;
|
| 365 |
-
|
| 366 |
-
// Calculate and render payment method totals
|
| 367 |
-
const paymentMethodTotals = calculatePaymentMethodTotals(transactionsToRender);
|
| 368 |
-
renderPaymentMethodTotals(paymentMethodTotals);
|
| 369 |
-
|
| 370 |
-
transactionsToRender.forEach(transaction => {
|
| 371 |
-
totalNetSales += transaction.netSales;
|
| 372 |
-
|
| 373 |
-
const row = document.createElement('tr');
|
| 374 |
-
row.className = 'hover:bg-gray-50';
|
| 375 |
-
row.innerHTML = `
|
| 376 |
-
<td class="px-6 py-4 whitespace-nowrap">
|
| 377 |
-
<div class="custom-checkbox flex items-center">
|
| 378 |
-
<input type="checkbox" data-id="${transaction.id}" data-netsales="${transaction.netSales}"
|
| 379 |
-
class="transaction-checkbox opacity-0 absolute h-5 w-5"
|
| 380 |
-
${transaction.status === 'SETTLEMENT' ? 'disabled' : ''}>
|
| 381 |
-
<span class="checkmark bg-white border-2 ${transaction.status === 'SETTLEMENT' ? 'border-gray-300 bg-gray-100' : 'border-gray-400'} rounded-md w-5 h-5 flex flex-shrink-0 justify-center items-center mr-2"></span>
|
| 382 |
-
</div>
|
| 383 |
-
</td>
|
| 384 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${transaction.date}</td>
|
| 385 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${transaction.receipt}</td>
|
| 386 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${transaction.outlet}</td>
|
| 387 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${transaction.qty}</td>
|
| 388 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(transaction.netSales)}</td>
|
| 389 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
| 390 |
-
${getPaymentMethodLabel(transaction.paymentMethod)}
|
| 391 |
-
</td>
|
| 392 |
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
| 393 |
-
${transaction.subPayment ? getSubPaymentLabel(transaction.subPayment) : '-'}
|
| 394 |
-
</td>
|
| 395 |
-
<td class="px-6 py-4 whitespace-nowrap">
|
| 396 |
-
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full
|
| 397 |
-
${transaction.status === 'DONE' ? 'bg-yellow-100 text-yellow-800' : 'bg-green-100 text-green-800'}">
|
| 398 |
-
${transaction.status}
|
| 399 |
-
</span>
|
| 400 |
-
</td>
|
| 401 |
-
`;
|
| 402 |
-
transactionTableBody.appendChild(row);
|
| 403 |
-
});
|
| 404 |
-
|
| 405 |
-
// Update total net sales
|
| 406 |
-
totalNetSalesElement.textContent = formatCurrency(totalNetSales);
|
| 407 |
-
|
| 408 |
-
// Initialize checkbox events
|
| 409 |
-
initializeCheckboxes();
|
| 410 |
-
};
|
| 411 |
-
|
| 412 |
-
// Get payment method label
|
| 413 |
-
const getPaymentMethodLabel = (method) => {
|
| 414 |
-
const methods = {
|
| 415 |
-
'cash': 'Cash',
|
| 416 |
-
'edc_bca': 'EDC BCA',
|
| 417 |
-
'edc_bri': 'EDC BRI',
|
| 418 |
-
'edc_bni': 'EDC BNI',
|
| 419 |
-
'transfer_bank': 'Transfer Bank',
|
| 420 |
-
'qris_bri': 'QRIS BRI'
|
| 421 |
-
};
|
| 422 |
-
return methods[method] || method;
|
| 423 |
-
};
|
| 424 |
-
|
| 425 |
-
// Get sub payment label
|
| 426 |
-
const getSubPaymentLabel = (subPayment) => {
|
| 427 |
-
const subPayments = {
|
| 428 |
-
'on_us': 'On Us',
|
| 429 |
-
'off_us': 'Off Us'
|
| 430 |
-
};
|
| 431 |
-
return subPayments[subPayment] || subPayment;
|
| 432 |
-
};
|
| 433 |
-
|
| 434 |
-
// Initialize checkbox events
|
| 435 |
-
const initializeCheckboxes = () => {
|
| 436 |
-
const checkboxes = document.querySelectorAll('.transaction-checkbox:not([disabled])');
|
| 437 |
-
const selectAllCheckmark = document.querySelector('#selectAll ~ .checkmark');
|
| 438 |
|
| 439 |
-
//
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
checkmark.classList.remove('bg-white', 'border-gray-400');
|
| 446 |
-
} else {
|
| 447 |
-
checkmark.classList.remove('bg-blue-600', 'border-blue-600');
|
| 448 |
-
checkmark.classList.add('bg-white', 'border-gray-400');
|
| 449 |
-
}
|
| 450 |
-
updateSelectedSummary();
|
| 451 |
-
updateSelectAllState();
|
| 452 |
-
});
|
| 453 |
-
});
|
| 454 |
|
| 455 |
-
//
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
const checkmark = checkbox.nextElementSibling;
|
| 462 |
-
if (isChecked) {
|
| 463 |
-
checkmark.classList.add('bg-blue-600', 'border-blue-600');
|
| 464 |
-
checkmark.classList.remove('bg-white', 'border-gray-400');
|
| 465 |
-
} else {
|
| 466 |
-
checkmark.classList.remove('bg-blue-600', 'border-blue-600');
|
| 467 |
-
checkmark.classList.add('bg-white', 'border-gray-400');
|
| 468 |
-
}
|
| 469 |
-
}
|
| 470 |
-
});
|
| 471 |
-
updateSelectedSummary();
|
| 472 |
-
|
| 473 |
-
// Update select all checkmark
|
| 474 |
-
if (isChecked) {
|
| 475 |
-
selectAllCheckmark.classList.add('bg-blue-600', 'border-blue-600');
|
| 476 |
-
selectAllCheckmark.classList.remove('bg-white', 'border-gray-400');
|
| 477 |
-
} else {
|
| 478 |
-
selectAllCheckmark.classList.remove('bg-blue-600', 'border-blue-600');
|
| 479 |
-
selectAllCheckmark.classList.add('bg-white', 'border-gray-400');
|
| 480 |
-
}
|
| 481 |
-
});
|
| 482 |
-
};
|
| 483 |
-
|
| 484 |
-
// Update select all checkbox state
|
| 485 |
-
const updateSelectAllState = () => {
|
| 486 |
-
const checkboxes = document.querySelectorAll('.transaction-checkbox:not([disabled])');
|
| 487 |
-
const checkedCheckboxes = document.querySelectorAll('.transaction-checkbox:not([disabled]):checked');
|
| 488 |
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
document.querySelector('#selectAll ~ .checkmark').classList.add('bg-white', 'border-gray-400');
|
| 497 |
}
|
| 498 |
-
}
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
const
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
});
|
| 508 |
-
|
| 509 |
-
selectedNetSalesElement.textContent = formatCurrency(totalSelectedNetSales);
|
| 510 |
-
selectedCountElement.textContent = checkedCheckboxes.length;
|
| 511 |
-
|
| 512 |
-
// Enable/disable settlement button
|
| 513 |
-
settlementButton.disabled = checkedCheckboxes.length === 0;
|
| 514 |
-
};
|
| 515 |
-
|
| 516 |
-
// Show confirmation modal
|
| 517 |
-
const showConfirmationModal = () => {
|
| 518 |
-
confirmationModal.classList.add('active');
|
| 519 |
-
};
|
| 520 |
-
|
| 521 |
-
// Hide confirmation modal
|
| 522 |
-
const hideConfirmationModal = () => {
|
| 523 |
-
confirmationModal.classList.remove('active');
|
| 524 |
-
};
|
| 525 |
-
|
| 526 |
-
// Process settlement
|
| 527 |
-
const processSettlement = () => {
|
| 528 |
-
const checkedCheckboxes = document.querySelectorAll('.transaction-checkbox:checked');
|
| 529 |
-
const transactionIds = Array.from(checkedCheckboxes).map(checkbox => parseInt(checkbox.dataset.id));
|
| 530 |
-
|
| 531 |
-
// Update transaction status in our data
|
| 532 |
-
transactions.forEach(transaction => {
|
| 533 |
-
if (transactionIds.includes(transaction.id)) {
|
| 534 |
-
transaction.status = 'SETTLEMENT';
|
| 535 |
-
}
|
| 536 |
-
});
|
| 537 |
-
|
| 538 |
-
// Re-render the table
|
| 539 |
-
renderTransactions(filterTransactions());
|
| 540 |
|
| 541 |
-
//
|
| 542 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 543 |
|
| 544 |
-
//
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
// Filter transactions based on selected filters
|
| 549 |
-
const filterTransactions = () => {
|
| 550 |
-
const startDate = startDateInput.value;
|
| 551 |
-
const endDate = endDateInput.value;
|
| 552 |
-
const paymentMethod = paymentMethodSelect.value;
|
| 553 |
-
const subPayment = subPaymentSelect.value;
|
| 554 |
-
const outlet = outletFilter.value;
|
| 555 |
-
const status = statusFilter.value;
|
| 556 |
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
// Filter by status
|
| 562 |
-
if (status && transaction.status !== status) return false;
|
| 563 |
-
// Filter by date range
|
| 564 |
-
if (startDate && transaction.date < startDate) return false;
|
| 565 |
-
if (endDate && transaction.date > endDate) return false;
|
| 566 |
-
|
| 567 |
-
// Filter by payment method
|
| 568 |
-
if (paymentMethod && transaction.paymentMethod !== paymentMethod) return false;
|
| 569 |
-
|
| 570 |
-
// Filter by sub payment (only for EDC payment methods)
|
| 571 |
-
if (paymentMethod && paymentMethod.startsWith('edc_') && subPayment && transaction.subPayment !== subPayment) {
|
| 572 |
-
return false;
|
| 573 |
-
}
|
| 574 |
-
|
| 575 |
-
return true;
|
| 576 |
-
});
|
| 577 |
-
};
|
| 578 |
-
|
| 579 |
-
// Event Listeners
|
| 580 |
-
settlementButton.addEventListener('click', showConfirmationModal);
|
| 581 |
-
closeModalButton.addEventListener('click', hideConfirmationModal);
|
| 582 |
-
cancelSettlementButton.addEventListener('click', hideConfirmationModal);
|
| 583 |
-
confirmSettlementButton.addEventListener('click', processSettlement);
|
| 584 |
-
|
| 585 |
-
// Payment method change event - show/hide sub payment and handle select all
|
| 586 |
-
paymentMethodSelect.addEventListener('change', function() {
|
| 587 |
-
if (this.value === 'all') {
|
| 588 |
-
// Show checkmarks for all options when "Select All" is chosen
|
| 589 |
-
this.querySelectorAll('option i.fa-check').forEach(icon => {
|
| 590 |
-
icon.classList.remove('hidden');
|
| 591 |
-
});
|
| 592 |
-
this.value = '';
|
| 593 |
-
} else {
|
| 594 |
-
// Show checkmark for selected option
|
| 595 |
-
this.querySelectorAll('option i.fa-check').forEach(icon => {
|
| 596 |
-
icon.classList.add('hidden');
|
| 597 |
-
});
|
| 598 |
-
const selectedOption = this.querySelector('option:checked');
|
| 599 |
-
if (selectedOption) {
|
| 600 |
-
selectedOption.querySelector('i.fa-check')?.classList.remove('hidden');
|
| 601 |
-
}
|
| 602 |
}
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
subPaymentContainer.classList.add('hidden');
|
| 608 |
-
subPaymentSelect.value = '';
|
| 609 |
-
}
|
| 610 |
-
});
|
| 611 |
-
|
| 612 |
-
// Sub payment change event - handle select all
|
| 613 |
-
subPaymentSelect.addEventListener('change', function() {
|
| 614 |
-
if (this.value === 'all') {
|
| 615 |
-
// Show checkmarks for all options when "Select All" is chosen
|
| 616 |
-
this.querySelectorAll('option i.fa-check').forEach(icon => {
|
| 617 |
-
icon.classList.remove('hidden');
|
| 618 |
-
});
|
| 619 |
-
this.value = '';
|
| 620 |
-
} else {
|
| 621 |
-
// Show checkmark for selected option
|
| 622 |
-
this.querySelectorAll('option i.fa-check').forEach(icon => {
|
| 623 |
-
icon.classList.add('hidden');
|
| 624 |
-
});
|
| 625 |
-
const selectedOption = this.querySelector('option:checked');
|
| 626 |
-
if (selectedOption) {
|
| 627 |
-
selectedOption.querySelector('i.fa-check')?.classList.remove('hidden');
|
| 628 |
-
}
|
| 629 |
-
}
|
| 630 |
-
});
|
| 631 |
-
|
| 632 |
-
// Filter button event
|
| 633 |
-
filterButton.addEventListener('click', function() {
|
| 634 |
-
renderTransactions(filterTransactions());
|
| 635 |
-
});
|
| 636 |
-
|
| 637 |
-
// Reset button event
|
| 638 |
-
resetButton.addEventListener('click', function() {
|
| 639 |
-
startDateInput.value = '';
|
| 640 |
-
endDateInput.value = '';
|
| 641 |
-
paymentMethodSelect.value = '';
|
| 642 |
-
subPaymentSelect.value = '';
|
| 643 |
-
subPaymentContainer.classList.add('hidden');
|
| 644 |
-
outletFilter.value = '';
|
| 645 |
-
statusFilter.value = '';
|
| 646 |
-
renderTransactions(transactions);
|
| 647 |
-
});
|
| 648 |
-
|
| 649 |
-
// Initialize with all transactions
|
| 650 |
-
renderTransactions(transactions);
|
| 651 |
-
|
| 652 |
-
// Set default dates (today and 7 days ago)
|
| 653 |
-
const today = new Date();
|
| 654 |
-
const sevenDaysAgo = new Date();
|
| 655 |
-
sevenDaysAgo.setDate(today.getDate() - 7);
|
| 656 |
-
|
| 657 |
-
startDateInput.valueAsDate = sevenDaysAgo;
|
| 658 |
-
endDateInput.valueAsDate = today;
|
| 659 |
</script>
|
| 660 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ITjez/zona" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 661 |
-
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Sales Transaction Detail</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
<style>
|
| 10 |
+
.popup-overlay {
|
| 11 |
+
position: fixed;
|
| 12 |
+
top: 0;
|
| 13 |
+
left: 0;
|
| 14 |
+
right: 0;
|
| 15 |
+
bottom: 0;
|
| 16 |
+
background-color: rgba(0, 0, 0, 0.5);
|
| 17 |
+
display: flex;
|
| 18 |
+
justify-content: center;
|
| 19 |
+
align-items: center;
|
| 20 |
+
z-index: 1000;
|
| 21 |
+
opacity: 0;
|
| 22 |
+
visibility: hidden;
|
| 23 |
+
transition: all 0.3s ease;
|
|
|
|
| 24 |
}
|
| 25 |
+
|
| 26 |
+
.popup-overlay.active {
|
| 27 |
+
opacity: 1;
|
| 28 |
+
visibility: visible;
|
| 29 |
}
|
| 30 |
+
|
| 31 |
+
.popup-container {
|
| 32 |
+
background-color: white;
|
| 33 |
+
border-radius: 0.5rem;
|
| 34 |
+
width: 90%;
|
| 35 |
+
max-width: 800px;
|
| 36 |
+
max-height: 90vh;
|
| 37 |
+
overflow-y: auto;
|
| 38 |
+
transform: translateY(20px);
|
| 39 |
+
transition: transform 0.3s ease;
|
| 40 |
}
|
| 41 |
+
|
| 42 |
+
.popup-overlay.active .popup-container {
|
| 43 |
transform: translateY(0);
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
+
|
| 46 |
+
.payment-method-icon {
|
| 47 |
+
width: 24px;
|
| 48 |
+
height: 24px;
|
| 49 |
+
margin-right: 8px;
|
| 50 |
+
object-fit: contain;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.status-badge {
|
| 54 |
+
padding: 0.25rem 0.5rem;
|
| 55 |
+
border-radius: 1rem;
|
| 56 |
+
font-size: 0.75rem;
|
| 57 |
+
font-weight: 600;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.status-done {
|
| 61 |
+
background-color: #d1fae5;
|
| 62 |
+
color: #065f46;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.status-settlement {
|
| 66 |
+
background-color: #dbeafe;
|
| 67 |
+
color: #1e40af;
|
| 68 |
}
|
| 69 |
+
|
| 70 |
+
.status-outstanding {
|
| 71 |
+
background-color: #fee2e2;
|
| 72 |
+
color: #991b1b;
|
| 73 |
}
|
| 74 |
+
|
| 75 |
+
.status-partial {
|
| 76 |
+
background-color: #fef3c7;
|
| 77 |
+
color: #92400e;
|
| 78 |
}
|
| 79 |
+
|
| 80 |
+
@media (max-width: 640px) {
|
| 81 |
+
.responsive-grid {
|
| 82 |
+
grid-template-columns: 1fr;
|
| 83 |
+
}
|
| 84 |
}
|
| 85 |
</style>
|
| 86 |
</head>
|
| 87 |
<body class="bg-gray-100">
|
| 88 |
+
<!-- Demo button to trigger popup -->
|
| 89 |
+
<div class="container mx-auto p-4">
|
| 90 |
+
<button onclick="openPopup()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded">
|
| 91 |
+
Show Transaction Detail
|
| 92 |
+
</button>
|
| 93 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
+
<!-- Popup Structure -->
|
| 96 |
+
<div id="transactionPopup" class="popup-overlay">
|
| 97 |
+
<div class="popup-container shadow-xl">
|
| 98 |
+
<!-- Header -->
|
| 99 |
+
<div class="flex justify-between items-center p-4 border-b">
|
| 100 |
+
<h2 class="text-xl font-bold text-gray-800">Transaction Detail</h2>
|
| 101 |
+
<button onclick="closePopup()" class="text-gray-500 hover:text-gray-700">
|
| 102 |
+
<i class="fas fa-times"></i>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
</button>
|
| 104 |
</div>
|
| 105 |
|
| 106 |
+
<!-- Main Content -->
|
| 107 |
+
<div class="p-4">
|
| 108 |
+
<!-- Transaction Info -->
|
| 109 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
|
| 110 |
+
<div class="bg-gray-50 p-3 rounded-lg">
|
| 111 |
+
<h3 class="font-semibold text-gray-700 mb-2">Transaction Information</h3>
|
| 112 |
+
<div class="space-y-2">
|
| 113 |
+
<div class="flex justify-between">
|
| 114 |
+
<span class="text-gray-600">Date</span>
|
| 115 |
+
<span class="font-medium">15/07/2023 14:30:22</span>
|
| 116 |
+
</div>
|
| 117 |
+
<div class="flex justify-between">
|
| 118 |
+
<span class="text-gray-600">Receipt Number</span>
|
| 119 |
+
<span class="font-medium">RC-20230715-001</span>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="flex justify-between">
|
| 122 |
+
<span class="text-gray-600">Order Number</span>
|
| 123 |
+
<span class="font-medium">ORD-20230715-001</span>
|
| 124 |
+
</div>
|
| 125 |
+
<div class="flex justify-between">
|
| 126 |
+
<span class="text-gray-600">Outlet</span>
|
| 127 |
+
<span class="font-medium">Main Store - Jakarta</span>
|
| 128 |
+
</div>
|
| 129 |
+
<div class="flex justify-between">
|
| 130 |
+
<span class="text-gray-600">Transaction Status</span>
|
| 131 |
+
<span class="status-badge status-outstanding">OUTSTANDING</span>
|
| 132 |
+
</div>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
+
|
| 136 |
+
<div class="bg-gray-50 p-3 rounded-lg">
|
| 137 |
+
<div class="flex justify-between items-center mb-2">
|
| 138 |
+
<h3 class="font-semibold text-gray-700">Payment Information</h3>
|
| 139 |
+
<button onclick="toggleEditPayment()" class="text-blue-500 hover:text-blue-700 text-sm">
|
| 140 |
+
<i class="fas fa-edit mr-1"></i> Edit
|
| 141 |
+
</button>
|
| 142 |
+
</div>
|
| 143 |
+
<div class="space-y-3">
|
| 144 |
+
<!-- Payment Method 1 -->
|
| 145 |
+
<div class="border-b pb-2">
|
| 146 |
+
<div class="flex justify-between items-center">
|
| 147 |
+
<span class="text-gray-600">Payment Method 1</span>
|
| 148 |
+
<span id="paymentMethod1Display" class="font-medium">EDC BCA</span>
|
| 149 |
+
<select id="paymentMethod1Select" class="hidden border rounded p-1 text-sm">
|
| 150 |
+
<option value="EDC BCA">EDC BCA</option>
|
| 151 |
+
<option value="EDC BRI">EDC BRI</option>
|
| 152 |
+
<option value="EDC BNI">EDC BNI</option>
|
| 153 |
+
<option value="Cash">Cash</option>
|
| 154 |
+
<option value="Transfer Bank">Transfer Bank</option>
|
| 155 |
+
</select>
|
| 156 |
</div>
|
| 157 |
+
<div class="flex justify-between mt-1">
|
| 158 |
+
<span class="text-gray-600 text-sm">Amount</span>
|
| 159 |
+
<span id="amount1Display" class="font-medium text-sm">Rp 400,000</span>
|
| 160 |
+
<input id="amount1Input" type="text" class="hidden border rounded p-1 text-sm w-24" value="400000">
|
| 161 |
+
</div>
|
| 162 |
+
<div class="flex justify-between mt-1">
|
| 163 |
+
<span class="text-gray-600 text-sm">Sub Payment</span>
|
| 164 |
+
<span id="subPayment1Display" class="font-medium text-sm">ON US</span>
|
| 165 |
+
<select id="subPayment1Select" class="hidden border rounded p-1 text-sm">
|
| 166 |
+
<option value="ON US">ON US</option>
|
| 167 |
+
<option value="OFF US">OFF US</option>
|
| 168 |
+
</select>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
|
| 172 |
+
<!-- Payment Method 2 -->
|
| 173 |
+
<div>
|
| 174 |
+
<div class="flex justify-between items-center">
|
| 175 |
+
<span class="text-gray-600">Payment Method 2</span>
|
| 176 |
+
<span id="paymentMethod2Display" class="font-medium"></span>
|
| 177 |
+
<select id="paymentMethod2Select" class="hidden border rounded p-1 text-sm">
|
| 178 |
+
<option value="">None</option>
|
| 179 |
+
<option value="EDC BCA">EDC BCA</option>
|
| 180 |
+
<option value="EDC BRI">EDC BRI</option>
|
| 181 |
+
<option value="EDC BNI">EDC BNI</option>
|
| 182 |
+
<option value="Cash">Cash</option>
|
| 183 |
+
<option value="Transfer Bank">Transfer Bank</option>
|
| 184 |
+
</select>
|
| 185 |
+
</div>
|
| 186 |
+
<div class="flex justify-between mt-1">
|
| 187 |
+
<span class="text-gray-600 text-sm">Amount</span>
|
| 188 |
+
<span id="amount2Display" class="font-medium text-sm">Rp 0</span>
|
| 189 |
+
<input id="amount2Input" type="text" class="hidden border rounded p-1 text-sm w-24" value="0">
|
| 190 |
+
</div>
|
| 191 |
+
</div>
|
| 192 |
+
|
| 193 |
+
<!-- Payment Status -->
|
| 194 |
+
<div class="flex justify-between items-center pt-2 border-t">
|
| 195 |
+
<span class="text-gray-600">Payment Status</span>
|
| 196 |
+
<div class="flex items-center">
|
| 197 |
+
<span class="status-badge status-partial mr-2">PARTIALLY PAID</span>
|
| 198 |
+
<span id="remainingDisplay" class="text-red-500 font-medium">Rp 90,000 remaining</span>
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
|
| 202 |
+
<div id="paymentEditButtons" class="hidden flex justify-end gap-2 pt-2">
|
| 203 |
+
<button onclick="cancelEditPayment()" class="px-3 py-1 border rounded text-gray-700 hover:bg-gray-50 text-sm">
|
| 204 |
+
Cancel
|
| 205 |
+
</button>
|
| 206 |
+
<button onclick="savePaymentChanges()" class="px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600 text-sm">
|
| 207 |
+
Save Changes
|
| 208 |
+
</button>
|
| 209 |
+
</div>
|
| 210 |
+
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
</div>
|
| 214 |
+
|
| 215 |
+
<!-- Product Info -->
|
| 216 |
+
<div class="mb-6">
|
| 217 |
+
<h3 class="font-semibold text-gray-700 mb-3">Product Information</h3>
|
| 218 |
+
<div class="bg-gray-50 p-3 rounded-lg overflow-x-auto">
|
| 219 |
+
<table class="min-w-full divide-y divide-gray-200">
|
| 220 |
+
<thead class="bg-gray-100">
|
| 221 |
+
<tr>
|
| 222 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Article ID</th>
|
| 223 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Article Name</th>
|
| 224 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">SKU</th>
|
| 225 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Qty</th>
|
| 226 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Gross Sales</th>
|
| 227 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nameset</th>
|
| 228 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Discount</th>
|
| 229 |
+
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Net Sales</th>
|
| 230 |
+
</tr>
|
| 231 |
+
</thead>
|
| 232 |
+
<tbody class="bg-white divide-y divide-gray-200">
|
| 233 |
+
<tr>
|
| 234 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">ART-00123</td>
|
| 235 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">Premium T-Shirt</td>
|
| 236 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">TS-PRM-BL-S</td>
|
| 237 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">2</td>
|
| 238 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">Rp 500,000</td>
|
| 239 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">Rp 40,000</td>
|
| 240 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">Rp 50,000</td>
|
| 241 |
+
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">Rp 490,000</td>
|
| 242 |
+
</tr>
|
| 243 |
+
</tbody>
|
| 244 |
+
</table>
|
| 245 |
+
</div>
|
| 246 |
+
</div>
|
| 247 |
+
|
| 248 |
+
<!-- Financial Info -->
|
| 249 |
+
<div class="mb-6">
|
| 250 |
+
<h3 class="font-semibold text-gray-700 mb-3">Financial Information</h3>
|
| 251 |
+
<div class="bg-gray-50 p-3 rounded-lg">
|
| 252 |
+
<div class="space-y-3">
|
| 253 |
+
<div class="flex justify-between">
|
| 254 |
+
<span class="text-gray-600">Gross Sales</span>
|
| 255 |
+
<span class="font-medium">Rp 500,000</span>
|
| 256 |
+
</div>
|
| 257 |
+
<div class="flex justify-between">
|
| 258 |
+
<span class="text-gray-600">Nameset</span>
|
| 259 |
+
<span class="font-medium">Rp 40,000</span>
|
| 260 |
+
</div>
|
| 261 |
+
<div class="flex justify-between">
|
| 262 |
+
<span class="text-gray-600">Discount</span>
|
| 263 |
+
<span class="font-medium">- Rp 50,000</span>
|
| 264 |
+
</div>
|
| 265 |
+
<div class="flex justify-between border-b pb-2">
|
| 266 |
+
<span class="text-gray-600">Net Sales</span>
|
| 267 |
+
<span class="font-medium">Rp 490,000</span>
|
| 268 |
+
</div>
|
| 269 |
+
<div class="flex justify-between">
|
| 270 |
+
<span class="text-gray-600">COGS</span>
|
| 271 |
+
<span class="font-medium">Rp 200,000</span>
|
| 272 |
+
</div>
|
| 273 |
+
<div class="flex justify-between">
|
| 274 |
+
<span class="text-gray-600">Gross Margin</span>
|
| 275 |
+
<span class="font-medium text-green-600">Rp 290,000 (59.18%)</span>
|
| 276 |
+
</div>
|
| 277 |
+
</div>
|
| 278 |
+
</div>
|
| 279 |
+
</div>
|
| 280 |
+
|
| 281 |
+
<!-- Payment Method Options (Hidden by default, shown when changing payment method) -->
|
| 282 |
+
<div class="hidden" id="paymentMethodOptions">
|
| 283 |
+
<h3 class="font-semibold text-gray-700 mb-3">Select Payment Method</h3>
|
| 284 |
+
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2">
|
| 285 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 286 |
+
<span>Cash</span>
|
| 287 |
+
</button>
|
| 288 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 289 |
+
<span>EDC BCA</span>
|
| 290 |
+
</button>
|
| 291 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 292 |
+
<span>EDC BRI</span>
|
| 293 |
+
</button>
|
| 294 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 295 |
+
<span>EDC BNI</span>
|
| 296 |
+
</button>
|
| 297 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 298 |
+
<span>Transfer Bank</span>
|
| 299 |
+
</button>
|
| 300 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 301 |
+
<span>QRIS BRI</span>
|
| 302 |
+
</button>
|
| 303 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 304 |
+
<span>SHOPEE</span>
|
| 305 |
+
</button>
|
| 306 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 307 |
+
<span>TIKTOK</span>
|
| 308 |
+
</button>
|
| 309 |
+
<button class="flex items-center p-2 border rounded hover:bg-gray-50">
|
| 310 |
+
<span>TOKOPEDIA</span>
|
| 311 |
+
</button>
|
| 312 |
+
</div>
|
| 313 |
</div>
|
| 314 |
</div>
|
| 315 |
+
|
| 316 |
+
<!-- Footer -->
|
| 317 |
+
<div class="flex justify-end p-4 border-t gap-2">
|
| 318 |
+
<button onclick="closePopup()" class="px-4 py-2 border rounded text-gray-700 hover:bg-gray-50">
|
| 319 |
+
Close
|
| 320 |
+
</button>
|
| 321 |
+
<button class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
|
| 322 |
+
<i class="fas fa-print mr-2"></i> Print Receipt
|
| 323 |
+
</button>
|
| 324 |
+
</div>
|
| 325 |
</div>
|
| 326 |
</div>
|
| 327 |
|
| 328 |
<script>
|
| 329 |
+
// Popup control functions
|
| 330 |
+
function openPopup() {
|
| 331 |
+
document.getElementById('transactionPopup').classList.add('active');
|
| 332 |
+
document.body.style.overflow = 'hidden';
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
function closePopup() {
|
| 336 |
+
document.getElementById('transactionPopup').classList.remove('active');
|
| 337 |
+
document.body.style.overflow = 'auto';
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
// Close popup when clicking outside
|
| 341 |
+
document.getElementById('transactionPopup').addEventListener('click', function(e) {
|
| 342 |
+
if (e.target === this) {
|
| 343 |
+
closePopup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
}
|
| 345 |
+
});
|
| 346 |
+
|
| 347 |
+
// Toggle edit mode for payment information
|
| 348 |
+
let isEditingPayment = false;
|
| 349 |
+
|
| 350 |
+
function toggleEditPayment() {
|
| 351 |
+
isEditingPayment = !isEditingPayment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
|
| 353 |
+
// Toggle display elements
|
| 354 |
+
document.getElementById('paymentMethod1Display').classList.toggle('hidden');
|
| 355 |
+
document.getElementById('paymentMethod2Display').classList.toggle('hidden');
|
| 356 |
+
document.getElementById('amount1Display').classList.toggle('hidden');
|
| 357 |
+
document.getElementById('amount2Display').classList.toggle('hidden');
|
| 358 |
+
document.getElementById('subPayment1Display').classList.toggle('hidden');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
|
| 360 |
+
// Toggle input elements
|
| 361 |
+
document.getElementById('paymentMethod1Select').classList.toggle('hidden');
|
| 362 |
+
document.getElementById('paymentMethod2Select').classList.toggle('hidden');
|
| 363 |
+
document.getElementById('amount1Input').classList.toggle('hidden');
|
| 364 |
+
document.getElementById('amount2Input').classList.toggle('hidden');
|
| 365 |
+
document.getElementById('subPayment1Select').classList.toggle('hidden');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
|
| 367 |
+
// Toggle edit buttons
|
| 368 |
+
document.getElementById('paymentEditButtons').classList.toggle('hidden');
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
function cancelEditPayment() {
|
| 372 |
+
if (isEditingPayment) {
|
| 373 |
+
toggleEditPayment();
|
|
|
|
| 374 |
}
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
function savePaymentChanges() {
|
| 378 |
+
// Get values from inputs
|
| 379 |
+
const method1 = document.getElementById('paymentMethod1Select').value;
|
| 380 |
+
const method2 = document.getElementById('paymentMethod2Select').value;
|
| 381 |
+
const amount1 = parseInt(document.getElementById('amount1Input').value) || 0;
|
| 382 |
+
const amount2 = parseInt(document.getElementById('amount2Input').value) || 0;
|
| 383 |
+
const subPayment = document.getElementById('subPayment1Select').value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
|
| 385 |
+
// Update display values
|
| 386 |
+
document.getElementById('paymentMethod1Display').textContent = method1;
|
| 387 |
+
document.getElementById('paymentMethod2Display').textContent = method2;
|
| 388 |
+
document.getElementById('amount1Display').textContent = `Rp ${amount1.toLocaleString()}`;
|
| 389 |
+
document.getElementById('amount2Display').textContent = `Rp ${amount2.toLocaleString()}`;
|
| 390 |
+
document.getElementById('subPayment1Display').textContent = subPayment;
|
| 391 |
|
| 392 |
+
// Calculate remaining amount (assuming total is 490,000 from the example)
|
| 393 |
+
const totalPaid = amount1 + amount2;
|
| 394 |
+
const remaining = 490000 - totalPaid;
|
| 395 |
+
document.getElementById('remainingDisplay').textContent = `Rp ${remaining.toLocaleString()} remaining`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 396 |
|
| 397 |
+
// Update payment status if needed
|
| 398 |
+
if (remaining <= 0) {
|
| 399 |
+
document.querySelector('.status-badge.status-partial').className = 'status-badge status-done';
|
| 400 |
+
document.querySelector('.status-badge.status-partial').textContent = 'PAID';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 401 |
}
|
| 402 |
+
|
| 403 |
+
// Exit edit mode
|
| 404 |
+
toggleEditPayment();
|
| 405 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
</script>
|
| 407 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ITjez/zona" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 408 |
+
</html>
|