summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/CT.pm3
-rwxr-xr-xLedgerSMB/Form.pm4
2 files changed, 7 insertions, 0 deletions
diff --git a/LedgerSMB/CT.pm b/LedgerSMB/CT.pm
index 6154748b..8662e657 100755
--- a/LedgerSMB/CT.pm
+++ b/LedgerSMB/CT.pm
@@ -208,6 +208,9 @@ sub save_customer {
$form->{terms} *= 1;
$form->{taxincluded} *= 1;
$form->{creditlimit} = $form->parse_amount($myconfig, $form->{creditlimit});
+ if (!$form->{creditlimit}){
+ $form->{creditlimit} = 0;
+ }
if ($form->{id}) {
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 94a96dc0..a917943e 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -490,6 +490,10 @@ sub parse_amount {
my ($self, $myconfig, $amount) = @_;
+ if ($amount eq '') {
+ return undef;
+ }
+
if (UNIVERSAL::isa($amount, 'Math::BigFloat')){ # Amount may not be an object
return $amount;
}