Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pos/src/lib/pos-profile-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export interface PosProfileFull {
role_allowed_for_billing: RolePermission[];
role_restricted_for_table_order?: RolePermission[];
paid_limit?: number;
custom_allow_without_print_on_payment?: boolean
}

// Combined POS Profile with both limited and full fields
Expand All @@ -84,6 +85,7 @@ export interface PosProfileCombined extends PosProfileFull {
edit_order_type?: number;
view_all_status?: number;
custom_daily_pos_close?: number;
custom_allow_without_print_on_payment?: boolean;
}

export interface Currency {
Expand Down Expand Up @@ -133,6 +135,7 @@ export async function getCombinedPosProfile(): Promise<PosProfileCombined> {
enable_discount: limitedProfile.enable_discount,
multiple_cashier: limitedProfile.multiple_cashier,
edit_order_type: limitedProfile.edit_order_type,
custom_allow_without_print_on_payment: Boolean(fullProfile.custom_allow_without_print_on_payment),
};

return combinedProfile;
Expand Down
31 changes: 17 additions & 14 deletions pos/src/pages/Orders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,20 +464,23 @@ export default function Orders() {
{isPrinting ? <Spinner className="w-5 h-5" hideMessage /> : <Printer className="w-5 h-5" />}
</Button>
{/* Payment Button - Only show for Draft, Unbilled, and Recently Paid orders */}
{(selectedOrder.status === 'Draft' || selectedOrder.status === 'Unbilled' || selectedOrder.status === 'Recently Paid') && (
<Button
className="flex-1"
onClick={() => {
if (String(selectedOrder.invoice_printed) === '0') {
showToast.error('Please print invoice before making payment');
return;
}
setShowPaymentDialog(true);
}}
>
Payment
</Button>
)}
{(selectedOrder.status === 'Draft' || selectedOrder.status === 'Unbilled' || selectedOrder.status === 'Recently Paid') && (
<Button
className="flex-1"
onClick={() => {
const allowWithoutPrint = Boolean(
posStore.posProfile?.custom_allow_without_print_on_payment
);
if (!allowWithoutPrint && selectedOrder.invoice_printed === 0) {
showToast.error('Please print invoice before making payment');
return;
}
setShowPaymentDialog(true);
}}
>
Payment
</Button>
)}
{/* Total */}
<span className="ml-auto text-xl font-bold text-gray-900 whitespace-nowrap">
{formatCurrency(selectedOrder.rounded_total)}
Expand Down
3 changes: 2 additions & 1 deletion ury/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@
"POS Profile-custom_table_order_printer",
"POS Profile-custom_reprint_kot_format",
"Employee-payment_amount",
"Employee-payment_type"
"Employee-payment_type",
"POS Profile-custom_allow_without_print_on_payment",
},
]
],
Expand Down
1 change: 1 addition & 0 deletions ury/ury_pos/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def getPosProfile():
multiple_cashier = pos_profiles.custom_enable_multiple_cashier
edit_order_type = pos_profiles.custom_edit_order_type
enable_kot_reprint = pos_profiles.custom_enable_kot_reprint
custom_allow_without_print_on_payment = pos_profiles.custom_allow_without_print_on_payment
if multiple_cashier:
details = getBranchRoom()
room = details[0].get('name')
Expand Down